From 5f2f50a9500167a484d3564d3637f37443f1bd97 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Thu, 4 Aug 2022 17:44:13 -0500 Subject: [PATCH 01/11] API errors now use custom helper methods ConvertApiErrorStatusFor* to return a message --- CMakeLists.txt | 1 + generated/nidaqmx/nidaqmx_service.cpp | 2140 ++++++++++--- generated/nidaqmx/nidaqmx_service.h | 1 + generated/nidcpower/nidcpower_service.cpp | 656 +++- generated/nidcpower/nidcpower_service.h | 1 + .../nidigitalpattern_service.cpp | 758 ++++- .../nidigitalpattern_service.h | 1 + generated/nidmm/nidmm_service.cpp | 486 ++- generated/nidmm/nidmm_service.h | 1 + generated/nifake/nifake_service.cpp | 474 ++- generated/nifake/nifake_service.h | 1 + .../nifake_extension_service.cpp | 4 + .../nifake_extension_service.h | 1 + .../nifake_non_ivi/nifake_non_ivi_service.cpp | 176 +- .../nifake_non_ivi/nifake_non_ivi_service.h | 2 + generated/nifgen/nifgen_service.cpp | 672 ++++- generated/nifgen/nifgen_service.h | 1 + .../nirfmxbluetooth_service.cpp | 942 ++++-- .../nirfmxbluetooth/nirfmxbluetooth_service.h | 1 + generated/nirfmxinstr/nirfmxinstr_service.cpp | 610 ++-- generated/nirfmxinstr/nirfmxinstr_service.h | 1 + generated/nirfmxlte/nirfmxlte_service.cpp | 2172 +++++++++----- generated/nirfmxlte/nirfmxlte_service.h | 1 + generated/nirfmxnr/nirfmxnr_service.cpp | 1810 +++++++---- generated/nirfmxnr/nirfmxnr_service.h | 1 + .../nirfmxspecan/nirfmxspecan_service.cpp | 2646 +++++++++++++---- generated/nirfmxspecan/nirfmxspecan_service.h | 1 + generated/nirfmxwlan/nirfmxwlan_service.cpp | 1780 +++++++---- generated/nirfmxwlan/nirfmxwlan_service.h | 1 + generated/nirfsa/nirfsa_service.cpp | 590 +++- generated/nirfsa/nirfsa_service.h | 1 + generated/nirfsg/nirfsg_service.cpp | 572 +++- generated/nirfsg/nirfsg_service.h | 1 + generated/niscope/niscope_service.cpp | 408 ++- generated/niscope/niscope_service.h | 1 + generated/niswitch/niswitch_service.cpp | 356 ++- generated/niswitch/niswitch_service.h | 1 + generated/nisync/nisync_service.cpp | 352 ++- generated/nisync/nisync_service.h | 1 + generated/nitclk/nitclk_service.cpp | 72 +- generated/nitclk/nitclk_service.h | 1 + generated/nixnet/nixnet_service.cpp | 224 +- generated/nixnet/nixnet_service.h | 2 + .../nixnetsocket/nixnetsocket_service.cpp | 366 +-- generated/nixnetsocket/nixnetsocket_service.h | 2 + source/codegen/metadata/nirfmxinstr/config.py | 1 + source/codegen/metadata/nirfmxnr/config.py | 1 + .../codegen/metadata/nirfmxspecan/config.py | 1 + source/codegen/templates/service.h.mako | 4 + source/codegen/templates/service_helpers.mako | 57 +- source/custom/nidaqmx_service.custom.cpp | 8 + source/custom/nidcpower_service.custom.cpp | 14 + .../nidigitalpattern_service.custom.cpp | 17 +- source/custom/nidmm_service.custom.cpp | 14 + .../nifake_extension_service.custom.cpp | 6 + .../custom/nifake_non_ivi_service.custom.cpp | 13 + source/custom/nifake_service.custom.cpp | 6 + source/custom/nifgen_service.custom.cpp | 13 + .../custom/nirfmxbluetooth_service.custom.cpp | 19 +- source/custom/nirfmxinstr_service.custom.cpp | 14 + source/custom/nirfmxlte_service.custom.cpp | 17 + source/custom/nirfmxnr_service.custom.cpp | 16 + source/custom/nirfmxspecan_service.custom.cpp | 17 + source/custom/nirfmxwlan_service.custom.cpp | 16 + source/custom/nirfsa_service.custom.cpp | 17 + source/custom/nirfsg_service.custom.cpp | 13 + source/custom/niscope_service.custom.cpp | 14 + source/custom/niswitch_service.custom.cpp | 13 + source/custom/nisync_service.custom.cpp | 8 + source/custom/nitclk_service.custom.cpp | 7 + source/custom/nixnet_service.custom.cpp | 14 + source/custom/nixnetsocket_service.custom.cpp | 17 + source/server/converters.h | 14 + 73 files changed, 13774 insertions(+), 4889 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 820e66210..56367a1bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,7 @@ add_executable(IntegrationTestsRunner "${service_output_dir}/nifake/nifake_service.cpp" "${service_output_dir}/nifake_non_ivi/nifake_non_ivi_client.cpp" "${service_output_dir}/nifake_non_ivi/nifake_non_ivi_service.cpp" + "${custom_dir}/nifake_service.custom.cpp" "${custom_dir}/nifake_non_ivi_service.custom.cpp" ) diff --git a/generated/nidaqmx/nidaqmx_service.cpp b/generated/nidaqmx/nidaqmx_service.cpp index 8294a9892..1a999edf5 100644 --- a/generated/nidaqmx/nidaqmx_service.cpp +++ b/generated/nidaqmx/nidaqmx_service.cpp @@ -57,6 +57,10 @@ namespace nidaqmx_grpc { try { auto port_list = request->port_list().c_str(); auto status = library_->AddCDAQSyncConnection(port_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -77,6 +81,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto channel_names = request->channel_names().c_str(); auto status = library_->AddGlobalChansToTask(task, channel_names); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -100,10 +108,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->AddNetworkDevice(ip_address, device_name, attempt_reservation, timeout, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 device_name_out_buffer_size = status; std::string device_name_out; @@ -115,11 +123,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_device_name_out(device_name_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_device_name_out())); - } return ::grpc::Status::OK; } } @@ -140,10 +150,12 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); bool32 disconnected_ports_exist {}; auto status = library_->AreConfiguredCDAQSyncPortsDisconnected(chassis_devices_ports, timeout, &disconnected_ports_exist); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_disconnected_ports_exist(disconnected_ports_exist); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -162,6 +174,10 @@ namespace nidaqmx_grpc { auto chassis_devices_ports = request->chassis_devices_ports().c_str(); float64 timeout = request->timeout(); auto status = library_->AutoConfigureCDAQSyncConnections(chassis_devices_ports, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -187,9 +203,11 @@ namespace nidaqmx_grpc { response->mutable_reverse_coeffs()->Resize((reverse_poly_order < 0) ? num_forward_coeffs_in : reverse_poly_order + 1, 0); float64* reverse_coeffs = response->mutable_reverse_coeffs()->mutable_data(); auto status = library_->CalculateReversePolyCoeff(forward_coeffs, num_forward_coeffs_in, min_val_x, max_val_x, num_points_to_compute, reverse_poly_order, reverse_coeffs); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -227,6 +245,10 @@ namespace nidaqmx_grpc { float64 trigger_level = request->trigger_level(); uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgAnlgEdgeRefTrig(task, trigger_source, trigger_slope, trigger_level, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -264,6 +286,10 @@ namespace nidaqmx_grpc { float64 trigger_level = request->trigger_level(); auto status = library_->CfgAnlgEdgeStartTrig(task, trigger_source, trigger_slope, trigger_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -299,6 +325,10 @@ namespace nidaqmx_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->CfgAnlgMultiEdgeRefTrig(task, trigger_sources, trigger_slope_array, trigger_level_array, pretrigger_samples, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -333,6 +363,10 @@ namespace nidaqmx_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->CfgAnlgMultiEdgeStartTrig(task, trigger_sources, trigger_slope_array, trigger_level_array, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -372,6 +406,10 @@ namespace nidaqmx_grpc { float64 window_bottom = request->window_bottom(); uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgAnlgWindowRefTrig(task, trigger_source, trigger_when, window_top, window_bottom, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -410,6 +448,10 @@ namespace nidaqmx_grpc { float64 window_top = request->window_top(); float64 window_bottom = request->window_bottom(); auto status = library_->CfgAnlgWindowStartTrig(task, trigger_source, trigger_when, window_top, window_bottom); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -496,6 +538,10 @@ namespace nidaqmx_grpc { } auto status = library_->CfgBurstHandshakingTimingExportClock(task, sample_mode, samps_per_chan, sample_clk_rate, sample_clk_outp_term, sample_clk_pulse_polarity, pause_when, ready_event_active_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -582,6 +628,10 @@ namespace nidaqmx_grpc { } auto status = library_->CfgBurstHandshakingTimingImportClock(task, sample_mode, samps_per_chan, sample_clk_rate, sample_clk_src, sample_clk_active_edge, pause_when, ready_event_active_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -620,6 +670,10 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgChangeDetectionTiming(task, rising_edge_chan, falling_edge_chan, sample_mode, samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -657,6 +711,10 @@ namespace nidaqmx_grpc { uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgDigEdgeRefTrig(task, trigger_source, trigger_edge, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -693,6 +751,10 @@ namespace nidaqmx_grpc { } auto status = library_->CfgDigEdgeStartTrig(task, trigger_source, trigger_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -731,6 +793,10 @@ namespace nidaqmx_grpc { uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgDigPatternRefTrig(task, trigger_source, trigger_pattern, trigger_when, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -768,6 +834,10 @@ namespace nidaqmx_grpc { } auto status = library_->CfgDigPatternStartTrig(task, trigger_source, trigger_pattern, trigger_when); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -804,6 +874,10 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgHandshakingTiming(task, sample_mode, samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -840,6 +914,10 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgImplicitTiming(task, sample_mode, samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -860,6 +938,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); uInt32 num_samps_per_chan = request->num_samps_per_chan(); auto status = library_->CfgInputBuffer(task, num_samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -880,6 +962,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); uInt32 num_samps_per_chan = request->num_samps_per_chan(); auto status = library_->CfgOutputBuffer(task, num_samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -934,6 +1020,10 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgPipelinedSampClkTiming(task, source, rate, active_edge, sample_mode, samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -988,6 +1078,10 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgSampClkTiming(task, source, rate, active_edge, sample_mode, samps_per_chan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1024,6 +1118,10 @@ namespace nidaqmx_grpc { } auto status = library_->CfgTimeStartTrig(task, when, timescale); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1066,6 +1164,10 @@ namespace nidaqmx_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->CfgWatchdogAOExpirStates(task, channel_names, expir_state_array, output_type_array, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1096,6 +1198,10 @@ namespace nidaqmx_grpc { uInt32 array_size = static_cast(request->expir_state_array().size()); auto status = library_->CfgWatchdogCOExpirStates(task, channel_names, expir_state_array, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1126,6 +1232,10 @@ namespace nidaqmx_grpc { uInt32 array_size = static_cast(request->expir_state_array().size()); auto status = library_->CfgWatchdogDOExpirStates(task, channel_names, expir_state_array, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1144,6 +1254,10 @@ namespace nidaqmx_grpc { try { auto physical_channel = request->physical_channel().c_str(); auto status = library_->ClearTEDS(physical_channel); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1164,6 +1278,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); session_repository_->remove_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->ClearTask(task); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1217,6 +1335,10 @@ namespace nidaqmx_grpc { } auto status = library_->ConfigureLogging(task, file_path, logging_mode, group_name, operation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1236,6 +1358,10 @@ namespace nidaqmx_grpc { auto physical_channel = request->physical_channel().c_str(); auto file_path = request->file_path().c_str(); auto status = library_->ConfigureTEDS(physical_channel, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1271,6 +1397,10 @@ namespace nidaqmx_grpc { } auto status = library_->ConnectTerms(source_terminal, destination_terminal, signal_modifiers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1306,6 +1436,10 @@ namespace nidaqmx_grpc { } auto status = library_->ControlWatchdogTask(task, action); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1397,6 +1531,10 @@ namespace nidaqmx_grpc { bool32 use_excit_for_scaling = request->use_excit_for_scaling(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIAccel4WireDCVoltageChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1487,6 +1625,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIAccelChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1560,6 +1702,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIAccelChargeChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1634,6 +1780,10 @@ namespace nidaqmx_grpc { float64 nominal_bridge_resistance = request->nominal_bridge_resistance(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1690,6 +1840,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIChargeChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1763,6 +1917,10 @@ namespace nidaqmx_grpc { float64 ext_shunt_resistor_val = request->ext_shunt_resistor_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAICurrentChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1836,6 +1994,10 @@ namespace nidaqmx_grpc { float64 ext_shunt_resistor_val = request->ext_shunt_resistor_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAICurrentRMSChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1946,6 +2108,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceBridgePolynomialChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, num_forward_coeffs, reverse_coeffs, num_reverse_coeffs, electrical_units, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2056,6 +2222,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceBridgeTableChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, num_electrical_vals, electrical_units, physical_vals, num_physical_vals, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2166,6 +2336,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceBridgeTwoPointLinChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2256,6 +2430,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceIEPEChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2298,6 +2476,10 @@ namespace nidaqmx_grpc { float64 hysteresis = request->hysteresis(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIFreqVoltageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, threshold_level, hysteresis, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2371,6 +2553,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIMicrophoneChan(task, physical_channel, name_to_assign_to_channel, terminal_config, units, mic_sensitivity, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2428,6 +2614,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPosEddyCurrProxProbeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2519,6 +2709,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPosLVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2610,6 +2804,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPosRVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2720,6 +2918,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPressureBridgePolynomialChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, num_forward_coeffs, reverse_coeffs, num_reverse_coeffs, electrical_units, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2830,6 +3032,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPressureBridgeTableChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, num_electrical_vals, electrical_units, physical_vals, num_physical_vals, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2940,6 +3146,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPressureBridgeTwoPointLinChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3029,6 +3239,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); float64 r0 = request->r0(); auto status = library_->CreateAIRTDChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, rtd_type, resistance_config, current_excit_source, current_excit_val, r0); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3102,6 +3316,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIResistanceChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3181,6 +3399,10 @@ namespace nidaqmx_grpc { float64 poisson_ratio = request->poisson_ratio(); float64 lead_wire_resistance = request->lead_wire_resistance(); auto status = library_->CreateAIRosetteStrainGageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, rosette_type, gage_orientation, rosette_meas_types, num_rosette_meas_types, strain_config, voltage_excit_source, voltage_excit_val, gage_factor, nominal_gage_resistance, poisson_ratio, lead_wire_resistance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3259,6 +3481,10 @@ namespace nidaqmx_grpc { float64 lead_wire_resistance = request->lead_wire_resistance(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIStrainGageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, strain_config, voltage_excit_source, voltage_excit_val, gage_factor, initial_bridge_voltage, nominal_gage_resistance, poisson_ratio, lead_wire_resistance, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3296,6 +3522,10 @@ namespace nidaqmx_grpc { } auto status = library_->CreateAITempBuiltInSensorChan(task, physical_channel, name_to_assign_to_channel, units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3369,6 +3599,10 @@ namespace nidaqmx_grpc { float64 cjc_val = request->cjc_val(); auto cjc_channel = request->cjc_channel().c_str(); auto status = library_->CreateAIThrmcplChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, thermocouple_type, cjc_source, cjc_val, cjc_channel); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3444,6 +3678,10 @@ namespace nidaqmx_grpc { float64 b = request->b(); float64 c = request->c(); auto status = library_->CreateAIThrmstrChanIex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, a, b, c); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3520,6 +3758,10 @@ namespace nidaqmx_grpc { float64 c = request->c(); float64 r1 = request->r1(); auto status = library_->CreateAIThrmstrChanVex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, a, b, c, r1); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3630,6 +3872,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAITorqueBridgePolynomialChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, num_forward_coeffs, reverse_coeffs, num_reverse_coeffs, electrical_units, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3740,6 +3986,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAITorqueBridgeTableChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, num_electrical_vals, electrical_units, physical_vals, num_physical_vals, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3850,6 +4100,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAITorqueBridgeTwoPointLinChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3940,6 +4194,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVelocityIEPEChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3996,6 +4254,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVoltageChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4086,6 +4348,10 @@ namespace nidaqmx_grpc { bool32 use_excit_for_scaling = request->use_excit_for_scaling(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVoltageChanWithExcit(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4142,6 +4408,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVoltageRMSChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4182,6 +4452,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAOCurrentChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4222,6 +4496,10 @@ namespace nidaqmx_grpc { float64 amplitude = request->amplitude(); float64 offset = request->offset(); auto status = library_->CreateAOFuncGenChan(task, physical_channel, name_to_assign_to_channel, type, freq, amplitude, offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4262,6 +4540,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAOVoltageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4336,6 +4618,10 @@ namespace nidaqmx_grpc { float64 initial_angle = request->initial_angle(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIAngEncoderChan(task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, pulses_per_rev, initial_angle, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4393,6 +4679,10 @@ namespace nidaqmx_grpc { uInt32 pulses_per_rev = request->pulses_per_rev(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIAngVelocityChan(task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, pulses_per_rev, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4447,6 +4737,10 @@ namespace nidaqmx_grpc { } auto status = library_->CreateCICountEdgesChan(task, counter, name_to_assign_to_channel, edge, initial_count, count_direction); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4487,6 +4781,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIDutyCycleChan(task, counter, name_to_assign_to_channel, min_freq, max_freq, edge, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4561,6 +4859,10 @@ namespace nidaqmx_grpc { uInt32 divisor = request->divisor(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIFreqChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4615,6 +4917,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIGPSTimestampChan(task, counter, name_to_assign_to_channel, units, sync_method, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4689,6 +4995,10 @@ namespace nidaqmx_grpc { float64 initial_pos = request->initial_pos(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCILinEncoderChan(task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, dist_per_pulse, initial_pos, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4746,6 +5056,10 @@ namespace nidaqmx_grpc { float64 dist_per_pulse = request->dist_per_pulse(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCILinVelocityChan(task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, dist_per_pulse, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4820,6 +5134,10 @@ namespace nidaqmx_grpc { uInt32 divisor = request->divisor(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIPeriodChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4859,6 +5177,10 @@ namespace nidaqmx_grpc { } auto status = library_->CreateCIPulseChanFreq(task, counter, name_to_assign_to_channel, min_val, max_val, units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4883,6 +5205,10 @@ namespace nidaqmx_grpc { float64 min_val = request->min_val(); float64 max_val = request->max_val(); auto status = library_->CreateCIPulseChanTicks(task, counter, name_to_assign_to_channel, source_terminal, min_val, max_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4922,6 +5248,10 @@ namespace nidaqmx_grpc { } auto status = library_->CreateCIPulseChanTime(task, counter, name_to_assign_to_channel, min_val, max_val, units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4978,6 +5308,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIPulseWidthChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, starting_edge, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5018,6 +5352,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCISemiPeriodChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5090,6 +5428,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCITwoEdgeSepChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, first_edge, second_edge, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5146,6 +5488,10 @@ namespace nidaqmx_grpc { float64 freq = request->freq(); float64 duty_cycle = request->duty_cycle(); auto status = library_->CreateCOPulseChanFreq(task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, freq, duty_cycle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5187,6 +5533,10 @@ namespace nidaqmx_grpc { int32 low_ticks = request->low_ticks(); int32 high_ticks = request->high_ticks(); auto status = library_->CreateCOPulseChanTicks(task, counter, name_to_assign_to_channel, source_terminal, idle_state, initial_delay, low_ticks, high_ticks); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5243,6 +5593,10 @@ namespace nidaqmx_grpc { float64 low_time = request->low_time(); float64 high_time = request->high_time(); auto status = library_->CreateCOPulseChanTime(task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, low_time, high_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5280,6 +5634,10 @@ namespace nidaqmx_grpc { } auto status = library_->CreateDIChan(task, lines, name_to_assign_to_lines, line_grouping); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5317,6 +5675,10 @@ namespace nidaqmx_grpc { } auto status = library_->CreateDOChan(task, lines, name_to_assign_to_lines, line_grouping); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5354,6 +5716,10 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreateLinScale(name, slope, y_intercept, pre_scaled_units, scaled_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5393,6 +5759,10 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreateMapScale(name, prescaled_min, prescaled_max, scaled_min, scaled_max, pre_scaled_units, scaled_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5432,6 +5802,10 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreatePolynomialScale(name, forward_coeffs, num_forward_coeffs_in, reverse_coeffs, num_reverse_coeffs_in, pre_scaled_units, scaled_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5505,6 +5879,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIAccelChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5562,6 +5940,10 @@ namespace nidaqmx_grpc { float64 voltage_excit_val = request->voltage_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5635,6 +6017,10 @@ namespace nidaqmx_grpc { float64 ext_shunt_resistor_val = request->ext_shunt_resistor_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAICurrentChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5692,6 +6078,10 @@ namespace nidaqmx_grpc { float64 voltage_excit_val = request->voltage_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIForceBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5765,6 +6155,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIForceIEPEChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5837,6 +6231,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIMicrophoneChan(task, physical_channel, name_to_assign_to_channel, terminal_config, units, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5911,6 +6309,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIPosLVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5985,6 +6387,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIPosRVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6042,6 +6448,10 @@ namespace nidaqmx_grpc { float64 voltage_excit_val = request->voltage_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIPressureBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6114,6 +6524,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto status = library_->CreateTEDSAIRTDChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6187,6 +6601,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIResistanceChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6246,6 +6664,10 @@ namespace nidaqmx_grpc { float64 lead_wire_resistance = request->lead_wire_resistance(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIStrainGageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, initial_bridge_voltage, lead_wire_resistance, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6303,6 +6725,10 @@ namespace nidaqmx_grpc { float64 cjc_val = request->cjc_val(); auto cjc_channel = request->cjc_channel().c_str(); auto status = library_->CreateTEDSAIThrmcplChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, cjc_source, cjc_val, cjc_channel); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6375,6 +6801,10 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto status = library_->CreateTEDSAIThrmstrChanIex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6448,6 +6878,10 @@ namespace nidaqmx_grpc { float64 voltage_excit_val = request->voltage_excit_val(); float64 r1 = request->r1(); auto status = library_->CreateTEDSAIThrmstrChanVex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, r1); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6505,6 +6939,10 @@ namespace nidaqmx_grpc { float64 voltage_excit_val = request->voltage_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAITorqueBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6561,6 +6999,10 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIVoltageChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6634,6 +7076,10 @@ namespace nidaqmx_grpc { float64 voltage_excit_val = request->voltage_excit_val(); auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIVoltageChanWithExcit(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6673,6 +7119,10 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreateTableScale(name, prescaled_vals, num_prescaled_vals_in, scaled_vals, num_scaled_vals_in, pre_scaled_units, scaled_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6700,10 +7150,12 @@ namespace nidaqmx_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_task()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6752,10 +7204,12 @@ namespace nidaqmx_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_task()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6784,10 +7238,12 @@ namespace nidaqmx_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_task()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6805,6 +7261,10 @@ namespace nidaqmx_grpc { try { auto device_name = request->device_name().c_str(); auto status = library_->DeleteNetworkDevice(device_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6823,6 +7283,10 @@ namespace nidaqmx_grpc { try { auto channel_name = request->channel_name().c_str(); auto status = library_->DeleteSavedGlobalChan(channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6841,6 +7305,10 @@ namespace nidaqmx_grpc { try { auto scale_name = request->scale_name().c_str(); auto status = library_->DeleteSavedScale(scale_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6859,6 +7327,10 @@ namespace nidaqmx_grpc { try { auto task_name = request->task_name().c_str(); auto status = library_->DeleteSavedTask(task_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6878,10 +7350,12 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); bool32 cal_supported {}; auto status = library_->DeviceSupportsCal(device_name, &cal_supported); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_cal_supported(cal_supported); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6900,6 +7374,10 @@ namespace nidaqmx_grpc { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->DisableRefTrig(task); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6919,6 +7397,10 @@ namespace nidaqmx_grpc { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->DisableStartTrig(task); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6938,6 +7420,10 @@ namespace nidaqmx_grpc { auto source_terminal = request->source_terminal().c_str(); auto destination_terminal = request->destination_terminal().c_str(); auto status = library_->DisconnectTerms(source_terminal, destination_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6974,6 +7460,10 @@ namespace nidaqmx_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(task, signal_id, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6999,14 +7489,16 @@ namespace nidaqmx_grpc { uInt32 hour {}; uInt32 minute {}; auto status = library_->GetAIChanCalCalDate(task, channel_name, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7031,14 +7523,16 @@ namespace nidaqmx_grpc { uInt32 hour {}; uInt32 minute {}; auto status = library_->GetAIChanCalExpDate(task, channel_name, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7084,12 +7578,14 @@ namespace nidaqmx_grpc { std::vector stateVector; stateVector.resize(channels.size()); auto status = ((NiDAQmxLibrary*)library_)->GetAnalogPowerUpStates(device_name, get_channelName_if(channels, 0), get_state_if(stateVector, 0), get_channelType_if(channels, 0), get_channelName_if(channels, 1), get_state_if(stateVector, 1), get_channelType_if(channels, 1), get_channelName_if(channels, 2), get_state_if(stateVector, 2), get_channelType_if(channels, 2), get_channelName_if(channels, 3), get_state_if(stateVector, 3), get_channelType_if(channels, 3), get_channelName_if(channels, 4), get_state_if(stateVector, 4), get_channelType_if(channels, 4), get_channelName_if(channels, 5), get_state_if(stateVector, 5), get_channelType_if(channels, 5), get_channelName_if(channels, 6), get_state_if(stateVector, 6), get_channelType_if(channels, 6), get_channelName_if(channels, 7), get_state_if(stateVector, 7), get_channelType_if(channels, 7), get_channelName_if(channels, 8), get_state_if(stateVector, 8), get_channelType_if(channels, 8), get_channelName_if(channels, 9), get_state_if(stateVector, 9), get_channelType_if(channels, 9), get_channelName_if(channels, 10), get_state_if(stateVector, 10), get_channelType_if(channels, 10), get_channelName_if(channels, 11), get_state_if(stateVector, 11), get_channelType_if(channels, 11), get_channelName_if(channels, 12), get_state_if(stateVector, 12), get_channelType_if(channels, 12), get_channelName_if(channels, 13), get_state_if(stateVector, 13), get_channelType_if(channels, 13), get_channelName_if(channels, 14), get_state_if(stateVector, 14), get_channelType_if(channels, 14), get_channelName_if(channels, 15), get_state_if(stateVector, 15), get_channelType_if(channels, 15), get_channelName_if(channels, 16), get_state_if(stateVector, 16), get_channelType_if(channels, 16), get_channelName_if(channels, 17), get_state_if(stateVector, 17), get_channelType_if(channels, 17), get_channelName_if(channels, 18), get_state_if(stateVector, 18), get_channelType_if(channels, 18), get_channelName_if(channels, 19), get_state_if(stateVector, 19), get_channelType_if(channels, 19), get_channelName_if(channels, 20), get_state_if(stateVector, 20), get_channelType_if(channels, 20), get_channelName_if(channels, 21), get_state_if(stateVector, 21), get_channelType_if(channels, 21), get_channelName_if(channels, 22), get_state_if(stateVector, 22), get_channelType_if(channels, 22), get_channelName_if(channels, 23), get_state_if(stateVector, 23), get_channelType_if(channels, 23), get_channelName_if(channels, 24), get_state_if(stateVector, 24), get_channelType_if(channels, 24), get_channelName_if(channels, 25), get_state_if(stateVector, 25), get_channelType_if(channels, 25), get_channelName_if(channels, 26), get_state_if(stateVector, 26), get_channelType_if(channels, 26), get_channelName_if(channels, 27), get_state_if(stateVector, 27), get_channelType_if(channels, 27), get_channelName_if(channels, 28), get_state_if(stateVector, 28), get_channelType_if(channels, 28), get_channelName_if(channels, 29), get_state_if(stateVector, 29), get_channelType_if(channels, 29), get_channelName_if(channels, 30), get_state_if(stateVector, 30), get_channelType_if(channels, 30), get_channelName_if(channels, 31), get_state_if(stateVector, 31), get_channelType_if(channels, 31), get_channelName_if(channels, 32), get_state_if(stateVector, 32), get_channelType_if(channels, 32), get_channelName_if(channels, 33), get_state_if(stateVector, 33), get_channelType_if(channels, 33), get_channelName_if(channels, 34), get_state_if(stateVector, 34), get_channelType_if(channels, 34), get_channelName_if(channels, 35), get_state_if(stateVector, 35), get_channelType_if(channels, 35), get_channelName_if(channels, 36), get_state_if(stateVector, 36), get_channelType_if(channels, 36), get_channelName_if(channels, 37), get_state_if(stateVector, 37), get_channelType_if(channels, 37), get_channelName_if(channels, 38), get_state_if(stateVector, 38), get_channelType_if(channels, 38), get_channelName_if(channels, 39), get_state_if(stateVector, 39), get_channelType_if(channels, 39), get_channelName_if(channels, 40), get_state_if(stateVector, 40), get_channelType_if(channels, 40), get_channelName_if(channels, 41), get_state_if(stateVector, 41), get_channelType_if(channels, 41), get_channelName_if(channels, 42), get_state_if(stateVector, 42), get_channelType_if(channels, 42), get_channelName_if(channels, 43), get_state_if(stateVector, 43), get_channelType_if(channels, 43), get_channelName_if(channels, 44), get_state_if(stateVector, 44), get_channelType_if(channels, 44), get_channelName_if(channels, 45), get_state_if(stateVector, 45), get_channelType_if(channels, 45), get_channelName_if(channels, 46), get_state_if(stateVector, 46), get_channelType_if(channels, 46), get_channelName_if(channels, 47), get_state_if(stateVector, 47), get_channelType_if(channels, 47), get_channelName_if(channels, 48), get_state_if(stateVector, 48), get_channelType_if(channels, 48), get_channelName_if(channels, 49), get_state_if(stateVector, 49), get_channelType_if(channels, 49), get_channelName_if(channels, 50), get_state_if(stateVector, 50), get_channelType_if(channels, 50), get_channelName_if(channels, 51), get_state_if(stateVector, 51), get_channelType_if(channels, 51), get_channelName_if(channels, 52), get_state_if(stateVector, 52), get_channelType_if(channels, 52), get_channelName_if(channels, 53), get_state_if(stateVector, 53), get_channelType_if(channels, 53), get_channelName_if(channels, 54), get_state_if(stateVector, 54), get_channelType_if(channels, 54), get_channelName_if(channels, 55), get_state_if(stateVector, 55), get_channelType_if(channels, 55), get_channelName_if(channels, 56), get_state_if(stateVector, 56), get_channelType_if(channels, 56), get_channelName_if(channels, 57), get_state_if(stateVector, 57), get_channelType_if(channels, 57), get_channelName_if(channels, 58), get_state_if(stateVector, 58), get_channelType_if(channels, 58), get_channelName_if(channels, 59), get_state_if(stateVector, 59), get_channelType_if(channels, 59), get_channelName_if(channels, 60), get_state_if(stateVector, 60), get_channelType_if(channels, 60), get_channelName_if(channels, 61), get_state_if(stateVector, 61), get_channelType_if(channels, 61), get_channelName_if(channels, 62), get_state_if(stateVector, 62), get_channelType_if(channels, 62), get_channelName_if(channels, 63), get_state_if(stateVector, 63), get_channelType_if(channels, 63), get_channelName_if(channels, 64), get_state_if(stateVector, 64), get_channelType_if(channels, 64), get_channelName_if(channels, 65), get_state_if(stateVector, 65), get_channelType_if(channels, 65), get_channelName_if(channels, 66), get_state_if(stateVector, 66), get_channelType_if(channels, 66), get_channelName_if(channels, 67), get_state_if(stateVector, 67), get_channelType_if(channels, 67), get_channelName_if(channels, 68), get_state_if(stateVector, 68), get_channelType_if(channels, 68), get_channelName_if(channels, 69), get_state_if(stateVector, 69), get_channelType_if(channels, 69), get_channelName_if(channels, 70), get_state_if(stateVector, 70), get_channelType_if(channels, 70), get_channelName_if(channels, 71), get_state_if(stateVector, 71), get_channelType_if(channels, 71), get_channelName_if(channels, 72), get_state_if(stateVector, 72), get_channelType_if(channels, 72), get_channelName_if(channels, 73), get_state_if(stateVector, 73), get_channelType_if(channels, 73), get_channelName_if(channels, 74), get_state_if(stateVector, 74), get_channelType_if(channels, 74), get_channelName_if(channels, 75), get_state_if(stateVector, 75), get_channelType_if(channels, 75), get_channelName_if(channels, 76), get_state_if(stateVector, 76), get_channelType_if(channels, 76), get_channelName_if(channels, 77), get_state_if(stateVector, 77), get_channelType_if(channels, 77), get_channelName_if(channels, 78), get_state_if(stateVector, 78), get_channelType_if(channels, 78), get_channelName_if(channels, 79), get_state_if(stateVector, 79), get_channelType_if(channels, 79), get_channelName_if(channels, 80), get_state_if(stateVector, 80), get_channelType_if(channels, 80), get_channelName_if(channels, 81), get_state_if(stateVector, 81), get_channelType_if(channels, 81), get_channelName_if(channels, 82), get_state_if(stateVector, 82), get_channelType_if(channels, 82), get_channelName_if(channels, 83), get_state_if(stateVector, 83), get_channelType_if(channels, 83), get_channelName_if(channels, 84), get_state_if(stateVector, 84), get_channelType_if(channels, 84), get_channelName_if(channels, 85), get_state_if(stateVector, 85), get_channelType_if(channels, 85), get_channelName_if(channels, 86), get_state_if(stateVector, 86), get_channelType_if(channels, 86), get_channelName_if(channels, 87), get_state_if(stateVector, 87), get_channelType_if(channels, 87), get_channelName_if(channels, 88), get_state_if(stateVector, 88), get_channelType_if(channels, 88), get_channelName_if(channels, 89), get_state_if(stateVector, 89), get_channelType_if(channels, 89), get_channelName_if(channels, 90), get_state_if(stateVector, 90), get_channelType_if(channels, 90), get_channelName_if(channels, 91), get_state_if(stateVector, 91), get_channelType_if(channels, 91), get_channelName_if(channels, 92), get_state_if(stateVector, 92), get_channelType_if(channels, 92), get_channelName_if(channels, 93), get_state_if(stateVector, 93), get_channelType_if(channels, 93), get_channelName_if(channels, 94), get_state_if(stateVector, 94), get_channelType_if(channels, 94), get_channelName_if(channels, 95), get_state_if(stateVector, 95), get_channelType_if(channels, 95), get_channelName_if(channels, 96), get_state_if(stateVector, 96), get_channelType_if(channels, 96)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { for (int i = 0; i < stateVector.size(); ++i) { response->add_power_up_states(stateVector[i]); } - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7112,8 +7608,11 @@ namespace nidaqmx_grpc { response->mutable_channel_type_array_raw()->Resize(array_size_copy, 0); int32* channel_type_array = reinterpret_cast(response->mutable_channel_type_array_raw()->mutable_data()); auto status = library_->GetAnalogPowerUpStatesWithOutputType(channel_names, state_array, channel_type_array, &array_size_copy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_state_array()->Resize(array_size_copy, 0); response->mutable_channel_type_array()->Clear(); response->mutable_channel_type_array()->Reserve(array_size_copy); @@ -7124,7 +7623,6 @@ namespace nidaqmx_grpc { [&](auto x) { return static_cast(x); }); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7144,10 +7642,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetArmStartTrigTimestampVal(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7167,10 +7667,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetArmStartTrigTrigWhen(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7189,10 +7691,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetAutoConfiguredCDAQSyncConnections(nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 port_list_size = status; std::string port_list; @@ -7204,11 +7706,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_port_list(port_list); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); - } return ::grpc::Status::OK; } } @@ -7248,10 +7752,12 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetBufferAttributeUInt32(task, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7290,10 +7796,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetCalInfoAttributeBool(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7332,10 +7840,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetCalInfoAttributeDouble(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7374,10 +7884,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetCalInfoAttributeString(device_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -7389,11 +7899,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -7433,10 +7945,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetCalInfoAttributeUInt32(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7477,10 +7991,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetChanAttributeBool(task, channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7521,10 +8037,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetChanAttributeDouble(task, channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7565,10 +8083,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetChanAttributeDoubleArray(task, channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -7578,9 +8096,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -7622,8 +8142,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetChanAttributeInt32(task, channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ChannelInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -7631,7 +8154,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7672,10 +8194,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetChanAttributeString(task, channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -7687,11 +8209,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -7733,10 +8257,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetChanAttributeUInt32(task, channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7775,10 +8301,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetDeviceAttributeBool(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7817,10 +8345,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetDeviceAttributeDouble(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7859,10 +8389,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeDoubleArray(device_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -7872,9 +8402,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -7914,8 +8446,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetDeviceAttributeInt32(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -7923,7 +8458,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7962,10 +8496,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeInt32Array(device_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value_raw()->Resize(size, 0); @@ -7975,8 +8509,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -7991,7 +8528,6 @@ namespace nidaqmx_grpc { [&](auto x) { return checked_convert_value(x); }); - } return ::grpc::Status::OK; } } @@ -8031,10 +8567,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeString(device_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -8046,11 +8582,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -8090,10 +8628,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetDeviceAttributeUInt32(device_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8132,10 +8672,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeUInt32Array(device_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -8145,9 +8685,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -8167,10 +8709,12 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); int32 logic_family {}; auto status = library_->GetDigitalLogicFamilyPowerUpState(device_name, &logic_family); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_logic_family(logic_family); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8210,12 +8754,14 @@ namespace nidaqmx_grpc { std::vector stateVector; stateVector.resize(channel_name.size()); auto status = ((NiDAQmxLibrary*)library_)->GetDigitalPowerUpStates(device_name, get_channelName_if(channel_name, 0), get_state_if(stateVector, 0), get_channelName_if(channel_name, 1), get_state_if(stateVector, 1), get_channelName_if(channel_name, 2), get_state_if(stateVector, 2), get_channelName_if(channel_name, 3), get_state_if(stateVector, 3), get_channelName_if(channel_name, 4), get_state_if(stateVector, 4), get_channelName_if(channel_name, 5), get_state_if(stateVector, 5), get_channelName_if(channel_name, 6), get_state_if(stateVector, 6), get_channelName_if(channel_name, 7), get_state_if(stateVector, 7), get_channelName_if(channel_name, 8), get_state_if(stateVector, 8), get_channelName_if(channel_name, 9), get_state_if(stateVector, 9), get_channelName_if(channel_name, 10), get_state_if(stateVector, 10), get_channelName_if(channel_name, 11), get_state_if(stateVector, 11), get_channelName_if(channel_name, 12), get_state_if(stateVector, 12), get_channelName_if(channel_name, 13), get_state_if(stateVector, 13), get_channelName_if(channel_name, 14), get_state_if(stateVector, 14), get_channelName_if(channel_name, 15), get_state_if(stateVector, 15), get_channelName_if(channel_name, 16), get_state_if(stateVector, 16), get_channelName_if(channel_name, 17), get_state_if(stateVector, 17), get_channelName_if(channel_name, 18), get_state_if(stateVector, 18), get_channelName_if(channel_name, 19), get_state_if(stateVector, 19), get_channelName_if(channel_name, 20), get_state_if(stateVector, 20), get_channelName_if(channel_name, 21), get_state_if(stateVector, 21), get_channelName_if(channel_name, 22), get_state_if(stateVector, 22), get_channelName_if(channel_name, 23), get_state_if(stateVector, 23), get_channelName_if(channel_name, 24), get_state_if(stateVector, 24), get_channelName_if(channel_name, 25), get_state_if(stateVector, 25), get_channelName_if(channel_name, 26), get_state_if(stateVector, 26), get_channelName_if(channel_name, 27), get_state_if(stateVector, 27), get_channelName_if(channel_name, 28), get_state_if(stateVector, 28), get_channelName_if(channel_name, 29), get_state_if(stateVector, 29), get_channelName_if(channel_name, 30), get_state_if(stateVector, 30), get_channelName_if(channel_name, 31), get_state_if(stateVector, 31), get_channelName_if(channel_name, 32), get_state_if(stateVector, 32), get_channelName_if(channel_name, 33), get_state_if(stateVector, 33), get_channelName_if(channel_name, 34), get_state_if(stateVector, 34), get_channelName_if(channel_name, 35), get_state_if(stateVector, 35), get_channelName_if(channel_name, 36), get_state_if(stateVector, 36), get_channelName_if(channel_name, 37), get_state_if(stateVector, 37), get_channelName_if(channel_name, 38), get_state_if(stateVector, 38), get_channelName_if(channel_name, 39), get_state_if(stateVector, 39), get_channelName_if(channel_name, 40), get_state_if(stateVector, 40), get_channelName_if(channel_name, 41), get_state_if(stateVector, 41), get_channelName_if(channel_name, 42), get_state_if(stateVector, 42), get_channelName_if(channel_name, 43), get_state_if(stateVector, 43), get_channelName_if(channel_name, 44), get_state_if(stateVector, 44), get_channelName_if(channel_name, 45), get_state_if(stateVector, 45), get_channelName_if(channel_name, 46), get_state_if(stateVector, 46), get_channelName_if(channel_name, 47), get_state_if(stateVector, 47), get_channelName_if(channel_name, 48), get_state_if(stateVector, 48), get_channelName_if(channel_name, 49), get_state_if(stateVector, 49), get_channelName_if(channel_name, 50), get_state_if(stateVector, 50), get_channelName_if(channel_name, 51), get_state_if(stateVector, 51), get_channelName_if(channel_name, 52), get_state_if(stateVector, 52), get_channelName_if(channel_name, 53), get_state_if(stateVector, 53), get_channelName_if(channel_name, 54), get_state_if(stateVector, 54), get_channelName_if(channel_name, 55), get_state_if(stateVector, 55), get_channelName_if(channel_name, 56), get_state_if(stateVector, 56), get_channelName_if(channel_name, 57), get_state_if(stateVector, 57), get_channelName_if(channel_name, 58), get_state_if(stateVector, 58), get_channelName_if(channel_name, 59), get_state_if(stateVector, 59), get_channelName_if(channel_name, 60), get_state_if(stateVector, 60), get_channelName_if(channel_name, 61), get_state_if(stateVector, 61), get_channelName_if(channel_name, 62), get_state_if(stateVector, 62), get_channelName_if(channel_name, 63), get_state_if(stateVector, 63), get_channelName_if(channel_name, 64), get_state_if(stateVector, 64), get_channelName_if(channel_name, 65), get_state_if(stateVector, 65), get_channelName_if(channel_name, 66), get_state_if(stateVector, 66), get_channelName_if(channel_name, 67), get_state_if(stateVector, 67), get_channelName_if(channel_name, 68), get_state_if(stateVector, 68), get_channelName_if(channel_name, 69), get_state_if(stateVector, 69), get_channelName_if(channel_name, 70), get_state_if(stateVector, 70), get_channelName_if(channel_name, 71), get_state_if(stateVector, 71), get_channelName_if(channel_name, 72), get_state_if(stateVector, 72), get_channelName_if(channel_name, 73), get_state_if(stateVector, 73), get_channelName_if(channel_name, 74), get_state_if(stateVector, 74), get_channelName_if(channel_name, 75), get_state_if(stateVector, 75), get_channelName_if(channel_name, 76), get_state_if(stateVector, 76), get_channelName_if(channel_name, 77), get_state_if(stateVector, 77), get_channelName_if(channel_name, 78), get_state_if(stateVector, 78), get_channelName_if(channel_name, 79), get_state_if(stateVector, 79), get_channelName_if(channel_name, 80), get_state_if(stateVector, 80), get_channelName_if(channel_name, 81), get_state_if(stateVector, 81), get_channelName_if(channel_name, 82), get_state_if(stateVector, 82), get_channelName_if(channel_name, 83), get_state_if(stateVector, 83), get_channelName_if(channel_name, 84), get_state_if(stateVector, 84), get_channelName_if(channel_name, 85), get_state_if(stateVector, 85), get_channelName_if(channel_name, 86), get_state_if(stateVector, 86), get_channelName_if(channel_name, 87), get_state_if(stateVector, 87), get_channelName_if(channel_name, 88), get_state_if(stateVector, 88), get_channelName_if(channel_name, 89), get_state_if(stateVector, 89), get_channelName_if(channel_name, 90), get_state_if(stateVector, 90), get_channelName_if(channel_name, 91), get_state_if(stateVector, 91), get_channelName_if(channel_name, 92), get_state_if(stateVector, 92), get_channelName_if(channel_name, 93), get_state_if(stateVector, 93), get_channelName_if(channel_name, 94), get_state_if(stateVector, 94), get_channelName_if(channel_name, 95), get_state_if(stateVector, 95), get_channelName_if(channel_name, 96), get_state_if(stateVector, 96)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { for (int i = 0; i < stateVector.size(); ++i) { response->add_power_up_states(static_cast(stateVector[i])); } - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8255,12 +8801,14 @@ namespace nidaqmx_grpc { std::vector stateVector; stateVector.resize(channel_name.size()); auto status = ((NiDAQmxLibrary*)library_)->GetDigitalPullUpPullDownStates(device_name, get_channelName_if(channel_name, 0), get_state_if(stateVector, 0), get_channelName_if(channel_name, 1), get_state_if(stateVector, 1), get_channelName_if(channel_name, 2), get_state_if(stateVector, 2), get_channelName_if(channel_name, 3), get_state_if(stateVector, 3), get_channelName_if(channel_name, 4), get_state_if(stateVector, 4), get_channelName_if(channel_name, 5), get_state_if(stateVector, 5), get_channelName_if(channel_name, 6), get_state_if(stateVector, 6), get_channelName_if(channel_name, 7), get_state_if(stateVector, 7), get_channelName_if(channel_name, 8), get_state_if(stateVector, 8), get_channelName_if(channel_name, 9), get_state_if(stateVector, 9), get_channelName_if(channel_name, 10), get_state_if(stateVector, 10), get_channelName_if(channel_name, 11), get_state_if(stateVector, 11), get_channelName_if(channel_name, 12), get_state_if(stateVector, 12), get_channelName_if(channel_name, 13), get_state_if(stateVector, 13), get_channelName_if(channel_name, 14), get_state_if(stateVector, 14), get_channelName_if(channel_name, 15), get_state_if(stateVector, 15), get_channelName_if(channel_name, 16), get_state_if(stateVector, 16), get_channelName_if(channel_name, 17), get_state_if(stateVector, 17), get_channelName_if(channel_name, 18), get_state_if(stateVector, 18), get_channelName_if(channel_name, 19), get_state_if(stateVector, 19), get_channelName_if(channel_name, 20), get_state_if(stateVector, 20), get_channelName_if(channel_name, 21), get_state_if(stateVector, 21), get_channelName_if(channel_name, 22), get_state_if(stateVector, 22), get_channelName_if(channel_name, 23), get_state_if(stateVector, 23), get_channelName_if(channel_name, 24), get_state_if(stateVector, 24), get_channelName_if(channel_name, 25), get_state_if(stateVector, 25), get_channelName_if(channel_name, 26), get_state_if(stateVector, 26), get_channelName_if(channel_name, 27), get_state_if(stateVector, 27), get_channelName_if(channel_name, 28), get_state_if(stateVector, 28), get_channelName_if(channel_name, 29), get_state_if(stateVector, 29), get_channelName_if(channel_name, 30), get_state_if(stateVector, 30), get_channelName_if(channel_name, 31), get_state_if(stateVector, 31), get_channelName_if(channel_name, 32), get_state_if(stateVector, 32), get_channelName_if(channel_name, 33), get_state_if(stateVector, 33), get_channelName_if(channel_name, 34), get_state_if(stateVector, 34), get_channelName_if(channel_name, 35), get_state_if(stateVector, 35), get_channelName_if(channel_name, 36), get_state_if(stateVector, 36), get_channelName_if(channel_name, 37), get_state_if(stateVector, 37), get_channelName_if(channel_name, 38), get_state_if(stateVector, 38), get_channelName_if(channel_name, 39), get_state_if(stateVector, 39), get_channelName_if(channel_name, 40), get_state_if(stateVector, 40), get_channelName_if(channel_name, 41), get_state_if(stateVector, 41), get_channelName_if(channel_name, 42), get_state_if(stateVector, 42), get_channelName_if(channel_name, 43), get_state_if(stateVector, 43), get_channelName_if(channel_name, 44), get_state_if(stateVector, 44), get_channelName_if(channel_name, 45), get_state_if(stateVector, 45), get_channelName_if(channel_name, 46), get_state_if(stateVector, 46), get_channelName_if(channel_name, 47), get_state_if(stateVector, 47), get_channelName_if(channel_name, 48), get_state_if(stateVector, 48), get_channelName_if(channel_name, 49), get_state_if(stateVector, 49), get_channelName_if(channel_name, 50), get_state_if(stateVector, 50), get_channelName_if(channel_name, 51), get_state_if(stateVector, 51), get_channelName_if(channel_name, 52), get_state_if(stateVector, 52), get_channelName_if(channel_name, 53), get_state_if(stateVector, 53), get_channelName_if(channel_name, 54), get_state_if(stateVector, 54), get_channelName_if(channel_name, 55), get_state_if(stateVector, 55), get_channelName_if(channel_name, 56), get_state_if(stateVector, 56), get_channelName_if(channel_name, 57), get_state_if(stateVector, 57), get_channelName_if(channel_name, 58), get_state_if(stateVector, 58), get_channelName_if(channel_name, 59), get_state_if(stateVector, 59), get_channelName_if(channel_name, 60), get_state_if(stateVector, 60), get_channelName_if(channel_name, 61), get_state_if(stateVector, 61), get_channelName_if(channel_name, 62), get_state_if(stateVector, 62), get_channelName_if(channel_name, 63), get_state_if(stateVector, 63), get_channelName_if(channel_name, 64), get_state_if(stateVector, 64), get_channelName_if(channel_name, 65), get_state_if(stateVector, 65), get_channelName_if(channel_name, 66), get_state_if(stateVector, 66), get_channelName_if(channel_name, 67), get_state_if(stateVector, 67), get_channelName_if(channel_name, 68), get_state_if(stateVector, 68), get_channelName_if(channel_name, 69), get_state_if(stateVector, 69), get_channelName_if(channel_name, 70), get_state_if(stateVector, 70), get_channelName_if(channel_name, 71), get_state_if(stateVector, 71), get_channelName_if(channel_name, 72), get_state_if(stateVector, 72), get_channelName_if(channel_name, 73), get_state_if(stateVector, 73), get_channelName_if(channel_name, 74), get_state_if(stateVector, 74), get_channelName_if(channel_name, 75), get_state_if(stateVector, 75), get_channelName_if(channel_name, 76), get_state_if(stateVector, 76), get_channelName_if(channel_name, 77), get_state_if(stateVector, 77), get_channelName_if(channel_name, 78), get_state_if(stateVector, 78), get_channelName_if(channel_name, 79), get_state_if(stateVector, 79), get_channelName_if(channel_name, 80), get_state_if(stateVector, 80), get_channelName_if(channel_name, 81), get_state_if(stateVector, 81), get_channelName_if(channel_name, 82), get_state_if(stateVector, 82), get_channelName_if(channel_name, 83), get_state_if(stateVector, 83), get_channelName_if(channel_name, 84), get_state_if(stateVector, 84), get_channelName_if(channel_name, 85), get_state_if(stateVector, 85), get_channelName_if(channel_name, 86), get_state_if(stateVector, 86), get_channelName_if(channel_name, 87), get_state_if(stateVector, 87), get_channelName_if(channel_name, 88), get_state_if(stateVector, 88), get_channelName_if(channel_name, 89), get_state_if(stateVector, 89), get_channelName_if(channel_name, 90), get_state_if(stateVector, 90), get_channelName_if(channel_name, 91), get_state_if(stateVector, 91), get_channelName_if(channel_name, 92), get_state_if(stateVector, 92), get_channelName_if(channel_name, 93), get_state_if(stateVector, 93), get_channelName_if(channel_name, 94), get_state_if(stateVector, 94), get_channelName_if(channel_name, 95), get_state_if(stateVector, 95), get_channelName_if(channel_name, 96), get_state_if(stateVector, 96)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { for (int i = 0; i < stateVector.size(); ++i) { response->add_pull_up_pull_down_states(static_cast(stateVector[i])); } - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8279,10 +8827,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDisconnectedCDAQSyncPorts(nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 port_list_size = status; std::string port_list; @@ -8294,11 +8842,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_port_list(port_list); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); - } return ::grpc::Status::OK; } } @@ -8319,10 +8869,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetErrorString(error_code, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 buffer_size = status; std::string error_string; @@ -8334,11 +8884,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_string(error_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); - } return ::grpc::Status::OK; } } @@ -8379,10 +8931,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetExportedSignalAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8422,10 +8976,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetExportedSignalAttributeDouble(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8465,8 +9021,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetExportedSignalAttributeInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ExportSignalInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -8474,7 +9033,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8514,10 +9072,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetExportedSignalAttributeString(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -8529,11 +9087,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -8574,10 +9134,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetExportedSignalAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8596,10 +9158,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetExtendedErrorInfo(nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 buffer_size = status; std::string error_string; @@ -8611,11 +9173,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_string(error_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); - } return ::grpc::Status::OK; } } @@ -8636,10 +9200,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetFirstSampClkWhen(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8659,10 +9225,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetFirstSampTimestampVal(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8684,10 +9252,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetNthTaskChannel(task, index, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + int32 buffer_size = status; std::string buffer; @@ -8699,11 +9267,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_buffer(buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); - } return ::grpc::Status::OK; } } @@ -8726,10 +9296,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetNthTaskDevice(task, index, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + int32 buffer_size = status; std::string buffer; @@ -8741,11 +9311,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_buffer(buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); - } return ::grpc::Status::OK; } } @@ -8768,10 +9340,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetNthTaskReadChannel(task, index, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + int32 buffer_size = status; std::string buffer; @@ -8783,11 +9355,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_buffer(buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); - } return ::grpc::Status::OK; } } @@ -8827,10 +9401,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetPersistedChanAttributeBool(channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8869,10 +9445,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPersistedChanAttributeString(channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -8884,11 +9460,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -8928,10 +9506,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetPersistedScaleAttributeBool(scale_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8970,10 +9550,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPersistedScaleAttributeString(scale_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -8985,11 +9565,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -9029,10 +9611,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetPersistedTaskAttributeBool(task_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9071,10 +9655,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPersistedTaskAttributeString(task_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -9086,11 +9670,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -9130,10 +9716,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetPhysicalChanAttributeBool(physical_channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9172,10 +9760,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeBytes(physical_channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value(size, '\0'); @@ -9184,10 +9772,12 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } } @@ -9227,10 +9817,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetPhysicalChanAttributeDouble(physical_channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9269,10 +9861,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeDoubleArray(physical_channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -9282,9 +9874,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -9324,8 +9918,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetPhysicalChanAttributeInt32(physical_channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -9333,7 +9930,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9372,10 +9968,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeInt32Array(physical_channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value_raw()->Resize(size, 0); @@ -9385,8 +9981,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -9401,7 +10000,6 @@ namespace nidaqmx_grpc { [&](auto x) { return checked_convert_value(x); }); - } return ::grpc::Status::OK; } } @@ -9441,10 +10039,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeString(physical_channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -9456,11 +10054,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -9500,10 +10100,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetPhysicalChanAttributeUInt32(physical_channel, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9542,10 +10144,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeUInt32Array(physical_channel, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -9555,9 +10157,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -9598,10 +10202,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetReadAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9641,10 +10247,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetReadAttributeDouble(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9684,8 +10292,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetReadAttributeInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ReadInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -9693,7 +10304,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9733,10 +10343,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetReadAttributeString(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -9748,11 +10358,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -9793,10 +10405,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetReadAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9836,10 +10450,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt64 value {}; auto status = library_->GetReadAttributeUInt64(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9879,10 +10495,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetRealTimeAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9922,8 +10540,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetRealTimeAttributeInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::RealTimeInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -9931,7 +10552,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9971,10 +10591,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetRealTimeAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9994,10 +10616,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetRefTrigTimestampVal(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10036,10 +10660,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetScaleAttributeDouble(scale_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10078,10 +10704,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetScaleAttributeDoubleArray(scale_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -10091,9 +10717,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -10133,8 +10761,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetScaleAttributeInt32(scale_name, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ScaleInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -10142,7 +10773,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10181,10 +10811,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetScaleAttributeString(scale_name, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -10196,11 +10826,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -10224,14 +10856,16 @@ namespace nidaqmx_grpc { uInt32 hour {}; uInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(device_name, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10251,10 +10885,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetStartTrigTimestampVal(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10274,10 +10910,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetStartTrigTrigWhen(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10297,10 +10935,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); CVIAbsoluteTime data {}; auto status = library_->GetSyncPulseTimeWhen(task, &data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10338,10 +10978,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetSystemInfoAttributeString(attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + uInt32 size = status; std::string value; @@ -10353,11 +10993,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -10396,10 +11038,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetSystemInfoAttributeUInt32(attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10439,10 +11083,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetTaskAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10482,10 +11128,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTaskAttributeString(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -10497,11 +11143,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -10542,10 +11190,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetTaskAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10585,10 +11235,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetTimingAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10628,10 +11280,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetTimingAttributeDouble(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10672,10 +11326,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetTimingAttributeExBool(task, device_names, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10716,10 +11372,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetTimingAttributeExDouble(task, device_names, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10760,8 +11418,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetTimingAttributeExInt32(task, device_names, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -10769,7 +11430,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10810,10 +11470,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTimingAttributeExString(task, device_names, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -10825,11 +11485,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -10871,10 +11533,12 @@ namespace nidaqmx_grpc { auto size = 0U; CVIAbsoluteTime value {}; auto status = library_->GetTimingAttributeExTimestamp(task, device_names, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(value, response->mutable_value()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10915,10 +11579,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetTimingAttributeExUInt32(task, device_names, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10959,10 +11625,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt64 value {}; auto status = library_->GetTimingAttributeExUInt64(task, device_names, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11002,8 +11670,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetTimingAttributeInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -11011,7 +11682,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11051,10 +11721,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTimingAttributeString(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -11066,11 +11736,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -11111,10 +11783,12 @@ namespace nidaqmx_grpc { auto size = 0U; CVIAbsoluteTime value {}; auto status = library_->GetTimingAttributeTimestamp(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(value, response->mutable_value()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11154,10 +11828,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetTimingAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11197,10 +11873,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt64 value {}; auto status = library_->GetTimingAttributeUInt64(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11240,10 +11918,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetTrigAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11283,10 +11963,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetTrigAttributeDouble(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11326,10 +12008,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTrigAttributeDoubleArray(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -11339,9 +12021,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -11382,8 +12066,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetTrigAttributeInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -11391,7 +12078,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11431,10 +12117,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTrigAttributeInt32Array(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; response->mutable_value_raw()->Resize(size, 0); @@ -11444,8 +12130,11 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -11460,7 +12149,6 @@ namespace nidaqmx_grpc { [&](auto x) { return checked_convert_value(x); }); - } return ::grpc::Status::OK; } } @@ -11501,10 +12189,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTrigAttributeString(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -11516,11 +12204,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -11561,10 +12251,12 @@ namespace nidaqmx_grpc { auto size = 0U; CVIAbsoluteTime value {}; auto status = library_->GetTrigAttributeTimestamp(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(value, response->mutable_value()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11604,10 +12296,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetTrigAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11648,10 +12342,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetWatchdogAttributeBool(task, lines, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11692,10 +12388,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetWatchdogAttributeDouble(task, lines, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11736,8 +12434,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetWatchdogAttributeInt32(task, lines, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::WatchdogInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -11745,7 +12446,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11786,10 +12486,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetWatchdogAttributeString(task, lines, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -11801,11 +12501,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -11846,10 +12548,12 @@ namespace nidaqmx_grpc { auto size = 0U; bool32 value {}; auto status = library_->GetWriteAttributeBool(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11889,10 +12593,12 @@ namespace nidaqmx_grpc { auto size = 0U; float64 value {}; auto status = library_->GetWriteAttributeDouble(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11932,8 +12638,11 @@ namespace nidaqmx_grpc { auto size = 0U; int32 value {}; auto status = library_->GetWriteAttributeInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::WriteInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -11941,7 +12650,6 @@ namespace nidaqmx_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11981,10 +12689,10 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetWriteAttributeString(task, attribute, nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + uInt32 size = status; std::string value; @@ -11996,11 +12704,13 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -12041,10 +12751,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt32 value {}; auto status = library_->GetWriteAttributeUInt32(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12084,10 +12796,12 @@ namespace nidaqmx_grpc { auto size = 0U; uInt64 value {}; auto status = library_->GetWriteAttributeUInt64(task, attribute, &value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12107,10 +12821,12 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); bool32 is_task_done {}; auto status = library_->IsTaskDone(task, &is_task_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_task_done(is_task_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12137,10 +12853,12 @@ namespace nidaqmx_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_task()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12182,10 +12900,12 @@ namespace nidaqmx_grpc { float64* read_array = response->mutable_read_array()->mutable_data(); int32 samps_per_chan_read {}; auto status = library_->ReadAnalogF64(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12207,10 +12927,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; float64 value {}; auto status = library_->ReadAnalogScalarF64(task, timeout, &value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12251,8 +12973,11 @@ namespace nidaqmx_grpc { std::vector read_array(array_size_in_samps); int32 samps_per_chan_read {}; auto status = library_->ReadBinaryI16(task, num_samps_per_chan, timeout, fill_mode, read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_read_array()->Clear(); response->mutable_read_array()->Reserve(array_size_in_samps); std::transform( @@ -12263,7 +12988,6 @@ namespace nidaqmx_grpc { return x; }); response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12305,10 +13029,12 @@ namespace nidaqmx_grpc { int32* read_array = reinterpret_cast(response->mutable_read_array()->mutable_data()); int32 samps_per_chan_read {}; auto status = library_->ReadBinaryI32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12349,8 +13075,11 @@ namespace nidaqmx_grpc { std::vector read_array(array_size_in_samps); int32 samps_per_chan_read {}; auto status = library_->ReadBinaryU16(task, num_samps_per_chan, timeout, fill_mode, read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_read_array()->Clear(); response->mutable_read_array()->Reserve(array_size_in_samps); std::transform( @@ -12361,7 +13090,6 @@ namespace nidaqmx_grpc { return x; }); response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12403,10 +13131,12 @@ namespace nidaqmx_grpc { uInt32* read_array = reinterpret_cast(response->mutable_read_array()->mutable_data()); int32 samps_per_chan_read {}; auto status = library_->ReadBinaryU32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12432,10 +13162,12 @@ namespace nidaqmx_grpc { float64* read_array = response->mutable_read_array()->mutable_data(); int32 samps_per_chan_read {}; auto status = library_->ReadCounterF64(task, num_samps_per_chan, timeout, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12477,10 +13209,12 @@ namespace nidaqmx_grpc { float64* read_array = response->mutable_read_array()->mutable_data(); int32 samps_per_chan_read {}; auto status = library_->ReadCounterF64Ex(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12502,10 +13236,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; float64 value {}; auto status = library_->ReadCounterScalarF64(task, timeout, &value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12527,10 +13263,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; uInt32 value {}; auto status = library_->ReadCounterScalarU32(task, timeout, &value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12556,10 +13294,12 @@ namespace nidaqmx_grpc { uInt32* read_array = reinterpret_cast(response->mutable_read_array()->mutable_data()); int32 samps_per_chan_read {}; auto status = library_->ReadCounterU32(task, num_samps_per_chan, timeout, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12601,10 +13341,12 @@ namespace nidaqmx_grpc { uInt32* read_array = reinterpret_cast(response->mutable_read_array()->mutable_data()); int32 samps_per_chan_read {}; auto status = library_->ReadCounterU32Ex(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12648,10 +13390,12 @@ namespace nidaqmx_grpc { float64* read_array_duty_cycle = response->mutable_read_array_duty_cycle()->mutable_data(); int32 samps_per_chan_read {}; auto status = library_->ReadCtrFreq(task, num_samps_per_chan, timeout, interleaved, read_array_frequency, read_array_duty_cycle, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12674,11 +13418,13 @@ namespace nidaqmx_grpc { float64 frequency {}; float64 duty_cycle {}; auto status = library_->ReadCtrFreqScalar(task, timeout, &frequency, &duty_cycle, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency(frequency); response->set_duty_cycle(duty_cycle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12722,10 +13468,12 @@ namespace nidaqmx_grpc { uInt32* read_array_low_ticks = reinterpret_cast(response->mutable_read_array_low_ticks()->mutable_data()); int32 samps_per_chan_read {}; auto status = library_->ReadCtrTicks(task, num_samps_per_chan, timeout, interleaved, read_array_high_ticks, read_array_low_ticks, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12748,11 +13496,13 @@ namespace nidaqmx_grpc { uInt32 high_ticks {}; uInt32 low_ticks {}; auto status = library_->ReadCtrTicksScalar(task, timeout, &high_ticks, &low_ticks, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_high_ticks(high_ticks); response->set_low_ticks(low_ticks); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12796,10 +13546,12 @@ namespace nidaqmx_grpc { float64* read_array_low_time = response->mutable_read_array_low_time()->mutable_data(); int32 samps_per_chan_read {}; auto status = library_->ReadCtrTime(task, num_samps_per_chan, timeout, interleaved, read_array_high_time, read_array_low_time, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12822,11 +13574,13 @@ namespace nidaqmx_grpc { float64 high_time {}; float64 low_time {}; auto status = library_->ReadCtrTimeScalar(task, timeout, &high_time, &low_time, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_high_time(high_time); response->set_low_time(low_time); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12868,12 +13622,14 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; int32 num_bytes_per_samp {}; auto status = library_->ReadDigitalLines(task, num_samps_per_chan, timeout, fill_mode, (uInt8*)read_array.data(), array_size_in_bytes, &samps_per_chan_read, &num_bytes_per_samp, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_read_array(read_array); response->set_samps_per_chan_read(samps_per_chan_read); response->set_num_bytes_per_samp(num_bytes_per_samp); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12895,10 +13651,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; uInt32 value {}; auto status = library_->ReadDigitalScalarU32(task, timeout, &value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12939,8 +13697,11 @@ namespace nidaqmx_grpc { std::vector read_array(array_size_in_samps); int32 samps_per_chan_read {}; auto status = library_->ReadDigitalU16(task, num_samps_per_chan, timeout, fill_mode, read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_read_array()->Clear(); response->mutable_read_array()->Reserve(array_size_in_samps); std::transform( @@ -12951,7 +13712,6 @@ namespace nidaqmx_grpc { return x; }); response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12993,10 +13753,12 @@ namespace nidaqmx_grpc { uInt32* read_array = reinterpret_cast(response->mutable_read_array()->mutable_data()); int32 samps_per_chan_read {}; auto status = library_->ReadDigitalU32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13037,11 +13799,13 @@ namespace nidaqmx_grpc { std::string read_array(array_size_in_samps, '\0'); int32 samps_per_chan_read {}; auto status = library_->ReadDigitalU8(task, num_samps_per_chan, timeout, fill_mode, (uInt8*)read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_read_array(read_array); response->set_samps_per_chan_read(samps_per_chan_read); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13067,12 +13831,14 @@ namespace nidaqmx_grpc { int32 samps_read {}; int32 num_bytes_per_samp {}; auto status = library_->ReadRaw(task, num_samps_per_chan, timeout, (uInt8*)read_array.data(), array_size_in_bytes, &samps_read, &num_bytes_per_samp, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_read_array(read_array); response->set_samps_read(samps_read); response->set_num_bytes_per_samp(num_bytes_per_samp); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13293,6 +14059,10 @@ namespace nidaqmx_grpc { try { auto port_list = request->port_list().c_str(); auto status = library_->RemoveCDAQSyncConnection(port_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13312,6 +14082,10 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); bool32 override_reservation = request->override_reservation(); auto status = library_->ReserveNetworkDevice(device_name, override_reservation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13350,6 +14124,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetBufferAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13389,6 +14167,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetChanAttribute(task, channel, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13407,6 +14189,10 @@ namespace nidaqmx_grpc { try { auto device_name = request->device_name().c_str(); auto status = library_->ResetDevice(device_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13445,6 +14231,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetExportedSignalAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13483,6 +14273,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetReadAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13521,6 +14315,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetRealTimeAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13559,6 +14357,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetTimingAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13598,6 +14400,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetTimingAttributeEx(task, device_names, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13636,6 +14442,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetTrigAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13675,6 +14485,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetWatchdogAttribute(task, lines, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13713,6 +14527,10 @@ namespace nidaqmx_grpc { } auto status = library_->ResetWriteAttribute(task, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13751,6 +14569,10 @@ namespace nidaqmx_grpc { } auto status = library_->SaveGlobalChan(task, channel_name, save_as, author, options); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13787,6 +14609,10 @@ namespace nidaqmx_grpc { } auto status = library_->SaveScale(scale_name, save_as, author, options); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13824,6 +14650,10 @@ namespace nidaqmx_grpc { } auto status = library_->SaveTask(task, save_as, author, options); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13842,6 +14672,10 @@ namespace nidaqmx_grpc { try { auto device_name = request->device_name().c_str(); auto status = library_->SelfCal(device_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13860,6 +14694,10 @@ namespace nidaqmx_grpc { try { auto device_name = request->device_name().c_str(); auto status = library_->SelfTestDevice(device_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13885,6 +14723,10 @@ namespace nidaqmx_grpc { uInt32 hour = request->hour(); uInt32 minute = request->minute(); auto status = library_->SetAIChanCalCalDate(task, channel_name, year, month, day, hour, minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13910,6 +14752,10 @@ namespace nidaqmx_grpc { uInt32 hour = request->hour(); uInt32 minute = request->minute(); auto status = library_->SetAIChanCalExpDate(task, channel_name, year, month, day, hour, minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13954,6 +14800,10 @@ namespace nidaqmx_grpc { } auto status = ((NiDAQmxLibrary*)library_)->SetAnalogPowerUpStates(device_name, get_channelNames_if(power_up_states, 0), get_state_if(power_up_states, 0), get_channelType_if(power_up_states, 0), get_channelNames_if(power_up_states, 1), get_state_if(power_up_states, 1), get_channelType_if(power_up_states, 1), get_channelNames_if(power_up_states, 2), get_state_if(power_up_states, 2), get_channelType_if(power_up_states, 2), get_channelNames_if(power_up_states, 3), get_state_if(power_up_states, 3), get_channelType_if(power_up_states, 3), get_channelNames_if(power_up_states, 4), get_state_if(power_up_states, 4), get_channelType_if(power_up_states, 4), get_channelNames_if(power_up_states, 5), get_state_if(power_up_states, 5), get_channelType_if(power_up_states, 5), get_channelNames_if(power_up_states, 6), get_state_if(power_up_states, 6), get_channelType_if(power_up_states, 6), get_channelNames_if(power_up_states, 7), get_state_if(power_up_states, 7), get_channelType_if(power_up_states, 7), get_channelNames_if(power_up_states, 8), get_state_if(power_up_states, 8), get_channelType_if(power_up_states, 8), get_channelNames_if(power_up_states, 9), get_state_if(power_up_states, 9), get_channelType_if(power_up_states, 9), get_channelNames_if(power_up_states, 10), get_state_if(power_up_states, 10), get_channelType_if(power_up_states, 10), get_channelNames_if(power_up_states, 11), get_state_if(power_up_states, 11), get_channelType_if(power_up_states, 11), get_channelNames_if(power_up_states, 12), get_state_if(power_up_states, 12), get_channelType_if(power_up_states, 12), get_channelNames_if(power_up_states, 13), get_state_if(power_up_states, 13), get_channelType_if(power_up_states, 13), get_channelNames_if(power_up_states, 14), get_state_if(power_up_states, 14), get_channelType_if(power_up_states, 14), get_channelNames_if(power_up_states, 15), get_state_if(power_up_states, 15), get_channelType_if(power_up_states, 15), get_channelNames_if(power_up_states, 16), get_state_if(power_up_states, 16), get_channelType_if(power_up_states, 16), get_channelNames_if(power_up_states, 17), get_state_if(power_up_states, 17), get_channelType_if(power_up_states, 17), get_channelNames_if(power_up_states, 18), get_state_if(power_up_states, 18), get_channelType_if(power_up_states, 18), get_channelNames_if(power_up_states, 19), get_state_if(power_up_states, 19), get_channelType_if(power_up_states, 19), get_channelNames_if(power_up_states, 20), get_state_if(power_up_states, 20), get_channelType_if(power_up_states, 20), get_channelNames_if(power_up_states, 21), get_state_if(power_up_states, 21), get_channelType_if(power_up_states, 21), get_channelNames_if(power_up_states, 22), get_state_if(power_up_states, 22), get_channelType_if(power_up_states, 22), get_channelNames_if(power_up_states, 23), get_state_if(power_up_states, 23), get_channelType_if(power_up_states, 23), get_channelNames_if(power_up_states, 24), get_state_if(power_up_states, 24), get_channelType_if(power_up_states, 24), get_channelNames_if(power_up_states, 25), get_state_if(power_up_states, 25), get_channelType_if(power_up_states, 25), get_channelNames_if(power_up_states, 26), get_state_if(power_up_states, 26), get_channelType_if(power_up_states, 26), get_channelNames_if(power_up_states, 27), get_state_if(power_up_states, 27), get_channelType_if(power_up_states, 27), get_channelNames_if(power_up_states, 28), get_state_if(power_up_states, 28), get_channelType_if(power_up_states, 28), get_channelNames_if(power_up_states, 29), get_state_if(power_up_states, 29), get_channelType_if(power_up_states, 29), get_channelNames_if(power_up_states, 30), get_state_if(power_up_states, 30), get_channelType_if(power_up_states, 30), get_channelNames_if(power_up_states, 31), get_state_if(power_up_states, 31), get_channelType_if(power_up_states, 31), get_channelNames_if(power_up_states, 32), get_state_if(power_up_states, 32), get_channelType_if(power_up_states, 32), get_channelNames_if(power_up_states, 33), get_state_if(power_up_states, 33), get_channelType_if(power_up_states, 33), get_channelNames_if(power_up_states, 34), get_state_if(power_up_states, 34), get_channelType_if(power_up_states, 34), get_channelNames_if(power_up_states, 35), get_state_if(power_up_states, 35), get_channelType_if(power_up_states, 35), get_channelNames_if(power_up_states, 36), get_state_if(power_up_states, 36), get_channelType_if(power_up_states, 36), get_channelNames_if(power_up_states, 37), get_state_if(power_up_states, 37), get_channelType_if(power_up_states, 37), get_channelNames_if(power_up_states, 38), get_state_if(power_up_states, 38), get_channelType_if(power_up_states, 38), get_channelNames_if(power_up_states, 39), get_state_if(power_up_states, 39), get_channelType_if(power_up_states, 39), get_channelNames_if(power_up_states, 40), get_state_if(power_up_states, 40), get_channelType_if(power_up_states, 40), get_channelNames_if(power_up_states, 41), get_state_if(power_up_states, 41), get_channelType_if(power_up_states, 41), get_channelNames_if(power_up_states, 42), get_state_if(power_up_states, 42), get_channelType_if(power_up_states, 42), get_channelNames_if(power_up_states, 43), get_state_if(power_up_states, 43), get_channelType_if(power_up_states, 43), get_channelNames_if(power_up_states, 44), get_state_if(power_up_states, 44), get_channelType_if(power_up_states, 44), get_channelNames_if(power_up_states, 45), get_state_if(power_up_states, 45), get_channelType_if(power_up_states, 45), get_channelNames_if(power_up_states, 46), get_state_if(power_up_states, 46), get_channelType_if(power_up_states, 46), get_channelNames_if(power_up_states, 47), get_state_if(power_up_states, 47), get_channelType_if(power_up_states, 47), get_channelNames_if(power_up_states, 48), get_state_if(power_up_states, 48), get_channelType_if(power_up_states, 48), get_channelNames_if(power_up_states, 49), get_state_if(power_up_states, 49), get_channelType_if(power_up_states, 49), get_channelNames_if(power_up_states, 50), get_state_if(power_up_states, 50), get_channelType_if(power_up_states, 50), get_channelNames_if(power_up_states, 51), get_state_if(power_up_states, 51), get_channelType_if(power_up_states, 51), get_channelNames_if(power_up_states, 52), get_state_if(power_up_states, 52), get_channelType_if(power_up_states, 52), get_channelNames_if(power_up_states, 53), get_state_if(power_up_states, 53), get_channelType_if(power_up_states, 53), get_channelNames_if(power_up_states, 54), get_state_if(power_up_states, 54), get_channelType_if(power_up_states, 54), get_channelNames_if(power_up_states, 55), get_state_if(power_up_states, 55), get_channelType_if(power_up_states, 55), get_channelNames_if(power_up_states, 56), get_state_if(power_up_states, 56), get_channelType_if(power_up_states, 56), get_channelNames_if(power_up_states, 57), get_state_if(power_up_states, 57), get_channelType_if(power_up_states, 57), get_channelNames_if(power_up_states, 58), get_state_if(power_up_states, 58), get_channelType_if(power_up_states, 58), get_channelNames_if(power_up_states, 59), get_state_if(power_up_states, 59), get_channelType_if(power_up_states, 59), get_channelNames_if(power_up_states, 60), get_state_if(power_up_states, 60), get_channelType_if(power_up_states, 60), get_channelNames_if(power_up_states, 61), get_state_if(power_up_states, 61), get_channelType_if(power_up_states, 61), get_channelNames_if(power_up_states, 62), get_state_if(power_up_states, 62), get_channelType_if(power_up_states, 62), get_channelNames_if(power_up_states, 63), get_state_if(power_up_states, 63), get_channelType_if(power_up_states, 63), get_channelNames_if(power_up_states, 64), get_state_if(power_up_states, 64), get_channelType_if(power_up_states, 64), get_channelNames_if(power_up_states, 65), get_state_if(power_up_states, 65), get_channelType_if(power_up_states, 65), get_channelNames_if(power_up_states, 66), get_state_if(power_up_states, 66), get_channelType_if(power_up_states, 66), get_channelNames_if(power_up_states, 67), get_state_if(power_up_states, 67), get_channelType_if(power_up_states, 67), get_channelNames_if(power_up_states, 68), get_state_if(power_up_states, 68), get_channelType_if(power_up_states, 68), get_channelNames_if(power_up_states, 69), get_state_if(power_up_states, 69), get_channelType_if(power_up_states, 69), get_channelNames_if(power_up_states, 70), get_state_if(power_up_states, 70), get_channelType_if(power_up_states, 70), get_channelNames_if(power_up_states, 71), get_state_if(power_up_states, 71), get_channelType_if(power_up_states, 71), get_channelNames_if(power_up_states, 72), get_state_if(power_up_states, 72), get_channelType_if(power_up_states, 72), get_channelNames_if(power_up_states, 73), get_state_if(power_up_states, 73), get_channelType_if(power_up_states, 73), get_channelNames_if(power_up_states, 74), get_state_if(power_up_states, 74), get_channelType_if(power_up_states, 74), get_channelNames_if(power_up_states, 75), get_state_if(power_up_states, 75), get_channelType_if(power_up_states, 75), get_channelNames_if(power_up_states, 76), get_state_if(power_up_states, 76), get_channelType_if(power_up_states, 76), get_channelNames_if(power_up_states, 77), get_state_if(power_up_states, 77), get_channelType_if(power_up_states, 77), get_channelNames_if(power_up_states, 78), get_state_if(power_up_states, 78), get_channelType_if(power_up_states, 78), get_channelNames_if(power_up_states, 79), get_state_if(power_up_states, 79), get_channelType_if(power_up_states, 79), get_channelNames_if(power_up_states, 80), get_state_if(power_up_states, 80), get_channelType_if(power_up_states, 80), get_channelNames_if(power_up_states, 81), get_state_if(power_up_states, 81), get_channelType_if(power_up_states, 81), get_channelNames_if(power_up_states, 82), get_state_if(power_up_states, 82), get_channelType_if(power_up_states, 82), get_channelNames_if(power_up_states, 83), get_state_if(power_up_states, 83), get_channelType_if(power_up_states, 83), get_channelNames_if(power_up_states, 84), get_state_if(power_up_states, 84), get_channelType_if(power_up_states, 84), get_channelNames_if(power_up_states, 85), get_state_if(power_up_states, 85), get_channelType_if(power_up_states, 85), get_channelNames_if(power_up_states, 86), get_state_if(power_up_states, 86), get_channelType_if(power_up_states, 86), get_channelNames_if(power_up_states, 87), get_state_if(power_up_states, 87), get_channelType_if(power_up_states, 87), get_channelNames_if(power_up_states, 88), get_state_if(power_up_states, 88), get_channelType_if(power_up_states, 88), get_channelNames_if(power_up_states, 89), get_state_if(power_up_states, 89), get_channelType_if(power_up_states, 89), get_channelNames_if(power_up_states, 90), get_state_if(power_up_states, 90), get_channelType_if(power_up_states, 90), get_channelNames_if(power_up_states, 91), get_state_if(power_up_states, 91), get_channelType_if(power_up_states, 91), get_channelNames_if(power_up_states, 92), get_state_if(power_up_states, 92), get_channelType_if(power_up_states, 92), get_channelNames_if(power_up_states, 93), get_state_if(power_up_states, 93), get_channelType_if(power_up_states, 93), get_channelNames_if(power_up_states, 94), get_state_if(power_up_states, 94), get_channelType_if(power_up_states, 94), get_channelNames_if(power_up_states, 95), get_state_if(power_up_states, 95), get_channelType_if(power_up_states, 95), get_channelNames_if(power_up_states, 96), get_state_if(power_up_states, 96), get_channelType_if(power_up_states, 96)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13994,6 +14844,10 @@ namespace nidaqmx_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->SetAnalogPowerUpStatesWithOutputType(channel_names, state_array, channel_type_array, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14014,6 +14868,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto data = convert_from_grpc(request->data()); auto status = library_->SetArmStartTrigTrigWhen(task, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14053,6 +14911,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto status = library_->SetBufferAttributeUInt32(task, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14092,6 +14954,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetCalInfoAttributeBool(device_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14131,6 +14997,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetCalInfoAttributeDouble(device_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14170,6 +15040,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetCalInfoAttributeString(device_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14209,6 +15083,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetCalInfoAttributeUInt32(device_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14250,6 +15128,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetChanAttributeBool(task, channel, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14291,6 +15173,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetChanAttributeDouble(task, channel, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14332,6 +15218,10 @@ namespace nidaqmx_grpc { auto value = const_cast(request->value().data()); uInt32 size = static_cast(request->value().size()); auto status = library_->SetChanAttributeDoubleArray(task, channel, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14388,6 +15278,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetChanAttributeInt32(task, channel, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14429,6 +15323,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetChanAttributeString(task, channel, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14470,6 +15368,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetChanAttributeUInt32(task, channel, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14504,6 +15406,10 @@ namespace nidaqmx_grpc { } auto status = library_->SetDigitalLogicFamilyPowerUpState(device_name, logic_family); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14542,6 +15448,10 @@ namespace nidaqmx_grpc { } auto status = ((NiDAQmxLibrary*)library_)->SetDigitalPowerUpStates(device_name, get_channelNames_if(power_up_states, 0), get_state_if(power_up_states, 0), get_channelNames_if(power_up_states, 1), get_state_if(power_up_states, 1), get_channelNames_if(power_up_states, 2), get_state_if(power_up_states, 2), get_channelNames_if(power_up_states, 3), get_state_if(power_up_states, 3), get_channelNames_if(power_up_states, 4), get_state_if(power_up_states, 4), get_channelNames_if(power_up_states, 5), get_state_if(power_up_states, 5), get_channelNames_if(power_up_states, 6), get_state_if(power_up_states, 6), get_channelNames_if(power_up_states, 7), get_state_if(power_up_states, 7), get_channelNames_if(power_up_states, 8), get_state_if(power_up_states, 8), get_channelNames_if(power_up_states, 9), get_state_if(power_up_states, 9), get_channelNames_if(power_up_states, 10), get_state_if(power_up_states, 10), get_channelNames_if(power_up_states, 11), get_state_if(power_up_states, 11), get_channelNames_if(power_up_states, 12), get_state_if(power_up_states, 12), get_channelNames_if(power_up_states, 13), get_state_if(power_up_states, 13), get_channelNames_if(power_up_states, 14), get_state_if(power_up_states, 14), get_channelNames_if(power_up_states, 15), get_state_if(power_up_states, 15), get_channelNames_if(power_up_states, 16), get_state_if(power_up_states, 16), get_channelNames_if(power_up_states, 17), get_state_if(power_up_states, 17), get_channelNames_if(power_up_states, 18), get_state_if(power_up_states, 18), get_channelNames_if(power_up_states, 19), get_state_if(power_up_states, 19), get_channelNames_if(power_up_states, 20), get_state_if(power_up_states, 20), get_channelNames_if(power_up_states, 21), get_state_if(power_up_states, 21), get_channelNames_if(power_up_states, 22), get_state_if(power_up_states, 22), get_channelNames_if(power_up_states, 23), get_state_if(power_up_states, 23), get_channelNames_if(power_up_states, 24), get_state_if(power_up_states, 24), get_channelNames_if(power_up_states, 25), get_state_if(power_up_states, 25), get_channelNames_if(power_up_states, 26), get_state_if(power_up_states, 26), get_channelNames_if(power_up_states, 27), get_state_if(power_up_states, 27), get_channelNames_if(power_up_states, 28), get_state_if(power_up_states, 28), get_channelNames_if(power_up_states, 29), get_state_if(power_up_states, 29), get_channelNames_if(power_up_states, 30), get_state_if(power_up_states, 30), get_channelNames_if(power_up_states, 31), get_state_if(power_up_states, 31), get_channelNames_if(power_up_states, 32), get_state_if(power_up_states, 32), get_channelNames_if(power_up_states, 33), get_state_if(power_up_states, 33), get_channelNames_if(power_up_states, 34), get_state_if(power_up_states, 34), get_channelNames_if(power_up_states, 35), get_state_if(power_up_states, 35), get_channelNames_if(power_up_states, 36), get_state_if(power_up_states, 36), get_channelNames_if(power_up_states, 37), get_state_if(power_up_states, 37), get_channelNames_if(power_up_states, 38), get_state_if(power_up_states, 38), get_channelNames_if(power_up_states, 39), get_state_if(power_up_states, 39), get_channelNames_if(power_up_states, 40), get_state_if(power_up_states, 40), get_channelNames_if(power_up_states, 41), get_state_if(power_up_states, 41), get_channelNames_if(power_up_states, 42), get_state_if(power_up_states, 42), get_channelNames_if(power_up_states, 43), get_state_if(power_up_states, 43), get_channelNames_if(power_up_states, 44), get_state_if(power_up_states, 44), get_channelNames_if(power_up_states, 45), get_state_if(power_up_states, 45), get_channelNames_if(power_up_states, 46), get_state_if(power_up_states, 46), get_channelNames_if(power_up_states, 47), get_state_if(power_up_states, 47), get_channelNames_if(power_up_states, 48), get_state_if(power_up_states, 48), get_channelNames_if(power_up_states, 49), get_state_if(power_up_states, 49), get_channelNames_if(power_up_states, 50), get_state_if(power_up_states, 50), get_channelNames_if(power_up_states, 51), get_state_if(power_up_states, 51), get_channelNames_if(power_up_states, 52), get_state_if(power_up_states, 52), get_channelNames_if(power_up_states, 53), get_state_if(power_up_states, 53), get_channelNames_if(power_up_states, 54), get_state_if(power_up_states, 54), get_channelNames_if(power_up_states, 55), get_state_if(power_up_states, 55), get_channelNames_if(power_up_states, 56), get_state_if(power_up_states, 56), get_channelNames_if(power_up_states, 57), get_state_if(power_up_states, 57), get_channelNames_if(power_up_states, 58), get_state_if(power_up_states, 58), get_channelNames_if(power_up_states, 59), get_state_if(power_up_states, 59), get_channelNames_if(power_up_states, 60), get_state_if(power_up_states, 60), get_channelNames_if(power_up_states, 61), get_state_if(power_up_states, 61), get_channelNames_if(power_up_states, 62), get_state_if(power_up_states, 62), get_channelNames_if(power_up_states, 63), get_state_if(power_up_states, 63), get_channelNames_if(power_up_states, 64), get_state_if(power_up_states, 64), get_channelNames_if(power_up_states, 65), get_state_if(power_up_states, 65), get_channelNames_if(power_up_states, 66), get_state_if(power_up_states, 66), get_channelNames_if(power_up_states, 67), get_state_if(power_up_states, 67), get_channelNames_if(power_up_states, 68), get_state_if(power_up_states, 68), get_channelNames_if(power_up_states, 69), get_state_if(power_up_states, 69), get_channelNames_if(power_up_states, 70), get_state_if(power_up_states, 70), get_channelNames_if(power_up_states, 71), get_state_if(power_up_states, 71), get_channelNames_if(power_up_states, 72), get_state_if(power_up_states, 72), get_channelNames_if(power_up_states, 73), get_state_if(power_up_states, 73), get_channelNames_if(power_up_states, 74), get_state_if(power_up_states, 74), get_channelNames_if(power_up_states, 75), get_state_if(power_up_states, 75), get_channelNames_if(power_up_states, 76), get_state_if(power_up_states, 76), get_channelNames_if(power_up_states, 77), get_state_if(power_up_states, 77), get_channelNames_if(power_up_states, 78), get_state_if(power_up_states, 78), get_channelNames_if(power_up_states, 79), get_state_if(power_up_states, 79), get_channelNames_if(power_up_states, 80), get_state_if(power_up_states, 80), get_channelNames_if(power_up_states, 81), get_state_if(power_up_states, 81), get_channelNames_if(power_up_states, 82), get_state_if(power_up_states, 82), get_channelNames_if(power_up_states, 83), get_state_if(power_up_states, 83), get_channelNames_if(power_up_states, 84), get_state_if(power_up_states, 84), get_channelNames_if(power_up_states, 85), get_state_if(power_up_states, 85), get_channelNames_if(power_up_states, 86), get_state_if(power_up_states, 86), get_channelNames_if(power_up_states, 87), get_state_if(power_up_states, 87), get_channelNames_if(power_up_states, 88), get_state_if(power_up_states, 88), get_channelNames_if(power_up_states, 89), get_state_if(power_up_states, 89), get_channelNames_if(power_up_states, 90), get_state_if(power_up_states, 90), get_channelNames_if(power_up_states, 91), get_state_if(power_up_states, 91), get_channelNames_if(power_up_states, 92), get_state_if(power_up_states, 92), get_channelNames_if(power_up_states, 93), get_state_if(power_up_states, 93), get_channelNames_if(power_up_states, 94), get_state_if(power_up_states, 94), get_channelNames_if(power_up_states, 95), get_state_if(power_up_states, 95), get_channelNames_if(power_up_states, 96), get_state_if(power_up_states, 96)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14580,6 +15490,10 @@ namespace nidaqmx_grpc { } auto status = ((NiDAQmxLibrary*)library_)->SetDigitalPullUpPullDownStates(device_name, get_channelNames_if(pull_up_pull_down_states, 0), get_state_if(pull_up_pull_down_states, 0), get_channelNames_if(pull_up_pull_down_states, 1), get_state_if(pull_up_pull_down_states, 1), get_channelNames_if(pull_up_pull_down_states, 2), get_state_if(pull_up_pull_down_states, 2), get_channelNames_if(pull_up_pull_down_states, 3), get_state_if(pull_up_pull_down_states, 3), get_channelNames_if(pull_up_pull_down_states, 4), get_state_if(pull_up_pull_down_states, 4), get_channelNames_if(pull_up_pull_down_states, 5), get_state_if(pull_up_pull_down_states, 5), get_channelNames_if(pull_up_pull_down_states, 6), get_state_if(pull_up_pull_down_states, 6), get_channelNames_if(pull_up_pull_down_states, 7), get_state_if(pull_up_pull_down_states, 7), get_channelNames_if(pull_up_pull_down_states, 8), get_state_if(pull_up_pull_down_states, 8), get_channelNames_if(pull_up_pull_down_states, 9), get_state_if(pull_up_pull_down_states, 9), get_channelNames_if(pull_up_pull_down_states, 10), get_state_if(pull_up_pull_down_states, 10), get_channelNames_if(pull_up_pull_down_states, 11), get_state_if(pull_up_pull_down_states, 11), get_channelNames_if(pull_up_pull_down_states, 12), get_state_if(pull_up_pull_down_states, 12), get_channelNames_if(pull_up_pull_down_states, 13), get_state_if(pull_up_pull_down_states, 13), get_channelNames_if(pull_up_pull_down_states, 14), get_state_if(pull_up_pull_down_states, 14), get_channelNames_if(pull_up_pull_down_states, 15), get_state_if(pull_up_pull_down_states, 15), get_channelNames_if(pull_up_pull_down_states, 16), get_state_if(pull_up_pull_down_states, 16), get_channelNames_if(pull_up_pull_down_states, 17), get_state_if(pull_up_pull_down_states, 17), get_channelNames_if(pull_up_pull_down_states, 18), get_state_if(pull_up_pull_down_states, 18), get_channelNames_if(pull_up_pull_down_states, 19), get_state_if(pull_up_pull_down_states, 19), get_channelNames_if(pull_up_pull_down_states, 20), get_state_if(pull_up_pull_down_states, 20), get_channelNames_if(pull_up_pull_down_states, 21), get_state_if(pull_up_pull_down_states, 21), get_channelNames_if(pull_up_pull_down_states, 22), get_state_if(pull_up_pull_down_states, 22), get_channelNames_if(pull_up_pull_down_states, 23), get_state_if(pull_up_pull_down_states, 23), get_channelNames_if(pull_up_pull_down_states, 24), get_state_if(pull_up_pull_down_states, 24), get_channelNames_if(pull_up_pull_down_states, 25), get_state_if(pull_up_pull_down_states, 25), get_channelNames_if(pull_up_pull_down_states, 26), get_state_if(pull_up_pull_down_states, 26), get_channelNames_if(pull_up_pull_down_states, 27), get_state_if(pull_up_pull_down_states, 27), get_channelNames_if(pull_up_pull_down_states, 28), get_state_if(pull_up_pull_down_states, 28), get_channelNames_if(pull_up_pull_down_states, 29), get_state_if(pull_up_pull_down_states, 29), get_channelNames_if(pull_up_pull_down_states, 30), get_state_if(pull_up_pull_down_states, 30), get_channelNames_if(pull_up_pull_down_states, 31), get_state_if(pull_up_pull_down_states, 31), get_channelNames_if(pull_up_pull_down_states, 32), get_state_if(pull_up_pull_down_states, 32), get_channelNames_if(pull_up_pull_down_states, 33), get_state_if(pull_up_pull_down_states, 33), get_channelNames_if(pull_up_pull_down_states, 34), get_state_if(pull_up_pull_down_states, 34), get_channelNames_if(pull_up_pull_down_states, 35), get_state_if(pull_up_pull_down_states, 35), get_channelNames_if(pull_up_pull_down_states, 36), get_state_if(pull_up_pull_down_states, 36), get_channelNames_if(pull_up_pull_down_states, 37), get_state_if(pull_up_pull_down_states, 37), get_channelNames_if(pull_up_pull_down_states, 38), get_state_if(pull_up_pull_down_states, 38), get_channelNames_if(pull_up_pull_down_states, 39), get_state_if(pull_up_pull_down_states, 39), get_channelNames_if(pull_up_pull_down_states, 40), get_state_if(pull_up_pull_down_states, 40), get_channelNames_if(pull_up_pull_down_states, 41), get_state_if(pull_up_pull_down_states, 41), get_channelNames_if(pull_up_pull_down_states, 42), get_state_if(pull_up_pull_down_states, 42), get_channelNames_if(pull_up_pull_down_states, 43), get_state_if(pull_up_pull_down_states, 43), get_channelNames_if(pull_up_pull_down_states, 44), get_state_if(pull_up_pull_down_states, 44), get_channelNames_if(pull_up_pull_down_states, 45), get_state_if(pull_up_pull_down_states, 45), get_channelNames_if(pull_up_pull_down_states, 46), get_state_if(pull_up_pull_down_states, 46), get_channelNames_if(pull_up_pull_down_states, 47), get_state_if(pull_up_pull_down_states, 47), get_channelNames_if(pull_up_pull_down_states, 48), get_state_if(pull_up_pull_down_states, 48), get_channelNames_if(pull_up_pull_down_states, 49), get_state_if(pull_up_pull_down_states, 49), get_channelNames_if(pull_up_pull_down_states, 50), get_state_if(pull_up_pull_down_states, 50), get_channelNames_if(pull_up_pull_down_states, 51), get_state_if(pull_up_pull_down_states, 51), get_channelNames_if(pull_up_pull_down_states, 52), get_state_if(pull_up_pull_down_states, 52), get_channelNames_if(pull_up_pull_down_states, 53), get_state_if(pull_up_pull_down_states, 53), get_channelNames_if(pull_up_pull_down_states, 54), get_state_if(pull_up_pull_down_states, 54), get_channelNames_if(pull_up_pull_down_states, 55), get_state_if(pull_up_pull_down_states, 55), get_channelNames_if(pull_up_pull_down_states, 56), get_state_if(pull_up_pull_down_states, 56), get_channelNames_if(pull_up_pull_down_states, 57), get_state_if(pull_up_pull_down_states, 57), get_channelNames_if(pull_up_pull_down_states, 58), get_state_if(pull_up_pull_down_states, 58), get_channelNames_if(pull_up_pull_down_states, 59), get_state_if(pull_up_pull_down_states, 59), get_channelNames_if(pull_up_pull_down_states, 60), get_state_if(pull_up_pull_down_states, 60), get_channelNames_if(pull_up_pull_down_states, 61), get_state_if(pull_up_pull_down_states, 61), get_channelNames_if(pull_up_pull_down_states, 62), get_state_if(pull_up_pull_down_states, 62), get_channelNames_if(pull_up_pull_down_states, 63), get_state_if(pull_up_pull_down_states, 63), get_channelNames_if(pull_up_pull_down_states, 64), get_state_if(pull_up_pull_down_states, 64), get_channelNames_if(pull_up_pull_down_states, 65), get_state_if(pull_up_pull_down_states, 65), get_channelNames_if(pull_up_pull_down_states, 66), get_state_if(pull_up_pull_down_states, 66), get_channelNames_if(pull_up_pull_down_states, 67), get_state_if(pull_up_pull_down_states, 67), get_channelNames_if(pull_up_pull_down_states, 68), get_state_if(pull_up_pull_down_states, 68), get_channelNames_if(pull_up_pull_down_states, 69), get_state_if(pull_up_pull_down_states, 69), get_channelNames_if(pull_up_pull_down_states, 70), get_state_if(pull_up_pull_down_states, 70), get_channelNames_if(pull_up_pull_down_states, 71), get_state_if(pull_up_pull_down_states, 71), get_channelNames_if(pull_up_pull_down_states, 72), get_state_if(pull_up_pull_down_states, 72), get_channelNames_if(pull_up_pull_down_states, 73), get_state_if(pull_up_pull_down_states, 73), get_channelNames_if(pull_up_pull_down_states, 74), get_state_if(pull_up_pull_down_states, 74), get_channelNames_if(pull_up_pull_down_states, 75), get_state_if(pull_up_pull_down_states, 75), get_channelNames_if(pull_up_pull_down_states, 76), get_state_if(pull_up_pull_down_states, 76), get_channelNames_if(pull_up_pull_down_states, 77), get_state_if(pull_up_pull_down_states, 77), get_channelNames_if(pull_up_pull_down_states, 78), get_state_if(pull_up_pull_down_states, 78), get_channelNames_if(pull_up_pull_down_states, 79), get_state_if(pull_up_pull_down_states, 79), get_channelNames_if(pull_up_pull_down_states, 80), get_state_if(pull_up_pull_down_states, 80), get_channelNames_if(pull_up_pull_down_states, 81), get_state_if(pull_up_pull_down_states, 81), get_channelNames_if(pull_up_pull_down_states, 82), get_state_if(pull_up_pull_down_states, 82), get_channelNames_if(pull_up_pull_down_states, 83), get_state_if(pull_up_pull_down_states, 83), get_channelNames_if(pull_up_pull_down_states, 84), get_state_if(pull_up_pull_down_states, 84), get_channelNames_if(pull_up_pull_down_states, 85), get_state_if(pull_up_pull_down_states, 85), get_channelNames_if(pull_up_pull_down_states, 86), get_state_if(pull_up_pull_down_states, 86), get_channelNames_if(pull_up_pull_down_states, 87), get_state_if(pull_up_pull_down_states, 87), get_channelNames_if(pull_up_pull_down_states, 88), get_state_if(pull_up_pull_down_states, 88), get_channelNames_if(pull_up_pull_down_states, 89), get_state_if(pull_up_pull_down_states, 89), get_channelNames_if(pull_up_pull_down_states, 90), get_state_if(pull_up_pull_down_states, 90), get_channelNames_if(pull_up_pull_down_states, 91), get_state_if(pull_up_pull_down_states, 91), get_channelNames_if(pull_up_pull_down_states, 92), get_state_if(pull_up_pull_down_states, 92), get_channelNames_if(pull_up_pull_down_states, 93), get_state_if(pull_up_pull_down_states, 93), get_channelNames_if(pull_up_pull_down_states, 94), get_state_if(pull_up_pull_down_states, 94), get_channelNames_if(pull_up_pull_down_states, 95), get_state_if(pull_up_pull_down_states, 95), get_channelNames_if(pull_up_pull_down_states, 96), get_state_if(pull_up_pull_down_states, 96)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14620,6 +15534,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetExportedSignalAttributeBool(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14660,6 +15578,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetExportedSignalAttributeDouble(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14715,6 +15637,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetExportedSignalAttributeInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14755,6 +15681,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetExportedSignalAttributeString(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14795,6 +15725,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetExportedSignalAttributeUInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14815,6 +15749,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto data = convert_from_grpc(request->data()); auto status = library_->SetFirstSampClkWhen(task, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14855,6 +15793,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetReadAttributeBool(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14895,6 +15837,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetReadAttributeDouble(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14950,6 +15896,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14990,6 +15940,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetReadAttributeString(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15030,6 +15984,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetReadAttributeUInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15070,6 +16028,10 @@ namespace nidaqmx_grpc { uInt64 value = request->value(); auto size = 0U; auto status = library_->SetReadAttributeUInt64(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15110,6 +16072,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetRealTimeAttributeBool(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15165,6 +16131,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetRealTimeAttributeInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15205,6 +16175,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetRealTimeAttributeUInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15244,6 +16218,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetScaleAttributeDouble(scale_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15283,6 +16261,10 @@ namespace nidaqmx_grpc { auto value = const_cast(request->value().data()); uInt32 size = static_cast(request->value().size()); auto status = library_->SetScaleAttributeDoubleArray(scale_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15337,6 +16319,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetScaleAttributeInt32(scale_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15376,6 +16362,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetScaleAttributeString(scale_name, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15396,6 +16386,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto data = convert_from_grpc(request->data()); auto status = library_->SetStartTrigTrigWhen(task, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15416,6 +16410,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto data = convert_from_grpc(request->data()); auto status = library_->SetSyncPulseTimeWhen(task, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15456,6 +16454,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeBool(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15496,6 +16498,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeDouble(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15537,6 +16543,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeExBool(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15578,6 +16588,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeExDouble(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15634,6 +16648,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExInt32(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15675,6 +16693,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetTimingAttributeExString(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15716,6 +16738,10 @@ namespace nidaqmx_grpc { auto value = convert_from_grpc(request->value()); auto size = 0U; auto status = library_->SetTimingAttributeExTimestamp(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15757,6 +16783,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeExUInt32(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15798,6 +16828,10 @@ namespace nidaqmx_grpc { uInt64 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeExUInt64(task, device_names, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15853,6 +16887,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15893,6 +16931,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetTimingAttributeString(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15933,6 +16975,10 @@ namespace nidaqmx_grpc { auto value = convert_from_grpc(request->value()); auto size = 0U; auto status = library_->SetTimingAttributeTimestamp(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -15973,6 +17019,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeUInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16013,6 +17063,10 @@ namespace nidaqmx_grpc { uInt64 value = request->value(); auto size = 0U; auto status = library_->SetTimingAttributeUInt64(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16053,6 +17107,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetTrigAttributeBool(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16093,6 +17151,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetTrigAttributeDouble(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16133,6 +17195,10 @@ namespace nidaqmx_grpc { auto value = const_cast(request->value().data()); uInt32 size = static_cast(request->value().size()); auto status = library_->SetTrigAttributeDoubleArray(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16188,6 +17254,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16228,6 +17298,10 @@ namespace nidaqmx_grpc { auto value = reinterpret_cast(request->value().data()); uInt32 size = static_cast(request->value().size()); auto status = library_->SetTrigAttributeInt32Array(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16268,6 +17342,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetTrigAttributeString(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16308,6 +17386,10 @@ namespace nidaqmx_grpc { auto value = convert_from_grpc(request->value()); auto size = 0U; auto status = library_->SetTrigAttributeTimestamp(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16348,6 +17430,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetTrigAttributeUInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16389,6 +17475,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetWatchdogAttributeBool(task, lines, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16430,6 +17520,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetWatchdogAttributeDouble(task, lines, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16486,6 +17580,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWatchdogAttributeInt32(task, lines, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16527,6 +17625,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetWatchdogAttributeString(task, lines, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16567,6 +17669,10 @@ namespace nidaqmx_grpc { bool32 value = request->value(); auto size = 0U; auto status = library_->SetWriteAttributeBool(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16607,6 +17713,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto size = 0U; auto status = library_->SetWriteAttributeDouble(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16662,6 +17772,10 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16702,6 +17816,10 @@ namespace nidaqmx_grpc { auto value = request->value().c_str(); auto size = 0U; auto status = library_->SetWriteAttributeString(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16742,6 +17860,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto size = 0U; auto status = library_->SetWriteAttributeUInt32(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16782,6 +17904,10 @@ namespace nidaqmx_grpc { uInt64 value = request->value(); auto size = 0U; auto status = library_->SetWriteAttributeUInt64(task, attribute, value, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16802,6 +17928,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->StartNewFile(task, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16821,6 +17951,10 @@ namespace nidaqmx_grpc { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->StartTask(task); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16840,6 +17974,10 @@ namespace nidaqmx_grpc { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->StopTask(task); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16875,6 +18013,10 @@ namespace nidaqmx_grpc { } auto status = library_->TaskControl(task, action); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16893,6 +18035,10 @@ namespace nidaqmx_grpc { try { auto output_terminal = request->output_terminal().c_str(); auto status = library_->TristateOutputTerm(output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16911,6 +18057,10 @@ namespace nidaqmx_grpc { try { auto device_name = request->device_name().c_str(); auto status = library_->UnreserveNetworkDevice(device_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -16932,10 +18082,12 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); bool32 is_late {}; auto status = library_->WaitForNextSampleClock(task, timeout, &is_late); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_late(is_late); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -16972,10 +18124,12 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); CVIAbsoluteTime timestamp {}; auto status = library_->WaitForValidTimestamp(task, timestamp_event, timeout, ×tamp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(timestamp, response->mutable_timestamp()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -16995,6 +18149,10 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); float64 time_to_wait = request->time_to_wait(); auto status = library_->WaitUntilTaskDone(task, time_to_wait); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17036,10 +18194,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteAnalogF64(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17062,6 +18222,10 @@ namespace nidaqmx_grpc { float64 value = request->value(); auto reserved = nullptr; auto status = library_->WriteAnalogScalarF64(task, auto_start, timeout, value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17120,10 +18284,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteBinaryI16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17167,10 +18333,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteBinaryI32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17228,10 +18396,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteBinaryU16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17275,10 +18445,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteBinaryU32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17320,10 +18492,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 num_samps_per_chan_written {}; auto status = library_->WriteCtrFreq(task, num_samps_per_chan, auto_start, timeout, data_layout, frequency, duty_cycle, &num_samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_num_samps_per_chan_written(num_samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17347,6 +18521,10 @@ namespace nidaqmx_grpc { float64 duty_cycle = request->duty_cycle(); auto reserved = nullptr; auto status = library_->WriteCtrFreqScalar(task, auto_start, timeout, frequency, duty_cycle, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17389,10 +18567,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 num_samps_per_chan_written {}; auto status = library_->WriteCtrTicks(task, num_samps_per_chan, auto_start, timeout, data_layout, high_ticks, low_ticks, &num_samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_num_samps_per_chan_written(num_samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17416,6 +18596,10 @@ namespace nidaqmx_grpc { uInt32 low_ticks = request->low_ticks(); auto reserved = nullptr; auto status = library_->WriteCtrTicksScalar(task, auto_start, timeout, high_ticks, low_ticks, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17458,10 +18642,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 num_samps_per_chan_written {}; auto status = library_->WriteCtrTime(task, num_samps_per_chan, auto_start, timeout, data_layout, high_time, low_time, &num_samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_num_samps_per_chan_written(num_samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17485,6 +18671,10 @@ namespace nidaqmx_grpc { float64 low_time = request->low_time(); auto reserved = nullptr; auto status = library_->WriteCtrTimeScalar(task, auto_start, timeout, high_time, low_time, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17526,10 +18716,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteDigitalLines(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17552,6 +18744,10 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto reserved = nullptr; auto status = library_->WriteDigitalScalarU32(task, auto_start, timeout, value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17610,10 +18806,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteDigitalU16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17657,10 +18855,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteDigitalU32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17701,10 +18901,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteDigitalU8(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17729,10 +18931,12 @@ namespace nidaqmx_grpc { auto reserved = nullptr; int32 samps_per_chan_written {}; auto status = library_->WriteRaw(task, num_samps, auto_start, timeout, write_array, &samps_per_chan_written, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } + response->set_status(status); - if (status_ok(status)) { response->set_samps_per_chan_written(samps_per_chan_written); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17768,6 +18972,10 @@ namespace nidaqmx_grpc { } auto status = library_->WriteToTEDSFromArray(physical_channel, bit_stream, array_size, basic_teds_options); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -17803,6 +19011,10 @@ namespace nidaqmx_grpc { } auto status = library_->WriteToTEDSFromFile(physical_channel, file_path, basic_teds_options); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidaqmx/nidaqmx_service.h b/generated/nidaqmx/nidaqmx_service.h index a15db7a92..27f8e1303 100644 --- a/generated/nidaqmx/nidaqmx_service.h +++ b/generated/nidaqmx/nidaqmx_service.h @@ -431,6 +431,7 @@ class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEv private: NiDAQmxLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForTaskHandle(google::protobuf::int32 status, TaskHandle task); NiDAQmxFeatureToggles feature_toggles_; }; diff --git a/generated/nidcpower/nidcpower_service.cpp b/generated/nidcpower/nidcpower_service.cpp index 2fbad26c9..f8ee84144 100644 --- a/generated/nidcpower/nidcpower_service.cpp +++ b/generated/nidcpower/nidcpower_service.cpp @@ -57,6 +57,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->AbortWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -77,6 +81,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->CommitWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -114,6 +122,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeMeasureTriggerWithChannels(vi, channel_name, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -151,6 +163,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgePulseTriggerWithChannels(vi, channel_name, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -188,6 +204,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeSequenceAdvanceTriggerWithChannels(vi, channel_name, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -225,6 +245,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeShutdownTriggerWithChannels(vi, channel_name, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -262,6 +286,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeSourceTriggerWithChannels(vi, channel_name, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -299,6 +327,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeStartTriggerWithChannels(vi, channel_name, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -321,6 +353,10 @@ namespace nidcpower_grpc { ViBoolean enabled = request->enabled(); ViReal64 limit = request->limit(); auto status = library_->ConfigureOvp(vi, channel_name, enabled, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -341,6 +377,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeMeasureTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -361,6 +401,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgePulseTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -381,6 +425,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeSequenceAdvanceTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -401,6 +449,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeShutdownTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -421,6 +473,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeSourceTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -441,6 +497,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeStartTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -477,6 +537,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureSourceModeWithChannels(vi, channel_name, source_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -498,6 +562,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateAdvancedSequenceCommitStepWithChannels(vi, channel_name, set_as_active_step); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -519,6 +587,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateAdvancedSequenceStepWithChannels(vi, channel_name, set_as_active_step); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -543,6 +615,10 @@ namespace nidcpower_grpc { auto attribute_ids = const_cast(reinterpret_cast(request->attribute_ids().data())); ViBoolean set_as_active_sequence = request->set_as_active_sequence(); auto status = library_->CreateAdvancedSequenceWithChannels(vi, channel_name, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -566,6 +642,10 @@ namespace nidcpower_grpc { auto attribute_ids = const_cast(reinterpret_cast(request->attribute_ids().data())); ViBoolean set_as_active_sequence = request->set_as_active_sequence(); auto status = library_->CreateAdvancedSequence(vi, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -587,6 +667,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto sequence_name = request->sequence_name().c_str(); auto status = library_->DeleteAdvancedSequenceWithChannels(vi, channel_name, sequence_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -607,6 +691,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisablePulseTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -627,6 +715,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableSequenceAdvanceTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -647,6 +739,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableShutdownTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -667,6 +763,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableSourceTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -687,6 +787,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableStartTriggerWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -708,10 +812,12 @@ namespace nidcpower_grpc { ViChar* error_message = (ViChar*)request->error_message().c_str(); ViInt32 error_code {}; auto status = library_->ErrorQuery(vi, &error_code, error_message); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -749,6 +855,10 @@ namespace nidcpower_grpc { auto signal_identifier = request->signal_identifier().c_str(); auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignalWithChannels(vi, channel_name, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -778,14 +888,12 @@ namespace nidcpower_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -805,6 +913,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->InitiateWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -824,6 +936,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -844,6 +960,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ResetWithChannels(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -880,6 +1000,10 @@ namespace nidcpower_grpc { } auto status = library_->SendSoftwareEdgeTriggerWithChannels(vi, channel_name, trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -917,6 +1041,10 @@ namespace nidcpower_grpc { ViReal64 timeout = request->timeout(); auto status = library_->WaitForEventWithChannels(vi, channel_name, event_id, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -936,6 +1064,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -956,6 +1088,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->CalSelfCalibrate(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -975,6 +1111,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -994,6 +1134,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1014,6 +1158,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1033,6 +1181,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1070,6 +1222,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureApertureTime(vi, channel_name, aperture_time, units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1106,6 +1262,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureAutoZero(vi, channel_name, auto_zero); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1127,6 +1287,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 level = request->level(); auto status = library_->ConfigureCurrentLevel(vi, channel_name, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1148,6 +1312,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigureCurrentLevelRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1185,6 +1353,10 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigureCurrentLimit(vi, channel_name, behavior, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1206,6 +1378,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigureCurrentLimitRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1242,6 +1418,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeMeasureTrigger(vi, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1278,6 +1458,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgePulseTrigger(vi, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1314,6 +1498,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeSequenceAdvanceTrigger(vi, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1350,6 +1538,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeSourceTrigger(vi, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1386,6 +1578,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, input_terminal, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1407,6 +1603,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViBoolean enabled = request->enabled(); auto status = library_->ConfigureOutputEnabled(vi, channel_name, enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1443,6 +1643,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureOutputFunction(vi, channel_name, function); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1464,6 +1668,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 resistance = request->resistance(); auto status = library_->ConfigureOutputResistance(vi, channel_name, resistance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1499,6 +1707,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigurePowerLineFrequency(vi, powerline_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1520,6 +1732,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 level = request->level(); auto status = library_->ConfigurePulseBiasCurrentLevel(vi, channel_name, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1541,6 +1757,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseBiasCurrentLimit(vi, channel_name, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1562,6 +1782,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 level = request->level(); auto status = library_->ConfigurePulseBiasVoltageLevel(vi, channel_name, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1583,6 +1807,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseBiasVoltageLimit(vi, channel_name, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1604,6 +1832,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 level = request->level(); auto status = library_->ConfigurePulseCurrentLevel(vi, channel_name, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1625,6 +1857,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigurePulseCurrentLevelRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1646,6 +1882,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseCurrentLimit(vi, channel_name, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1667,6 +1907,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigurePulseCurrentLimitRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1688,6 +1932,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 level = request->level(); auto status = library_->ConfigurePulseVoltageLevel(vi, channel_name, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1709,6 +1957,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigurePulseVoltageLevelRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1730,6 +1982,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseVoltageLimit(vi, channel_name, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1751,6 +2007,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigurePulseVoltageLimitRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1787,6 +2047,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureSense(vi, channel_name, sense); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1806,6 +2070,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeMeasureTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1825,6 +2093,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgePulseTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1844,6 +2116,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeSequenceAdvanceTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1863,6 +2139,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeSourceTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1882,6 +2162,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1917,6 +2201,10 @@ namespace nidcpower_grpc { } auto status = library_->ConfigureSourceMode(vi, source_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1938,6 +2226,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 level = request->level(); auto status = library_->ConfigureVoltageLevel(vi, channel_name, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1959,6 +2251,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigureVoltageLevelRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1980,6 +2276,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 limit = request->limit(); auto status = library_->ConfigureVoltageLimit(vi, channel_name, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2001,6 +2301,10 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 range = request->range(); auto status = library_->ConfigureVoltageLimitRange(vi, channel_name, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2021,6 +2325,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateAdvancedSequenceStep(vi, set_as_active_step); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2041,6 +2349,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto sequence_name = request->sequence_name().c_str(); auto status = library_->DeleteAdvancedSequence(vi, sequence_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2060,6 +2372,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2079,6 +2395,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisablePulseTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2098,6 +2418,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableSequenceAdvanceTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2117,6 +2441,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableSourceTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2136,6 +2464,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2157,11 +2489,13 @@ namespace nidcpower_grpc { ViStatus error_code = request->error_code(); std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2182,10 +2516,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 size = status; response->mutable_configuration()->Resize(size, 0); @@ -2195,9 +2529,11 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -2218,6 +2554,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2255,6 +2595,10 @@ namespace nidcpower_grpc { auto signal_identifier = request->signal_identifier().c_str(); auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2283,11 +2627,13 @@ namespace nidcpower_grpc { std::vector in_compliance(count, ViBoolean()); ViInt32 actual_count {}; auto status = library_->FetchMultiple(vi, channel_name, timeout, count, voltage_measurements, current_measurements, in_compliance.data(), &actual_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(in_compliance, response->mutable_in_compliance()); response->set_actual_count(actual_count); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2309,10 +2655,12 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2334,10 +2682,12 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2359,10 +2709,12 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 attribute_value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2384,10 +2736,12 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2409,11 +2763,13 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2436,10 +2792,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string attribute_value; @@ -2451,11 +2807,13 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); - } return ::grpc::Status::OK; } } @@ -2478,10 +2836,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string channel_name; @@ -2493,11 +2851,13 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_channel_name(channel_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); - } return ::grpc::Status::OK; } } @@ -2520,10 +2880,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetChannelNameFromString(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string channel_name; @@ -2535,11 +2895,13 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_channel_name(channel_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); - } return ::grpc::Status::OK; } } @@ -2561,10 +2923,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; ViStatus code {}; @@ -2572,17 +2934,19 @@ namespace nidcpower_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &code, buffer_size, (ViChar*)description.data()); + status = library_->GetError(vi, &code, buffer_size, description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_code(code); response->set_description(description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); - } return ::grpc::Status::OK; } } @@ -2607,14 +2971,16 @@ namespace nidcpower_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2634,10 +3000,12 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->GetExtCalLastTemp(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2657,10 +3025,12 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_months(months); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2681,10 +3051,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string coercion_record; @@ -2696,11 +3066,13 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); - } return ::grpc::Status::OK; } } @@ -2722,10 +3094,10 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string interchange_warning; @@ -2737,11 +3109,13 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); - } return ::grpc::Status::OK; } } @@ -2766,14 +3140,16 @@ namespace nidcpower_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2793,10 +3169,12 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->GetSelfCalLastTemp(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2817,6 +3195,10 @@ namespace nidcpower_grpc { ViInt32 size = static_cast(request->configuration().size()); auto configuration = const_cast(reinterpret_cast(request->configuration().data())); auto status = library_->ImportAttributeConfigurationBuffer(vi, size, configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2837,6 +3219,10 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2867,14 +3253,12 @@ namespace nidcpower_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2893,6 +3277,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2930,10 +3318,12 @@ namespace nidcpower_grpc { ViReal64 measurement {}; auto status = library_->Measure(vi, channel_name, measurement_type, &measurement); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement(measurement); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2954,10 +3344,12 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); ViBoolean in_compliance {}; auto status = library_->QueryInCompliance(vi, channel_name, &in_compliance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_in_compliance(in_compliance); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2979,10 +3371,12 @@ namespace nidcpower_grpc { ViReal64 voltage_level = request->voltage_level(); ViReal64 max_current_limit {}; auto status = library_->QueryMaxCurrentLimit(vi, channel_name, voltage_level, &max_current_limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_max_current_limit(max_current_limit); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3004,10 +3398,12 @@ namespace nidcpower_grpc { ViReal64 current_limit = request->current_limit(); ViReal64 max_voltage_level {}; auto status = library_->QueryMaxVoltageLevel(vi, channel_name, current_limit, &max_voltage_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_max_voltage_level(max_voltage_level); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3029,10 +3425,12 @@ namespace nidcpower_grpc { ViReal64 voltage_level = request->voltage_level(); ViReal64 min_current_limit {}; auto status = library_->QueryMinCurrentLimit(vi, channel_name, voltage_level, &min_current_limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_min_current_limit(min_current_limit); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3069,10 +3467,12 @@ namespace nidcpower_grpc { ViBoolean in_state {}; auto status = library_->QueryOutputState(vi, channel_name, output_state, &in_state); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_in_state(in_state); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3092,10 +3492,12 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->ReadCurrentTemperature(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3114,6 +3516,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3133,6 +3539,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3152,6 +3562,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3171,6 +3585,10 @@ namespace nidcpower_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3192,13 +3610,15 @@ namespace nidcpower_grpc { std::string instrument_driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3219,12 +3639,14 @@ namespace nidcpower_grpc { ViInt16 self_test_result {}; std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3259,6 +3681,10 @@ namespace nidcpower_grpc { } auto status = library_->SendSoftwareEdgeTrigger(vi, trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3281,6 +3707,10 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3318,6 +3748,10 @@ namespace nidcpower_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3340,6 +3774,10 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 attribute_value = request->attribute_value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3377,6 +3815,10 @@ namespace nidcpower_grpc { } auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3400,6 +3842,10 @@ namespace nidcpower_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3422,6 +3868,10 @@ namespace nidcpower_grpc { ViAttr attribute_id = request->attribute_id(); auto attribute_value = request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3456,6 +3906,10 @@ namespace nidcpower_grpc { auto size = size_size_calculation.size; auto status = library_->SetSequence(vi, channel_name, values, source_delays, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3492,6 +3946,10 @@ namespace nidcpower_grpc { ViReal64 timeout = request->timeout(); auto status = library_->WaitForEvent(vi, event_id, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidcpower/nidcpower_service.h b/generated/nidcpower/nidcpower_service.h index 47ba4e4a5..a37ada244 100644 --- a/generated/nidcpower/nidcpower_service.h +++ b/generated/nidcpower/nidcpower_service.h @@ -177,6 +177,7 @@ class NiDCPowerService final : public NiDCPower::Service { private: NiDCPowerLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); void Copy(const std::vector& input, google::protobuf::RepeatedField* output); NiDCPowerFeatureToggles feature_toggles_; diff --git a/generated/nidigitalpattern/nidigitalpattern_service.cpp b/generated/nidigitalpattern/nidigitalpattern_service.cpp index e59d747a0..7ef66ceef 100644 --- a/generated/nidigitalpattern/nidigitalpattern_service.cpp +++ b/generated/nidigitalpattern/nidigitalpattern_service.cpp @@ -65,6 +65,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -84,6 +88,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AbortKeepAlive(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -109,6 +117,10 @@ namespace nidigitalpattern_grpc { auto initial_state_low_pins = request->initial_state_low_pins().c_str(); auto initial_state_tristate_pins = request->initial_state_tristate_pins().c_str(); auto status = library_->ApplyLevelsAndTiming(vi, site_list, levels_sheet, timing_sheet, initial_state_high_pins, initial_state_low_pins, initial_state_tristate_pins); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -131,6 +143,10 @@ namespace nidigitalpattern_grpc { ViInt32 num_offsets = static_cast(request->offsets().size()); auto offsets = const_cast(request->offsets().data()); auto status = library_->ApplyTDROffsets(vi, channel_list, num_offsets, offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -155,6 +171,10 @@ namespace nidigitalpattern_grpc { ViBoolean wait_until_done = request->wait_until_done(); ViReal64 timeout = request->timeout(); auto status = library_->BurstPattern(vi, site_list, start_label, select_digital_function, wait_until_done, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -185,6 +205,10 @@ namespace nidigitalpattern_grpc { ViBoolean wait_until_done = request->wait_until_done(); ViReal64 timeout = request->timeout(); auto status = library_->BurstPatternSynchronized(session_count, sessions.data(), site_list, start_label, select_digital_function, wait_until_done, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -204,6 +228,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -224,6 +252,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_list = request->channel_list().c_str(); auto status = library_->ClockGeneratorAbort(vi, channel_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -246,6 +278,10 @@ namespace nidigitalpattern_grpc { ViReal64 frequency = request->frequency(); ViBoolean select_digital_function = request->select_digital_function(); auto status = library_->ClockGeneratorGenerateClock(vi, channel_list, frequency, select_digital_function); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -266,6 +302,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_list = request->channel_list().c_str(); auto status = library_->ClockGeneratorInitiate(vi, channel_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -286,6 +326,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -305,6 +349,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -328,6 +376,10 @@ namespace nidigitalpattern_grpc { ViReal64 ioh = request->ioh(); ViReal64 vcom = request->vcom(); auto status = library_->ConfigureActiveLoadLevels(vi, channel_list, iol, ioh, vcom); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -349,6 +401,10 @@ namespace nidigitalpattern_grpc { ViInt64 cycle_number = request->cycle_number(); ViInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureCycleNumberHistoryRAMTrigger(vi, cycle_number, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -386,6 +442,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->ConfigureDigitalEdgeConditionalJumpTrigger(vi, trigger_identifier, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -422,6 +482,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -442,6 +506,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureFirstFailureHistoryRAMTrigger(vi, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -477,6 +545,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->ConfigureHistoryRAMCyclesToAcquire(vi, cycles_to_acquire); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -497,6 +569,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto site_list = request->site_list().c_str(); auto status = library_->ConfigurePatternBurstSites(vi, site_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -520,6 +596,10 @@ namespace nidigitalpattern_grpc { ViInt64 cycle_offset = request->cycle_offset(); ViInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigurePatternLabelHistoryRAMTrigger(vi, label, vector_offset, cycle_offset, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -540,6 +620,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto label = request->label().c_str(); auto status = library_->ConfigureStartLabel(vi, label); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -560,6 +644,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->ConfigureSoftwareEdgeConditionalJumpTrigger(vi, trigger_identifier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -579,6 +667,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -615,6 +707,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->ConfigureTerminationMode(vi, channel_list, mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -637,6 +733,10 @@ namespace nidigitalpattern_grpc { auto time_set_name = request->time_set_name().c_str(); ViReal64 strobe_edge = request->strobe_edge(); auto status = library_->ConfigureTimeSetCompareEdgesStrobe(vi, pin_list, time_set_name, strobe_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -660,6 +760,10 @@ namespace nidigitalpattern_grpc { ViReal64 strobe_edge = request->strobe_edge(); ViReal64 strobe2_edge = request->strobe2_edge(); auto status = library_->ConfigureTimeSetCompareEdgesStrobe2x(vi, pin_list, time_set_name, strobe_edge, strobe2_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -701,6 +805,10 @@ namespace nidigitalpattern_grpc { ViReal64 drive_return_edge = request->drive_return_edge(); ViReal64 drive_off_edge = request->drive_off_edge(); auto status = library_->ConfigureTimeSetDriveEdges(vi, pin_list, time_set_name, format, drive_on_edge, drive_data_edge, drive_return_edge, drive_off_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -744,6 +852,10 @@ namespace nidigitalpattern_grpc { ViReal64 drive_data2_edge = request->drive_data2_edge(); ViReal64 drive_return2_edge = request->drive_return2_edge(); auto status = library_->ConfigureTimeSetDriveEdges2x(vi, pin_list, time_set_name, format, drive_on_edge, drive_data_edge, drive_return_edge, drive_off_edge, drive_data2_edge, drive_return2_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -781,6 +893,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->ConfigureTimeSetDriveFormat(vi, pin_list, time_set_name, drive_format); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -819,6 +935,10 @@ namespace nidigitalpattern_grpc { ViReal64 time = request->time(); auto status = library_->ConfigureTimeSetEdge(vi, pin_list, time_set_name, edge, time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -841,6 +961,10 @@ namespace nidigitalpattern_grpc { auto time_set_name = request->time_set_name().c_str(); ViInt32 edge_multiplier = request->edge_multiplier(); auto status = library_->ConfigureTimeSetEdgeMultiplier(vi, pin_list, time_set_name, edge_multiplier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -862,6 +986,10 @@ namespace nidigitalpattern_grpc { auto time_set_name = request->time_set_name().c_str(); ViReal64 period = request->period(); auto status = library_->ConfigureTimeSetPeriod(vi, time_set_name, period); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -887,6 +1015,10 @@ namespace nidigitalpattern_grpc { ViReal64 voh = request->voh(); ViReal64 vterm = request->vterm(); auto status = library_->ConfigureVoltageLevels(vi, channel_list, vil, vih, vol, voh, vterm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -908,6 +1040,10 @@ namespace nidigitalpattern_grpc { auto waveform_name = request->waveform_name().c_str(); auto waveform_file_path = request->waveform_file_path().c_str(); auto status = library_->CreateCaptureWaveformFromFileDigicapture(vi, waveform_name, waveform_file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -929,6 +1065,10 @@ namespace nidigitalpattern_grpc { auto pin_list = request->pin_list().c_str(); auto waveform_name = request->waveform_name().c_str(); auto status = library_->CreateCaptureWaveformParallel(vi, pin_list, waveform_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -967,6 +1107,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->CreateCaptureWaveformSerial(vi, pin_list, waveform_name, sample_width, bit_order); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -987,6 +1131,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 num_sites = request->num_sites(); auto status = library_->CreateChannelMap(vi, num_sites); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1009,6 +1157,10 @@ namespace nidigitalpattern_grpc { auto waveform_file_path = request->waveform_file_path().c_str(); ViBoolean write_waveform_data = request->write_waveform_data(); auto status = library_->CreateSourceWaveformFromFileTDMS(vi, waveform_name, waveform_file_path, write_waveform_data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1030,6 +1182,10 @@ namespace nidigitalpattern_grpc { auto dut_pin_list = request->dut_pin_list().c_str(); auto system_pin_list = request->system_pin_list().c_str(); auto status = library_->CreatePinMap(vi, dut_pin_list, system_pin_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1051,6 +1207,10 @@ namespace nidigitalpattern_grpc { auto pin_group_name = request->pin_group_name().c_str(); auto pin_list = request->pin_list().c_str(); auto status = library_->CreatePinGroup(vi, pin_group_name, pin_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1088,6 +1248,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->CreateSourceWaveformParallel(vi, pin_list, waveform_name, data_mapping); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1142,6 +1306,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->CreateSourceWaveformSerial(vi, pin_list, waveform_name, data_mapping, sample_width, bit_order); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1162,6 +1330,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto name = request->name().c_str(); auto status = library_->CreateTimeSet(vi, name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1181,6 +1353,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DeleteAllTimeSets(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1201,6 +1377,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->DisableConditionalJumpTrigger(vi, trigger_identifier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1221,6 +1401,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto site_list = request->site_list().c_str(); auto status = library_->DisableSites(vi, site_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1240,6 +1424,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1267,6 +1455,10 @@ namespace nidigitalpattern_grpc { auto sync_session_grpc_session = request->sync_session(); ViSession sync_session = session_repository_->access_session(sync_session_grpc_session.id(), sync_session_grpc_session.name()); auto status = library_->EnableMatchFailCombination(session_count, sessions.data(), sync_session); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, sync_session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1287,6 +1479,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto site_list = request->site_list().c_str(); auto status = library_->EnableSites(vi, site_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1306,6 +1502,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->EndChannelMap(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1327,11 +1527,13 @@ namespace nidigitalpattern_grpc { ViStatus error_code = request->error_code(); std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1368,6 +1570,10 @@ namespace nidigitalpattern_grpc { auto signal_identifier = request->signal_identifier().c_str(); auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1394,10 +1600,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_samples_per_waveform {}; while (true) { auto status = library_->FetchCaptureWaveformU32(vi, site_list, waveform_name, samples_to_read, timeout, 0, nullptr, &actual_num_waveforms, &actual_samples_per_waveform); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_data()->Resize(actual_num_waveforms, 0); ViUInt32* data = reinterpret_cast(response->mutable_data()->mutable_data()); auto data_buffer_size = actual_num_waveforms; @@ -1406,12 +1612,14 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_data()->Resize(actual_num_waveforms, 0); response->set_actual_num_waveforms(actual_num_waveforms); response->set_actual_samples_per_waveform(actual_samples_per_waveform); - } return ::grpc::Status::OK; } } @@ -1438,14 +1646,16 @@ namespace nidigitalpattern_grpc { ViInt64 cycle_number {}; ViInt32 num_dut_cycles {}; auto status = library_->FetchHistoryRAMCycleInformation(vi, site, sample_index, &pattern_index, &time_set_index, &vector_number, &cycle_number, &num_dut_cycles); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_pattern_index(pattern_index); response->set_time_set_index(time_set_index); response->set_vector_number(vector_number); response->set_cycle_number(cycle_number); response->set_num_dut_cycles(num_dut_cycles); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1470,10 +1680,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_pin_data {}; while (true) { auto status = library_->FetchHistoryRAMCyclePinData(vi, site, pin_list, sample_index, dut_cycle_index, 0, nullptr, nullptr, nullptr, &actual_num_pin_data); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::string expected_pin_states(actual_num_pin_data, '\0'); std::string actual_pin_states(actual_num_pin_data, '\0'); std::vector per_pin_pass_fail(actual_num_pin_data, ViBoolean()); @@ -1483,8 +1693,11 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { CopyBytesToEnums(expected_pin_states, response->mutable_expected_pin_states()); response->set_expected_pin_states_raw(expected_pin_states); response->mutable_expected_pin_states()->Resize(actual_num_pin_data, 0); @@ -1494,7 +1707,6 @@ namespace nidigitalpattern_grpc { convert_to_grpc(per_pin_pass_fail, response->mutable_per_pin_pass_fail()); response->mutable_per_pin_pass_fail()->Resize(actual_num_pin_data, 0); response->set_actual_num_pin_data(actual_num_pin_data); - } return ::grpc::Status::OK; } } @@ -1517,10 +1729,12 @@ namespace nidigitalpattern_grpc { ViInt64 sample_index = request->sample_index(); ViInt64 scan_cycle_number {}; auto status = library_->FetchHistoryRAMScanCycleNumber(vi, site, sample_index, &scan_cycle_number); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_scan_cycle_number(scan_cycle_number); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1555,6 +1769,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->FrequencyCounterConfigureMeasurementMode(vi, measurement_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1576,6 +1794,10 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 measurement_time = request->measurement_time(); auto status = library_->FrequencyCounterConfigureMeasurementTime(vi, channel_list, measurement_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1598,10 +1820,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_frequencies {}; while (true) { auto status = library_->FrequencyCounterMeasureFrequency(vi, channel_list, 0, nullptr, &actual_num_frequencies); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_frequencies()->Resize(actual_num_frequencies, 0); ViReal64* frequencies = response->mutable_frequencies()->mutable_data(); auto frequencies_buffer_size = actual_num_frequencies; @@ -1610,11 +1832,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_frequencies()->Resize(actual_num_frequencies, 0); response->set_actual_num_frequencies(actual_num_frequencies); - } return ::grpc::Status::OK; } } @@ -1637,10 +1861,12 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1662,10 +1888,12 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1687,10 +1915,12 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1712,10 +1942,12 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1737,11 +1969,13 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_list, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1764,10 +1998,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string value; @@ -1779,11 +2013,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -1806,10 +2042,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 name_buffer_size = status; std::string name; @@ -1821,11 +2057,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - } return ::grpc::Status::OK; } } @@ -1848,10 +2086,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetChannelNameFromString(vi, indices, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 name_buffer_size = status; std::string names; @@ -1863,11 +2101,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_names(names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_names())); - } return ::grpc::Status::OK; } } @@ -1889,10 +2129,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -1905,12 +2145,14 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -1933,10 +2175,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_read {}; while (true) { auto status = library_->GetFailCount(vi, channel_list, 0, nullptr, &actual_num_read); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_failure_count()->Resize(actual_num_read, 0); ViInt64* failure_count = response->mutable_failure_count()->mutable_data(); auto buffer_size = actual_num_read; @@ -1945,11 +2187,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_failure_count()->Resize(actual_num_read, 0); response->set_actual_num_read(actual_num_read); - } return ::grpc::Status::OK; } } @@ -1971,10 +2215,12 @@ namespace nidigitalpattern_grpc { auto site = request->site().c_str(); ViInt64 sample_count {}; auto status = library_->GetHistoryRAMSampleCount(vi, site, &sample_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_sample_count(sample_count); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1996,10 +2242,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_pins {}; while (true) { auto status = library_->GetPatternPinIndexes(vi, start_label, 0, nullptr, &actual_num_pins); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_pin_indexes()->Resize(actual_num_pins, 0); ViInt32* pin_indexes = reinterpret_cast(response->mutable_pin_indexes()->mutable_data()); auto pin_indexes_buffer_size = actual_num_pins; @@ -2008,11 +2254,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_pin_indexes()->Resize(actual_num_pins, 0); response->set_actual_num_pins(actual_num_pins); - } return ::grpc::Status::OK; } } @@ -2035,10 +2283,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetPatternName(vi, pattern_index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 name_buffer_size = status; std::string name; @@ -2050,11 +2298,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - } return ::grpc::Status::OK; } } @@ -2077,10 +2327,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetPatternPinList(vi, start_label, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 pin_list_buffer_size = status; std::string pin_list; @@ -2092,11 +2342,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_pin_list(pin_list); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_pin_list())); - } return ::grpc::Status::OK; } } @@ -2119,10 +2371,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetPinName(vi, pin_index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 name_buffer_size = status; std::string name; @@ -2134,11 +2386,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - } return ::grpc::Status::OK; } } @@ -2161,10 +2415,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_values {}; while (true) { auto status = library_->GetPinResultsPinInformation(vi, channel_list, 0, nullptr, nullptr, nullptr, &actual_num_values); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_pin_indexes()->Resize(actual_num_values, 0); ViInt32* pin_indexes = reinterpret_cast(response->mutable_pin_indexes()->mutable_data()); response->mutable_site_numbers()->Resize(actual_num_values, 0); @@ -2177,13 +2431,15 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_pin_indexes()->Resize(actual_num_values, 0); response->mutable_site_numbers()->Resize(actual_num_values, 0); response->mutable_channel_indexes()->Resize(actual_num_values, 0); response->set_actual_num_values(actual_num_values); - } return ::grpc::Status::OK; } } @@ -2206,10 +2462,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_sites {}; while (true) { auto status = library_->GetSitePassFail(vi, site_list, 0, nullptr, &actual_num_sites); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::vector pass_fail(actual_num_sites, ViBoolean()); auto pass_fail_buffer_size = actual_num_sites; status = library_->GetSitePassFail(vi, site_list, pass_fail_buffer_size, pass_fail.data(), &actual_num_sites); @@ -2217,12 +2473,14 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pass_fail, response->mutable_pass_fail()); response->mutable_pass_fail()->Resize(actual_num_sites, 0); response->set_actual_num_sites(actual_num_sites); - } return ::grpc::Status::OK; } } @@ -2261,10 +2519,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_site_numbers {}; while (true) { auto status = library_->GetSiteResultsSiteNumbers(vi, site_list, site_result_type, 0, nullptr, &actual_num_site_numbers); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_site_numbers()->Resize(actual_num_site_numbers, 0); ViInt32* site_numbers = reinterpret_cast(response->mutable_site_numbers()->mutable_data()); auto site_numbers_buffer_size = actual_num_site_numbers; @@ -2273,11 +2531,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_site_numbers()->Resize(actual_num_site_numbers, 0); response->set_actual_num_site_numbers(actual_num_site_numbers); - } return ::grpc::Status::OK; } } @@ -2300,11 +2560,13 @@ namespace nidigitalpattern_grpc { auto time_set_name = request->time_set_name().c_str(); ViInt32 format {}; auto status = library_->GetTimeSetDriveFormat(vi, pin, time_set_name, &format); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_format(static_cast(format)); response->set_format_raw(format); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2342,10 +2604,12 @@ namespace nidigitalpattern_grpc { ViReal64 time {}; auto status = library_->GetTimeSetEdge(vi, pin, time_set_name, edge, &time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_time(time); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2367,10 +2631,12 @@ namespace nidigitalpattern_grpc { auto time_set_name = request->time_set_name().c_str(); ViInt32 edge_multiplier {}; auto status = library_->GetTimeSetEdgeMultiplier(vi, pin, time_set_name, &edge_multiplier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_edge_multiplier(edge_multiplier); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2392,10 +2658,10 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetTimeSetName(vi, time_set_index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 name_buffer_size = status; std::string name; @@ -2407,11 +2673,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - } return ::grpc::Status::OK; } } @@ -2433,10 +2701,12 @@ namespace nidigitalpattern_grpc { auto time_set_name = request->time_set_name().c_str(); ViReal64 period {}; auto status = library_->GetTimeSetPeriod(vi, time_set_name, &period); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_period(period); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2465,14 +2735,12 @@ namespace nidigitalpattern_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2502,14 +2770,12 @@ namespace nidigitalpattern_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2528,6 +2794,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2548,10 +2818,12 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean done {}; auto status = library_->IsDone(vi, &done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_done(done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2572,10 +2844,12 @@ namespace nidigitalpattern_grpc { auto site = request->site().c_str(); ViBoolean enable {}; auto status = library_->IsSiteEnabled(vi, site, &enable); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_enable(enable); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2595,6 +2869,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->LoadLevels(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2615,6 +2893,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->LoadPattern(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2635,6 +2917,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->LoadPinMap(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2655,6 +2941,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->LoadSpecifications(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2675,6 +2965,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->LoadTiming(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2697,6 +2991,10 @@ namespace nidigitalpattern_grpc { ViInt32 site = request->site(); auto channel = request->channel().c_str(); auto status = library_->MapPinToChannel(vi, pin, site, channel); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2734,6 +3032,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->PPMUConfigureApertureTime(vi, channel_list, aperture_time, units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2755,6 +3057,10 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 current_level = request->current_level(); auto status = library_->PPMUConfigureCurrentLevel(vi, channel_list, current_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2776,6 +3082,10 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 range = request->range(); auto status = library_->PPMUConfigureCurrentLevelRange(vi, channel_list, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2813,6 +3123,10 @@ namespace nidigitalpattern_grpc { ViReal64 limit = request->limit(); auto status = library_->PPMUConfigureCurrentLimit(vi, channel_list, behavior, limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2834,6 +3148,10 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 range = request->range(); auto status = library_->PPMUConfigureCurrentLimitRange(vi, channel_list, range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2870,6 +3188,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->PPMUConfigureOutputFunction(vi, channel_list, output_function); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2891,6 +3213,10 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 voltage_level = request->voltage_level(); auto status = library_->PPMUConfigureVoltageLevel(vi, channel_list, voltage_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2913,6 +3239,10 @@ namespace nidigitalpattern_grpc { ViReal64 lower_voltage_limit = request->lower_voltage_limit(); ViReal64 upper_voltage_limit = request->upper_voltage_limit(); auto status = library_->PPMUConfigureVoltageLimits(vi, channel_list, lower_voltage_limit, upper_voltage_limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2951,10 +3281,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_read {}; while (true) { auto status = library_->PPMUMeasure(vi, channel_list, measurement_type, 0, nullptr, &actual_num_read); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_measurements()->Resize(actual_num_read, 0); ViReal64* measurements = response->mutable_measurements()->mutable_data(); auto buffer_size = actual_num_read; @@ -2963,11 +3293,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurements()->Resize(actual_num_read, 0); response->set_actual_num_read(actual_num_read); - } return ::grpc::Status::OK; } } @@ -2988,6 +3320,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_list = request->channel_list().c_str(); auto status = library_->PPMUSource(vi, channel_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3009,10 +3345,12 @@ namespace nidigitalpattern_grpc { auto flag = request->flag().c_str(); ViBoolean value {}; auto status = library_->ReadSequencerFlag(vi, flag, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3033,10 +3371,12 @@ namespace nidigitalpattern_grpc { auto reg = request->reg().c_str(); ViInt32 value {}; auto status = library_->ReadSequencerRegister(vi, reg, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3058,10 +3398,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_read {}; while (true) { auto status = library_->ReadStatic(vi, channel_list, 0, nullptr, &actual_num_read); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::string data(actual_num_read, '\0'); auto buffer_size = actual_num_read; status = library_->ReadStatic(vi, channel_list, buffer_size, (ViUInt8*)data.data(), &actual_num_read); @@ -3069,13 +3409,15 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { CopyBytesToEnums(data, response->mutable_data()); response->set_data_raw(data); response->mutable_data()->Resize(actual_num_read, 0); response->set_actual_num_read(actual_num_read); - } return ::grpc::Status::OK; } } @@ -3095,6 +3437,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3116,6 +3462,10 @@ namespace nidigitalpattern_grpc { auto channel_name = request->channel_name().c_str(); ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3135,6 +3485,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3171,6 +3525,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->SelectFunction(vi, channel_list, function); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3190,6 +3548,10 @@ namespace nidigitalpattern_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCalibrate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3211,12 +3573,14 @@ namespace nidigitalpattern_grpc { ViInt16 test_result {}; std::string test_message(2048 - 1, '\0'); auto status = library_->SelfTest(vi, &test_result, (ViChar*)test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_test_result(test_result); response->set_test_message(test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3252,6 +3616,10 @@ namespace nidigitalpattern_grpc { auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_identifier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3274,6 +3642,10 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3311,6 +3683,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3333,6 +3709,10 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViInt64 value = request->value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3355,6 +3735,10 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(vi, channel_name, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3378,6 +3762,10 @@ namespace nidigitalpattern_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_list, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3400,6 +3788,10 @@ namespace nidigitalpattern_grpc { ViAttr attribute = request->attribute(); auto value = request->value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3423,10 +3815,10 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_offsets {}; while (true) { auto status = library_->TDR(vi, channel_list, apply_offsets, 0, nullptr, &actual_num_offsets); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_offsets()->Resize(actual_num_offsets, 0); ViReal64* offsets = response->mutable_offsets()->mutable_data(); auto offsets_buffer_size = actual_num_offsets; @@ -3435,11 +3827,13 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_offsets()->Resize(actual_num_offsets, 0); response->set_actual_num_offsets(actual_num_offsets); - } return ::grpc::Status::OK; } } @@ -3460,6 +3854,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean unload_keep_alive_pattern = request->unload_keep_alive_pattern(); auto status = library_->UnloadAllPatterns(vi, unload_keep_alive_pattern); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3480,6 +3878,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->UnloadSpecifications(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3500,6 +3902,10 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 timeout = request->timeout(); auto status = library_->WaitUntilDone(vi, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3521,6 +3927,10 @@ namespace nidigitalpattern_grpc { auto flag = request->flag().c_str(); ViBoolean value = request->value(); auto status = library_->WriteSequencerFlag(vi, flag, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3548,6 +3958,10 @@ namespace nidigitalpattern_grpc { auto flag = request->flag().c_str(); ViBoolean value = request->value(); auto status = library_->WriteSequencerFlagSynchronized(session_count, sessions.data(), flag, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3569,6 +3983,10 @@ namespace nidigitalpattern_grpc { auto reg = request->reg().c_str(); ViInt32 value = request->value(); auto status = library_->WriteSequencerRegister(vi, reg, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3591,6 +4009,10 @@ namespace nidigitalpattern_grpc { ViInt32 waveform_size = static_cast(request->waveform_data().size()); auto waveform_data = const_cast(reinterpret_cast(request->waveform_data().data())); auto status = library_->WriteSourceWaveformBroadcastU32(vi, waveform_name, waveform_size, waveform_data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3612,6 +4034,10 @@ namespace nidigitalpattern_grpc { auto waveform_name = request->waveform_name().c_str(); auto waveform_file_path = request->waveform_file_path().c_str(); auto status = library_->WriteSourceWaveformDataFromFileTDMS(vi, waveform_name, waveform_file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3648,6 +4074,10 @@ namespace nidigitalpattern_grpc { } auto status = library_->WriteStatic(vi, channel_list, state); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3672,6 +4102,10 @@ namespace nidigitalpattern_grpc { ViInt32 samples_per_waveform = request->samples_per_waveform(); auto waveform_data = const_cast(reinterpret_cast(request->waveform_data().data())); auto status = library_->WriteSourceWaveformSiteUniqueU32(vi, site_list, waveform_name, num_waveforms, samples_per_waveform, waveform_data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidigitalpattern/nidigitalpattern_service.h b/generated/nidigitalpattern/nidigitalpattern_service.h index 247368b86..db4887031 100644 --- a/generated/nidigitalpattern/nidigitalpattern_service.h +++ b/generated/nidigitalpattern/nidigitalpattern_service.h @@ -174,6 +174,7 @@ class NiDigitalService final : public NiDigital::Service { private: NiDigitalLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); void Copy(const std::vector& input, google::protobuf::RepeatedField* output); template void CopyBytesToEnums(const std::string& input, google::protobuf::RepeatedField* output); diff --git a/generated/nidmm/nidmm_service.cpp b/generated/nidmm/nidmm_service.cpp index aa18b275b..5b31459c0 100644 --- a/generated/nidmm/nidmm_service.cpp +++ b/generated/nidmm/nidmm_service.cpp @@ -71,6 +71,10 @@ namespace nidmm_grpc { } auto status = library_->Control4022(resource_name, configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -90,6 +94,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -112,6 +120,10 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -149,6 +161,10 @@ namespace nidmm_grpc { } auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -186,6 +202,10 @@ namespace nidmm_grpc { } auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -209,6 +229,10 @@ namespace nidmm_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -231,6 +255,10 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -250,6 +278,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -269,6 +301,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -289,6 +325,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -310,6 +350,10 @@ namespace nidmm_grpc { ViReal64 ac_minimum_frequency_hz = request->ac_minimum_frequency_hz(); ViReal64 ac_maximum_frequency_hz = request->ac_maximum_frequency_hz(); auto status = library_->ConfigureACBandwidth(vi, ac_minimum_frequency_hz, ac_maximum_frequency_hz); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -330,6 +374,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 adc_calibration = request->adc_calibration(); auto status = library_->ConfigureADCCalibration(vi, adc_calibration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -350,6 +398,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 auto_zero_mode = request->auto_zero_mode(); auto status = library_->ConfigureAutoZeroMode(vi, auto_zero_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -370,6 +422,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 cable_comp_type = request->cable_comp_type(); auto status = library_->ConfigureCableCompType(vi, cable_comp_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -390,6 +446,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 current_source = request->current_source(); auto status = library_->ConfigureCurrentSource(vi, current_source); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -410,6 +470,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 fixed_reference_junction = request->fixed_reference_junction(); auto status = library_->ConfigureFixedRefJunction(vi, fixed_reference_junction); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -445,6 +509,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureFrequencyVoltageRange(vi, voltage_range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -465,6 +533,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 meas_complete_destination = request->meas_complete_destination(); auto status = library_->ConfigureMeasCompleteDest(vi, meas_complete_destination); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -502,6 +574,10 @@ namespace nidmm_grpc { ViReal64 range = request->range(); ViReal64 resolution_absolute = request->resolution_absolute(); auto status = library_->ConfigureMeasurementAbsolute(vi, measurement_function, range, resolution_absolute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -522,6 +598,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 meas_complete_slope = request->meas_complete_slope(); auto status = library_->ConfigureMeasCompleteSlope(vi, meas_complete_slope); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -559,6 +639,10 @@ namespace nidmm_grpc { ViReal64 range = request->range(); ViReal64 resolution_digits = request->resolution_digits(); auto status = library_->ConfigureMeasurementDigits(vi, measurement_function, range, resolution_digits); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -642,6 +726,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureMultiPoint(vi, trigger_count, sample_count, sample_trigger, sample_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -677,6 +765,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureOffsetCompOhms(vi, offset_comp_ohms); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -698,6 +790,10 @@ namespace nidmm_grpc { ViReal64 conductance = request->conductance(); ViReal64 susceptance = request->susceptance(); auto status = library_->ConfigureOpenCableCompValues(vi, conductance, susceptance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -733,6 +829,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigurePowerLineFrequency(vi, power_line_frequency_hz); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -754,6 +854,10 @@ namespace nidmm_grpc { ViReal64 resistance = request->resistance(); ViReal64 reactance = request->reactance(); auto status = library_->ConfigureShortCableCompValues(vi, resistance, reactance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -776,6 +880,10 @@ namespace nidmm_grpc { ViReal64 rtd_b = request->rtd_b(); ViReal64 rtd_c = request->rtd_c(); auto status = library_->ConfigureRTDCustom(vi, rtd_a, rtd_b, rtd_c); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -812,6 +920,10 @@ namespace nidmm_grpc { ViReal64 rtd_resistance = request->rtd_resistance(); auto status = library_->ConfigureRTDType(vi, rtd_type, rtd_resistance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -847,6 +959,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureSampleTriggerSlope(vi, sample_trigger_slope); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -869,6 +985,10 @@ namespace nidmm_grpc { ViReal64 thermistor_b = request->thermistor_b(); ViReal64 thermistor_c = request->thermistor_c(); auto status = library_->ConfigureThermistorCustom(vi, thermistor_a, thermistor_b, thermistor_c); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -920,6 +1040,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureThermocouple(vi, thermocouple_type, reference_junction_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -940,6 +1064,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 thermistor_type = request->thermistor_type(); auto status = library_->ConfigureThermistorType(vi, thermistor_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -960,6 +1088,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 transducer_type = request->transducer_type(); auto status = library_->ConfigureTransducerType(vi, transducer_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1011,6 +1143,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureTrigger(vi, trigger_source, trigger_delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1046,6 +1182,10 @@ namespace nidmm_grpc { } auto status = library_->ConfigureTriggerSlope(vi, trigger_slope); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1084,6 +1224,10 @@ namespace nidmm_grpc { ViReal64 rate = request->rate(); ViInt32 waveform_points = request->waveform_points(); auto status = library_->ConfigureWaveformAcquisition(vi, measurement_function, range, rate, waveform_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1104,6 +1248,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 waveform_coupling = request->waveform_coupling(); auto status = library_->ConfigureWaveformCoupling(vi, waveform_coupling); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1139,6 +1287,10 @@ namespace nidmm_grpc { } auto status = library_->Control(vi, control_action); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1158,6 +1310,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1179,10 +1335,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 size = status; std::string configuration(size, '\0'); @@ -1191,10 +1347,12 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_configuration(configuration); - } return ::grpc::Status::OK; } } @@ -1215,6 +1373,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1251,10 +1413,12 @@ namespace nidmm_grpc { ViReal64 reading {}; auto status = library_->Fetch(vi, maximum_time, &reading); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_reading(reading); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1293,10 +1457,12 @@ namespace nidmm_grpc { ViReal64* reading_array = response->mutable_reading_array()->mutable_data(); ViInt32 actual_number_of_points {}; auto status = library_->FetchMultiPoint(vi, maximum_time, array_size, reading_array, &actual_number_of_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_number_of_points(actual_number_of_points); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1335,10 +1501,12 @@ namespace nidmm_grpc { ViReal64* waveform_array = response->mutable_waveform_array()->mutable_data(); ViInt32 actual_number_of_points {}; auto status = library_->FetchWaveform(vi, maximum_time, array_size, waveform_array, &actual_number_of_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_number_of_points(actual_number_of_points); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1359,15 +1527,17 @@ namespace nidmm_grpc { ViReal64 aperture_time {}; ViInt32 aperture_time_units {}; auto status = library_->GetApertureTimeInfo(vi, &aperture_time, &aperture_time_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { if(aperture_time == (int)aperture_time) { response->set_aperture_time(static_cast(static_cast(aperture_time))); } response->set_aperture_time_raw(aperture_time); response->set_aperture_time_units(static_cast(aperture_time_units)); response->set_aperture_time_units_raw(aperture_time_units); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1389,10 +1559,12 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1414,10 +1586,12 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1439,10 +1613,12 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1464,11 +1640,13 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1491,10 +1669,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string attribute_value; @@ -1506,11 +1684,13 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); - } return ::grpc::Status::OK; } } @@ -1531,10 +1711,12 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 actual_range {}; auto status = library_->GetAutoRangeValue(vi, &actual_range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_range(actual_range); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1574,14 +1756,16 @@ namespace nidmm_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetCalDateAndTime(vi, cal_type, &month, &day, &year, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_month(month); response->set_day(day); response->set_year(year); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1603,10 +1787,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string channel_string; @@ -1618,11 +1802,13 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_channel_string(channel_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); - } return ::grpc::Status::OK; } } @@ -1644,10 +1830,12 @@ namespace nidmm_grpc { ViString options = (ViString)request->options().c_str(); ViReal64 temperature {}; auto status = library_->GetDevTemp(vi, options, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1668,10 +1856,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; ViStatus error_code {}; @@ -1679,17 +1867,19 @@ namespace nidmm_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &error_code, buffer_size, (ViChar*)description.data()); + status = library_->GetError(vi, &error_code, buffer_size, description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_description(description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); - } return ::grpc::Status::OK; } } @@ -1712,10 +1902,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetErrorMessage(vi, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string error_message; @@ -1727,11 +1917,13 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } } @@ -1752,10 +1944,12 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_months(months); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1791,10 +1985,12 @@ namespace nidmm_grpc { ViReal64 temperature {}; auto status = library_->GetLastCalTemp(vi, cal_type, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1814,10 +2010,12 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 period {}; auto status = library_->GetMeasurementPeriod(vi, &period); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_period(period); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1838,10 +2036,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string coercion_record; @@ -1853,11 +2051,13 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); - } return ::grpc::Status::OK; } } @@ -1879,10 +2079,10 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string interchange_warning; @@ -1894,11 +2094,13 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); - } return ::grpc::Status::OK; } } @@ -1919,10 +2121,12 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean self_cal_supported {}; auto status = library_->GetSelfCalSupported(vi, &self_cal_supported); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_cal_supported(self_cal_supported); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1943,6 +2147,10 @@ namespace nidmm_grpc { ViInt32 size = static_cast(request->configuration().size()); ViInt8* configuration = (ViInt8*)request->configuration().c_str(); auto status = library_->ImportAttributeConfigurationBuffer(vi, size, configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1963,6 +2171,10 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1992,14 +2204,12 @@ namespace nidmm_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2029,14 +2239,12 @@ namespace nidmm_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2055,6 +2263,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2074,6 +2286,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2095,10 +2311,12 @@ namespace nidmm_grpc { ViReal64 measurement_value = request->measurement_value(); ViBoolean is_over_range {}; auto status = library_->IsOverRange(vi, measurement_value, &is_over_range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_over_range(is_over_range); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2119,10 +2337,12 @@ namespace nidmm_grpc { ViReal64 measurement_value = request->measurement_value(); ViBoolean is_under_range {}; auto status = library_->IsUnderRange(vi, measurement_value, &is_under_range); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_under_range(is_under_range); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2143,11 +2363,13 @@ namespace nidmm_grpc { ViReal64 conductance {}; ViReal64 susceptance {}; auto status = library_->PerformOpenCableComp(vi, &conductance, &susceptance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_conductance(conductance); response->set_susceptance(susceptance); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2168,11 +2390,13 @@ namespace nidmm_grpc { ViReal64 resistance {}; ViReal64 reactance {}; auto status = library_->PerformShortCableComp(vi, &resistance, &reactance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_resistance(resistance); response->set_reactance(reactance); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2208,10 +2432,12 @@ namespace nidmm_grpc { ViReal64 reading {}; auto status = library_->Read(vi, maximum_time, &reading); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_reading(reading); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2250,10 +2476,12 @@ namespace nidmm_grpc { ViReal64* reading_array = response->mutable_reading_array()->mutable_data(); ViInt32 actual_number_of_points {}; auto status = library_->ReadMultiPoint(vi, maximum_time, array_size, reading_array, &actual_number_of_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_number_of_points(actual_number_of_points); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2274,12 +2502,14 @@ namespace nidmm_grpc { ViInt32 acquisition_backlog {}; ViInt16 acquisition_status {}; auto status = library_->ReadStatus(vi, &acquisition_backlog, &acquisition_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_acquisition_backlog(acquisition_backlog); response->set_acquisition_status(static_cast(acquisition_status)); response->set_acquisition_status_raw(acquisition_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2318,10 +2548,12 @@ namespace nidmm_grpc { ViReal64* waveform_array = response->mutable_waveform_array()->mutable_data(); ViInt32 actual_number_of_points {}; auto status = library_->ReadWaveform(vi, maximum_time, array_size, waveform_array, &actual_number_of_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_number_of_points(actual_number_of_points); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2340,6 +2572,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2359,6 +2595,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2378,6 +2618,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2399,13 +2643,15 @@ namespace nidmm_grpc { std::string instrument_driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2424,6 +2670,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2445,12 +2695,14 @@ namespace nidmm_grpc { ViInt16 self_test_result {}; std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2469,6 +2721,10 @@ namespace nidmm_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SendSoftwareTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2491,6 +2747,10 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2528,6 +2788,10 @@ namespace nidmm_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2565,6 +2829,10 @@ namespace nidmm_grpc { } auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2588,6 +2856,10 @@ namespace nidmm_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2610,6 +2882,10 @@ namespace nidmm_grpc { ViAttr attribute_id = request->attribute_id(); ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidmm/nidmm_service.h b/generated/nidmm/nidmm_service.h index 841018fe7..f60997cff 100644 --- a/generated/nidmm/nidmm_service.h +++ b/generated/nidmm/nidmm_service.h @@ -132,6 +132,7 @@ class NiDmmService final : public NiDmm::Service { private: NiDmmLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); NiDmmFeatureToggles feature_toggles_; }; diff --git a/generated/nifake/nifake_service.cpp b/generated/nifake/nifake_service.cpp index a1771d1df..b5732a3bd 100644 --- a/generated/nifake/nifake_service.cpp +++ b/generated/nifake/nifake_service.cpp @@ -65,6 +65,10 @@ namespace nifake_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -86,6 +90,10 @@ namespace nifake_grpc { ViInt32 count = static_cast(request->delays().size()); auto delays = const_cast(request->delays().data()); auto status = library_->AcceptListOfDurationsInSeconds(vi, count, delays); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -111,6 +119,10 @@ namespace nifake_grpc { std::back_inserter(session_array), [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); auto status = library_->AcceptViSessionArray(session_count, session_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -132,6 +144,10 @@ namespace nifake_grpc { ViInt32 array_len = static_cast(request->u_int32_array().size()); auto u_int32_array = const_cast(reinterpret_cast(request->u_int32_array().data())); auto status = library_->AcceptViUInt32Array(vi, array_len, u_int32_array); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -153,10 +169,12 @@ namespace nifake_grpc { ViInt32 number_of_elements = request->number_of_elements(); std::vector an_array(number_of_elements, ViBoolean()); auto status = library_->BoolArrayOutputFunction(vi, number_of_elements, an_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(an_array, response->mutable_an_array()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -177,6 +195,10 @@ namespace nifake_grpc { ViInt32 number_of_elements = request->number_of_elements(); auto an_array = convert_from_grpc(request->an_array()); auto status = library_->BoolArrayInputFunction(vi, number_of_elements, an_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -197,6 +219,10 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto reserved = nullptr; auto status = library_->CommandWithReservedParam(vi, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -216,6 +242,10 @@ namespace nifake_grpc { ViInt32 number_of_list_attributes = static_cast(request->list_attribute_ids().size()); auto list_attribute_ids = const_cast(reinterpret_cast(request->list_attribute_ids().data())); auto status = library_->CreateConfigurationList(number_of_list_attributes, list_attribute_ids); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -237,6 +267,10 @@ namespace nifake_grpc { ViInt32 number_count = static_cast(request->numbers().size()); auto numbers = const_cast(request->numbers().data()); auto status = library_->DoubleAllTheNums(vi, number_count, numbers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -287,6 +321,10 @@ namespace nifake_grpc { } auto status = library_->EnumInputFunctionWithDefaults(vi, a_turtle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -308,10 +346,10 @@ namespace nifake_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 size_in_bytes = status; std::string configuration(size_in_bytes, '\0'); @@ -320,10 +358,12 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_configuration(configuration); - } return ::grpc::Status::OK; } } @@ -347,10 +387,12 @@ namespace nifake_grpc { ViReal64* waveform_data = response->mutable_waveform_data()->mutable_data(); ViInt32 actual_number_of_samples {}; auto status = library_->FetchWaveform(vi, number_of_samples, waveform_data, &actual_number_of_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_number_of_samples(actual_number_of_samples); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -370,10 +412,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean a_boolean {}; auto status = library_->GetABoolean(vi, &a_boolean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_boolean(a_boolean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -393,10 +437,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt16 a_number {}; auto status = library_->GetANumber(vi, &a_number); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_number(a_number); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -416,11 +462,13 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); std::string a_string(256 - 1, '\0'); auto status = library_->GetAStringOfFixedMaximumSize(vi, (ViChar*)a_string.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_string(a_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -438,8 +486,11 @@ namespace nifake_grpc { try { ViInt64 flags {}; auto status = library_->GetBitfieldAsEnumArray(&flags); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { if (flags & 0x1) response->add_flags_array(Bitfield::BITFIELD_FLAG_A); if (flags & 0x2) @@ -449,7 +500,6 @@ namespace nifake_grpc { if (flags & 0x8) response->add_flags_array(Bitfield::BITFIELD_FLAG_D); response->set_flags_raw(flags); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -470,10 +520,10 @@ namespace nifake_grpc { while (true) { auto status = library_->GetAnIviDanceString(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string a_string; @@ -485,11 +535,13 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_string(a_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); - } return ::grpc::Status::OK; } } @@ -518,6 +570,10 @@ namespace nifake_grpc { auto array_lengths = const_cast(reinterpret_cast(request->array_lengths().data())); ViInt32 array_size = static_cast(request->array_lengths().size()); auto status = library_->UseATwoDimensionParameter(vi, array, array_lengths, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -540,10 +596,10 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistArray(vi, a_string, 0, nullptr, &actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_array_out()->Resize(actual_size, 0); ViInt32* array_out = reinterpret_cast(response->mutable_array_out()->mutable_data()); auto buffer_size = actual_size; @@ -552,11 +608,13 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_array_out()->Resize(actual_size, 0); response->set_actual_size(actual_size); - } return ::grpc::Status::OK; } } @@ -578,10 +636,10 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistArrayOfCustomType(vi, 0, nullptr, &actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::vector array_out(actual_size, CustomStruct()); auto buffer_size = actual_size; status = library_->GetAnIviDanceWithATwistArrayOfCustomType(vi, buffer_size, array_out.data(), &actual_size); @@ -589,8 +647,11 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(array_out, response->mutable_array_out()); { auto shrunk_size = actual_size; @@ -600,7 +661,6 @@ namespace nifake_grpc { } } response->set_actual_size(actual_size); - } return ::grpc::Status::OK; } } @@ -622,10 +682,10 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistArrayWithInputArray(data_in, array_size_in, 0, nullptr, &actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->mutable_array_out()->Resize(actual_size, 0); ViInt32* array_out = reinterpret_cast(response->mutable_array_out()->mutable_data()); auto buffer_size = actual_size; @@ -634,11 +694,13 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_array_out()->Resize(actual_size, 0); response->set_actual_size(actual_size); - } return ::grpc::Status::OK; } } @@ -658,10 +720,10 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistByteArray(0, nullptr, &actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + std::string array_out(actual_size, '\0'); auto buffer_size = actual_size; status = library_->GetAnIviDanceWithATwistByteArray(buffer_size, (ViInt8*)array_out.data(), &actual_size); @@ -669,12 +731,14 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_array_out(array_out); response->mutable_array_out()->resize(actual_size); response->set_actual_size(actual_size); - } return ::grpc::Status::OK; } } @@ -694,10 +758,10 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistString(0, nullptr, &actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + std::string array_out; if (actual_size > 0) { array_out.resize(actual_size - 1); @@ -708,12 +772,14 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_array_out(array_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_array_out())); response->set_actual_size(actual_size); - } return ::grpc::Status::OK; } } @@ -733,10 +799,10 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistStringStrlenBug(0, nullptr, &actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + std::string string_out; if (actual_size > 0) { string_out.resize(actual_size /* Workaround: strlen-bug */); @@ -747,12 +813,14 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_string_out(string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); response->set_actual_size(actual_size); - } return ::grpc::Status::OK; } } @@ -773,10 +841,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 size_out {}; auto status = library_->GetArraySizeForCustomCode(vi, &size_out); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_size_out(size_out); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -797,10 +867,10 @@ namespace nifake_grpc { while (true) { auto status = library_->GetArrayUsingIviDance(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 array_size = status; response->mutable_array_out()->Resize(array_size, 0); @@ -810,9 +880,11 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -834,11 +906,13 @@ namespace nifake_grpc { ViInt32 array_len = request->array_len(); std::string u_int8_enum_array(array_len, '\0'); auto status = library_->GetArrayViUInt8WithEnum(vi, array_len, (ViUInt8*)u_int8_enum_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { CopyBytesToEnums(u_int8_enum_array, response->mutable_u_int8_enum_array()); response->set_u_int8_enum_array_raw(u_int8_enum_array); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -860,10 +934,12 @@ namespace nifake_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -885,10 +961,12 @@ namespace nifake_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -910,10 +988,12 @@ namespace nifake_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 attribute_value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -935,10 +1015,12 @@ namespace nifake_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -959,11 +1041,13 @@ namespace nifake_grpc { ViInt32 attribute_id = request->attribute_id(); ViSession session_out {}; auto status = library_->GetAttributeViSession(vi, attribute_id, &session_out); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(session_out); response->mutable_session_out()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -986,10 +1070,10 @@ namespace nifake_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string attribute_value; @@ -1001,11 +1085,13 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); - } return ::grpc::Status::OK; } } @@ -1031,14 +1117,16 @@ namespace nifake_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetCalDateAndTime(vi, cal_type, &month, &day, &year, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_month(month); response->set_day(day); response->set_year(year); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1058,10 +1146,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 months {}; auto status = library_->GetCalInterval(vi, &months); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_months(months); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1081,10 +1171,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); CustomStruct cs {}; auto status = library_->GetCustomType(vi, &cs); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(cs, response->mutable_cs()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1105,10 +1197,12 @@ namespace nifake_grpc { ViInt32 number_of_elements = request->number_of_elements(); std::vector cs(number_of_elements, CustomStruct()); auto status = library_->GetCustomTypeArray(vi, number_of_elements, cs.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(cs, response->mutable_cs()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1129,12 +1223,14 @@ namespace nifake_grpc { ViInt32 a_quantity {}; ViInt16 a_turtle {}; auto status = library_->GetEnumValue(vi, &a_quantity, &a_turtle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_quantity(a_quantity); response->set_a_turtle(static_cast(a_turtle)); response->set_a_turtle_raw(a_turtle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1154,10 +1250,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViUInt8 a_uint8_number {}; auto status = library_->GetViUInt8(vi, &a_uint8_number); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_uint8_number(a_uint8_number); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1179,9 +1277,11 @@ namespace nifake_grpc { response->mutable_int32_array()->Resize(array_len, 0); ViInt32* int32_array = reinterpret_cast(response->mutable_int32_array()->mutable_data()); auto status = library_->GetViInt32Array(vi, array_len, int32_array); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1203,9 +1303,11 @@ namespace nifake_grpc { response->mutable_u_int32_array()->Resize(array_len, 0); ViUInt32* u_int32_array = reinterpret_cast(response->mutable_u_int32_array()->mutable_data()); auto status = library_->GetViUInt32Array(vi, array_len, u_int32_array); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1226,6 +1328,10 @@ namespace nifake_grpc { ViInt32 size_in_bytes = static_cast(request->configuration().size()); ViInt8* configuration = (ViInt8*)request->configuration().c_str(); auto status = library_->ImportAttributeConfigurationBuffer(vi, size_in_bytes, configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1256,10 +1362,12 @@ namespace nifake_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1287,10 +1395,12 @@ namespace nifake_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->CloseExtCal(id, 0); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1337,10 +1447,12 @@ namespace nifake_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1384,9 +1496,11 @@ namespace nifake_grpc { response->mutable_output_array_of_fixed_length()->Resize(3, 0); ViReal64* output_array_of_fixed_length = response->mutable_output_array_of_fixed_length()->mutable_data(); auto status = library_->MultipleArrayTypes(vi, output_array_size, output_array, output_array_of_fixed_length, input_array_sizes, input_array_of_floats, input_array_of_integers.data()); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1423,6 +1537,10 @@ namespace nifake_grpc { auto size = size_size_calculation.size; auto status = library_->MultipleArraysSameSize(vi, values1, values2, values3, values4, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1470,6 +1588,10 @@ namespace nifake_grpc { auto size = size_size_calculation.size; auto status = library_->MultipleArraysSameSizeWithOptional(vi, values1, values2, values3, values4, values5.data(), size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1490,6 +1612,10 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 a_number = request->a_number(); auto status = library_->OneInputFunction(vi, a_number); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1551,6 +1677,10 @@ namespace nifake_grpc { ViInt32 string_size = static_cast(request->a_string().size()); auto a_string = request->a_string().c_str(); auto status = library_->ParametersAreMultipleTypes(vi, a_boolean, an_int32, an_int64, an_int_enum, a_float, a_float_enum, string_size, a_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1570,6 +1700,10 @@ namespace nifake_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PoorlyNamedSimpleFunction(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1591,10 +1725,12 @@ namespace nifake_grpc { ViReal64 maximum_time = request->maximum_time(); ViReal64 reading {}; auto status = library_->Read(vi, maximum_time, &reading); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_reading(reading); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1613,10 +1749,10 @@ namespace nifake_grpc { ViInt32 buffer_size {}; while (true) { auto status = library_->ReadDataWithInOutIviTwist(nullptr, &buffer_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->mutable_data()->Resize(buffer_size, 0); ViInt32* data = reinterpret_cast(response->mutable_data()->mutable_data()); status = library_->ReadDataWithInOutIviTwist(data, &buffer_size); @@ -1624,11 +1760,13 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_data()->Resize(buffer_size, 0); response->set_buffer_size(buffer_size); - } return ::grpc::Status::OK; } } @@ -1649,10 +1787,10 @@ namespace nifake_grpc { ViInt32 other_actual_size {}; while (true) { auto status = library_->ReadDataWithMultpleIviTwistParamSets(0, nullptr, &actual_size, 0, nullptr, &other_actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->mutable_array_out()->Resize(actual_size, 0); ViInt32* array_out = reinterpret_cast(response->mutable_array_out()->mutable_data()); response->mutable_other_array_out()->Resize(other_actual_size, 0); @@ -1664,13 +1802,15 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_array_out()->Resize(actual_size, 0); response->set_actual_size(actual_size); response->mutable_other_array_out()->Resize(other_actual_size, 0); response->set_other_actual_size(other_actual_size); - } return ::grpc::Status::OK; } } @@ -1693,10 +1833,12 @@ namespace nifake_grpc { ViInt32 maximum_time = request->maximum_time(); ViReal64 reading {}; auto status = library_->ReadFromChannel(vi, channel_name, maximum_time, &reading); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_reading(reading); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1717,12 +1859,14 @@ namespace nifake_grpc { ViInt16 a_number {}; std::string a_string(256 - 1, '\0'); auto status = library_->ReturnANumberAndAString(vi, &a_number, (ViChar*)a_string.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_number(a_number); response->set_a_string(a_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1742,10 +1886,12 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 timedelta {}; auto status = library_->ReturnDurationInSeconds(vi, &timedelta); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_timedelta(timedelta); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1767,9 +1913,11 @@ namespace nifake_grpc { response->mutable_timedeltas()->Resize(number_of_elements, 0); ViReal64* timedeltas = response->mutable_timedeltas()->mutable_data(); auto status = library_->ReturnListOfDurationsInSeconds(vi, number_of_elements, timedeltas); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1791,10 +1939,10 @@ namespace nifake_grpc { while (true) { auto status = library_->ReturnMultipleTypes(vi, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 string_size = status; ViBoolean a_boolean {}; @@ -1814,8 +1962,11 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_a_boolean(a_boolean); response->set_an_int32(an_int32); response->set_an_int64(an_int64); @@ -1829,7 +1980,6 @@ namespace nifake_grpc { response->set_a_float_enum_raw(a_float_enum); response->set_a_string(a_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); - } return ::grpc::Status::OK; } } @@ -1850,6 +2000,10 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto cs = convert_from_grpc(request->cs()); auto status = library_->SetCustomType(vi, cs); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1871,6 +2025,10 @@ namespace nifake_grpc { ViInt32 number_of_elements = static_cast(request->cs().size()); auto cs = convert_from_grpc(request->cs()); auto status = library_->SetCustomTypeArray(vi, number_of_elements, cs.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1910,6 +2068,10 @@ namespace nifake_grpc { } auto status = library_->StringValuedEnumInputFunctionWithDefaults(vi, a_mobile_os_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1931,6 +2093,10 @@ namespace nifake_grpc { ViReal64 a_number = request->a_number(); ViString a_string = (ViString)request->a_string().c_str(); auto status = library_->TwoInputFunction(vi, a_number, a_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1952,10 +2118,12 @@ namespace nifake_grpc { ViInt64 input = request->input(); ViInt64 output {}; auto status = library_->Use64BitNumber(vi, input, &output); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_output(output); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1976,6 +2144,10 @@ namespace nifake_grpc { ViInt32 number_of_samples = static_cast(request->waveform().size()); auto waveform = const_cast(request->waveform().data()); auto status = library_->WriteWaveform(vi, number_of_samples, waveform); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1996,6 +2168,10 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2017,6 +2193,10 @@ namespace nifake_grpc { ViInt32 action = request->action(); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->CloseExtCal(vi, action); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2038,6 +2218,10 @@ namespace nifake_grpc { ViInt32 number_of_elements = request->number_of_elements(); ViUInt8* an_array = (ViUInt8*)request->an_array().c_str(); auto status = library_->ViUInt8ArrayInputFunction(vi, number_of_elements, an_array); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2059,10 +2243,12 @@ namespace nifake_grpc { ViInt32 number_of_elements = request->number_of_elements(); std::string an_array(number_of_elements, '\0'); auto status = library_->ViUInt8ArrayOutputFunction(vi, number_of_elements, (ViUInt8*)an_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_an_array(an_array); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2089,6 +2275,10 @@ namespace nifake_grpc { std::back_inserter(an_array), [](auto x) { return (ViInt16)x; }); auto status = library_->ViInt16ArrayInputFunction(vi, number_of_elements, an_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifake/nifake_service.h b/generated/nifake/nifake_service.h index 25975dffc..7827264a4 100644 --- a/generated/nifake/nifake_service.h +++ b/generated/nifake/nifake_service.h @@ -115,6 +115,7 @@ class NiFakeService final : public NiFake::Service { private: NiFakeLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); void Copy(const std::vector& input, google::protobuf::RepeatedField* output); template void CopyBytesToEnums(const std::string& input, google::protobuf::RepeatedField* output); diff --git a/generated/nifake_extension/nifake_extension_service.cpp b/generated/nifake_extension/nifake_extension_service.cpp index 3c7692c13..d9f81b9e8 100644 --- a/generated/nifake_extension/nifake_extension_service.cpp +++ b/generated/nifake_extension/nifake_extension_service.cpp @@ -53,6 +53,10 @@ namespace nifake_extension_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 param = request->param(); auto status = library_->AddCoolFunctionality(vi, param); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifake_extension/nifake_extension_service.h b/generated/nifake_extension/nifake_extension_service.h index 56b8da097..42e844625 100644 --- a/generated/nifake_extension/nifake_extension_service.h +++ b/generated/nifake_extension/nifake_extension_service.h @@ -45,6 +45,7 @@ class NiFakeExtensionService final : public NiFakeExtension::Service { private: NiFakeExtensionLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); NiFakeExtensionFeatureToggles feature_toggles_; }; diff --git a/generated/nifake_non_ivi/nifake_non_ivi_service.cpp b/generated/nifake_non_ivi/nifake_non_ivi_service.cpp index 1dc04cbf6..f01d96907 100644 --- a/generated/nifake_non_ivi/nifake_non_ivi_service.cpp +++ b/generated/nifake_non_ivi/nifake_non_ivi_service.cpp @@ -63,6 +63,10 @@ namespace nifake_non_ivi_grpc { FakeHandle handle = session_repository_->access_session(handle_grpc_session.id(), handle_grpc_session.name()); session_repository_->remove_session(handle_grpc_session.id(), handle_grpc_session.name()); auto status = library_->Close(handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -83,6 +87,10 @@ namespace nifake_non_ivi_grpc { SecondarySessionHandle secondary_session_handle = secondary_session_handle_resource_repository_->access_session(secondary_session_handle_grpc_session.id(), secondary_session_handle_grpc_session.name()); secondary_session_handle_resource_repository_->remove_session(secondary_session_handle_grpc_session.id(), secondary_session_handle_grpc_session.name()); auto status = library_->CloseSecondarySession(secondary_session_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForSecondarySessionHandle(status, secondary_session_handle); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -133,10 +141,10 @@ namespace nifake_non_ivi_grpc { while (true) { auto status = library_->GetLatestErrorMessage(nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + uInt32 size = status; std::string message; @@ -148,11 +156,13 @@ namespace nifake_non_ivi_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_message(message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_message())); - } return ::grpc::Status::OK; } } @@ -172,11 +182,13 @@ namespace nifake_non_ivi_grpc { std::string buf(512 - 1, '\0'); auto string_out = library_->GetStringAsReturnedValue((char*)buf.data()); auto status = string_out ? 0 : -1; + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_string_out(string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -215,10 +227,12 @@ namespace nifake_non_ivi_grpc { double value {}; auto status = library_->GetMarbleAttributeDouble(handle, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -257,8 +271,11 @@ namespace nifake_non_ivi_grpc { int32 value {}; auto status = library_->GetMarbleAttributeInt32(handle, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -266,7 +283,6 @@ namespace nifake_non_ivi_grpc { }; response->set_value(checked_convert_value(value)); response->set_value_raw(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -306,8 +322,11 @@ namespace nifake_non_ivi_grpc { response->mutable_value_raw()->Resize(10, 0); int32* value = reinterpret_cast(response->mutable_value_raw()->mutable_data()); auto status = library_->GetMarbleAttributeInt32Array(handle, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -322,7 +341,6 @@ namespace nifake_non_ivi_grpc { [&](auto x) { return checked_convert_value(x); }); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -349,14 +367,12 @@ namespace nifake_non_ivi_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_handle()->set_id(session_id); - } - else { - const auto error_message = get_last_error(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -384,10 +400,12 @@ namespace nifake_non_ivi_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_handle()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -421,10 +439,12 @@ namespace nifake_non_ivi_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_handle()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -450,10 +470,12 @@ namespace nifake_non_ivi_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (SecondarySessionHandle id) { library_->CloseSecondarySession(id); }; int status = secondary_session_handle_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_secondary_session_handle()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -480,10 +502,12 @@ namespace nifake_non_ivi_grpc { const std::string& grpc_device_session_name = request->handle_name(); auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_handle()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -510,10 +534,12 @@ namespace nifake_non_ivi_grpc { const std::string& grpc_device_session_name = request->handle_name(); auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_handle()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -584,6 +610,10 @@ namespace nifake_non_ivi_grpc { }); auto status = library_->InputArraysWithNarrowIntegerTypes(u16_array.data(), i16_array.data(), i8_array.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -608,9 +638,11 @@ namespace nifake_non_ivi_grpc { response->mutable_data()->Resize((size_one < 0) ? size_two : size_one + 1, 0); int32* data = reinterpret_cast(response->mutable_data()->mutable_data()); auto status = library_->IotaWithCustomSize(size_one, size_two, data); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -633,8 +665,11 @@ namespace nifake_non_ivi_grpc { std::vector i16_data(number_of_i16_samples); std::vector i8_data(number_of_i8_samples); auto status = library_->OutputArraysWithNarrowIntegerTypes(number_of_u16_samples, u16_data.data(), number_of_i16_samples, i16_data.data(), number_of_i8_samples, i8_data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_u16_data()->Clear(); response->mutable_u16_data()->Reserve(number_of_u16_samples); std::transform( @@ -662,7 +697,6 @@ namespace nifake_non_ivi_grpc { [&](auto x) { return x; }); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -680,6 +714,10 @@ namespace nifake_non_ivi_grpc { try { const myUInt8* u8_array = (const myUInt8*)request->u8_array().c_str(); auto status = library_->InputArrayOfBytes(u8_array); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -699,10 +737,12 @@ namespace nifake_non_ivi_grpc { int32 number_of_u8_samples = request->number_of_u8_samples(); std::string u8_data(number_of_u8_samples, '\0'); auto status = library_->OutputArrayOfBytes(number_of_u8_samples, (myUInt8*)u8_data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_u8_data(u8_data); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -723,8 +763,11 @@ namespace nifake_non_ivi_grpc { int32* i32_data = reinterpret_cast(response->mutable_i32_data()->mutable_data()); std::vector u16_data(array_size_copy); auto status = library_->OutputArraysWithPassedInByPtrMechanism(i32_data, u16_data.data(), &array_size_copy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_i32_data()->Resize(array_size_copy, 0); response->mutable_u16_data()->Clear(); response->mutable_u16_data()->Reserve(array_size_copy); @@ -735,7 +778,6 @@ namespace nifake_non_ivi_grpc { [&](auto x) { return x; }); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -807,6 +849,10 @@ namespace nifake_non_ivi_grpc { try { auto when = convert_from_grpc(request->when()); auto status = library_->InputTimestamp(when); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -825,10 +871,12 @@ namespace nifake_non_ivi_grpc { try { CVIAbsoluteTime when {}; auto status = library_->OutputTimestamp(&when); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(when, response->mutable_when()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -872,6 +920,10 @@ namespace nifake_non_ivi_grpc { } auto status = library_->InputVarArgs(input_name, get_channelName_if(string_and_enums, 0), get_color_if(string_and_enums, 0), get_powerUpState_if(string_and_enums, 0), get_channelName_if(string_and_enums, 1), get_color_if(string_and_enums, 1), get_powerUpState_if(string_and_enums, 1), get_channelName_if(string_and_enums, 2), get_color_if(string_and_enums, 2), get_powerUpState_if(string_and_enums, 2), get_channelName_if(string_and_enums, 3), get_color_if(string_and_enums, 3), get_powerUpState_if(string_and_enums, 3)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -912,12 +964,14 @@ namespace nifake_non_ivi_grpc { std::vector colorVector; colorVector.resize(channel_names.size()); auto status = library_->OutputVarArgs(input_name, get_channelName_if(channel_names, 0), get_color_if(colorVector, 0), get_channelName_if(channel_names, 1), get_color_if(colorVector, 1), get_channelName_if(channel_names, 2), get_color_if(colorVector, 2), get_channelName_if(channel_names, 3), get_color_if(colorVector, 3)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { for (int i = 0; i < colorVector.size(); ++i) { response->add_colors(static_cast(colorVector[i])); } - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -955,6 +1009,10 @@ namespace nifake_non_ivi_grpc { } auto status = library_->ResetMarbleAttribute(handle, attribute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1002,6 +1060,10 @@ namespace nifake_non_ivi_grpc { auto i8 = static_cast(i8_raw); auto status = library_->ScalarsWithNarrowIntegerTypes(u16, i16, i8); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1044,6 +1106,10 @@ namespace nifake_non_ivi_grpc { double value = request->value(); auto status = library_->SetMarbleAttributeDouble(handle, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1098,6 +1164,10 @@ namespace nifake_non_ivi_grpc { } auto status = library_->SetMarbleAttributeInt32(handle, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, handle); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1125,6 +1195,10 @@ namespace nifake_non_ivi_grpc { int32 size = request->size(); auto status = library_->SetColors(colors, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1144,10 +1218,12 @@ namespace nifake_non_ivi_grpc { int32 number_of_structs = request->number_of_structs(); std::vector structs(number_of_structs, StructWithCoercion_struct()); auto status = library_->GetStructsWithCoercion(number_of_structs, structs.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(structs, response->mutable_structs()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1165,6 +1241,10 @@ namespace nifake_non_ivi_grpc { try { auto structs = convert_from_grpc(request->structs()); auto status = library_->SetStructsWithCoercion(structs.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1205,6 +1285,10 @@ namespace nifake_non_ivi_grpc { } auto status = library_->InputStringValuedEnum(a_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1224,6 +1308,10 @@ namespace nifake_non_ivi_grpc { auto bools = convert_from_grpc(request->bools()); int32 size = static_cast(request->bools().size()); auto status = library_->WriteBooleanArray(bools.data(), size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifake_non_ivi/nifake_non_ivi_service.h b/generated/nifake_non_ivi/nifake_non_ivi_service.h index 2f490d4ac..8b51bbf6e 100644 --- a/generated/nifake_non_ivi/nifake_non_ivi_service.h +++ b/generated/nifake_non_ivi/nifake_non_ivi_service.h @@ -86,6 +86,8 @@ class NiFakeNonIviService final : public NiFakeNonIvi::WithCallbackMethod_ReadSt ResourceRepositorySharedPtr session_repository_; SecondarySessionHandleResourceRepositorySharedPtr secondary_session_handle_resource_repository_; FakeCrossDriverHandleResourceRepositorySharedPtr fake_cross_driver_handle_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForFakeHandle(google::protobuf::int32 status, FakeHandle handle); + ::grpc::Status ConvertApiErrorStatusForSecondarySessionHandle(google::protobuf::int32 status, SecondarySessionHandle handle); std::map mobileosnames_input_map_ { {1, "Android"},{2, "iOS"},{3, "None"}, }; std::map mobileosnames_output_map_ { {"Android", 1},{"iOS", 2},{"None", 3}, }; diff --git a/generated/nifgen/nifgen_service.cpp b/generated/nifgen/nifgen_service.cpp index 394a1c163..7bc7eb989 100644 --- a/generated/nifgen/nifgen_service.cpp +++ b/generated/nifgen/nifgen_service.cpp @@ -56,6 +56,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AbortGeneration(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -76,6 +80,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 adjustment_time = request->adjustment_time(); auto status = library_->AdjustSampleClockRelativeDelay(vi, adjustment_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -98,6 +106,10 @@ namespace nifgen_grpc { auto waveform_name = request->waveform_name().c_str(); ViInt32 waveform_size = request->waveform_size(); auto status = library_->AllocateNamedWaveform(vi, channel_name, waveform_name, waveform_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -120,10 +132,12 @@ namespace nifgen_grpc { ViInt32 waveform_size = request->waveform_size(); ViInt32 waveform_handle {}; auto status = library_->AllocateWaveform(vi, channel_name, waveform_size, &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -145,6 +159,10 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -182,6 +200,10 @@ namespace nifgen_grpc { } auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -204,6 +226,10 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 attribute_value = request->attribute_value_raw(); auto status = library_->CheckAttributeViInt64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -241,6 +267,10 @@ namespace nifgen_grpc { } auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -264,6 +294,10 @@ namespace nifgen_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -286,6 +320,10 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); auto attribute_value = request->attribute_value_raw().c_str(); auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -305,6 +343,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearArbMemory(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -340,6 +382,10 @@ namespace nifgen_grpc { } auto status = library_->ClearArbSequence(vi, sequence_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -375,6 +421,10 @@ namespace nifgen_grpc { } auto status = library_->ClearArbWaveform(vi, waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -394,6 +444,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -429,6 +483,10 @@ namespace nifgen_grpc { } auto status = library_->ClearFreqList(vi, frequency_list_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -448,6 +506,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -468,6 +530,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->ClearUserStandardWaveform(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -488,6 +554,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -507,6 +577,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -528,6 +602,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 amplitude = request->amplitude(); auto status = library_->ConfigureAmplitude(vi, channel_name, amplitude); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -551,6 +629,10 @@ namespace nifgen_grpc { ViReal64 gain = request->gain(); ViReal64 offset = request->offset(); auto status = library_->ConfigureArbSequence(vi, channel_name, sequence_handle, gain, offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -574,6 +656,10 @@ namespace nifgen_grpc { ViReal64 gain = request->gain(); ViReal64 offset = request->offset(); auto status = library_->ConfigureArbWaveform(vi, channel_name, waveform_handle, gain, offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -594,6 +680,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channels = request->channels().c_str(); auto status = library_->ConfigureChannels(vi, channels); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -629,6 +719,10 @@ namespace nifgen_grpc { } auto status = library_->ConfigureClockMode(vi, clock_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -651,6 +745,10 @@ namespace nifgen_grpc { ViInt32 number_of_coefficients = static_cast(request->coefficients_array().size()); auto coefficients_array = const_cast(request->coefficients_array().data()); auto status = library_->ConfigureCustomFIRFilterCoefficients(vi, channel_name, number_of_coefficients, coefficients_array); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -673,6 +771,10 @@ namespace nifgen_grpc { auto source = request->source().c_str(); ViInt32 edge = request->edge(); auto status = library_->ConfigureDigitalEdgeScriptTrigger(vi, trigger_id, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -694,6 +796,10 @@ namespace nifgen_grpc { auto source = request->source().c_str(); ViInt32 edge = request->edge(); auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -731,6 +837,10 @@ namespace nifgen_grpc { } auto status = library_->ConfigureDigitalLevelScriptTrigger(vi, trigger_id, source, trigger_when); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -755,6 +865,10 @@ namespace nifgen_grpc { ViReal64 dc_offset = request->dc_offset(); ViReal64 start_phase = request->start_phase(); auto status = library_->ConfigureFreqList(vi, channel_name, frequency_list_handle, amplitude, dc_offset, start_phase); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -776,6 +890,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 frequency = request->frequency(); auto status = library_->ConfigureFrequency(vi, channel_name, frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -797,6 +915,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViInt32 operation_mode = request->operation_mode(); auto status = library_->ConfigureOperationMode(vi, channel_name, operation_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -818,6 +940,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViBoolean enabled = request->enabled(); auto status = library_->ConfigureOutputEnabled(vi, channel_name, enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -839,6 +965,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 impedance = request->impedance(); auto status = library_->ConfigureOutputImpedance(vi, channel_name, impedance); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -874,6 +1004,10 @@ namespace nifgen_grpc { } auto status = library_->ConfigureOutputMode(vi, output_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -894,6 +1028,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 p2p_endpoint_fullness_level = request->p2p_endpoint_fullness_level(); auto status = library_->ConfigureP2PEndpointFullnessStartTrigger(vi, p2p_endpoint_fullness_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -915,6 +1053,10 @@ namespace nifgen_grpc { auto reference_clock_source = request->reference_clock_source().c_str(); ViReal64 reference_clock_frequency = request->reference_clock_frequency(); auto status = library_->ConfigureReferenceClock(vi, reference_clock_source, reference_clock_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -935,6 +1077,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto sample_clock_source = request->sample_clock_source().c_str(); auto status = library_->ConfigureSampleClockSource(vi, sample_clock_source); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -955,6 +1101,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 sample_rate = request->sample_rate(); auto status = library_->ConfigureSampleRate(vi, sample_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -975,6 +1125,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto trigger_id = request->trigger_id().c_str(); auto status = library_->ConfigureSoftwareEdgeScriptTrigger(vi, trigger_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -994,6 +1148,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1034,6 +1192,10 @@ namespace nifgen_grpc { ViReal64 frequency = request->frequency(); ViReal64 start_phase = request->start_phase(); auto status = library_->ConfigureStandardWaveform(vi, channel_name, waveform, amplitude, dc_offset, frequency, start_phase); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1055,6 +1217,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViInt32 synchronization_source = request->synchronization_source(); auto status = library_->ConfigureSynchronization(vi, channel_name, synchronization_source); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1091,6 +1257,10 @@ namespace nifgen_grpc { } auto status = library_->ConfigureTriggerMode(vi, channel_name, trigger_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1125,10 +1295,12 @@ namespace nifgen_grpc { auto loop_counts_array = const_cast(reinterpret_cast(request->loop_counts_array().data())); ViInt32 sequence_handle {}; auto status = library_->CreateArbSequence(vi, sequence_length, waveform_handles_array, loop_counts_array, &sequence_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_sequence_handle(sequence_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1178,10 +1350,12 @@ namespace nifgen_grpc { auto duration_array = const_cast(request->duration_array().data()); ViInt32 frequency_list_handle {}; auto status = library_->CreateFreqList(vi, waveform, frequency_list_length, frequency_array, duration_array, &frequency_list_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency_list_handle(frequency_list_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1204,10 +1378,12 @@ namespace nifgen_grpc { auto waveform_data_array = convert_from_grpc(request->waveform_data_array()); ViInt32 waveform_handle {}; auto status = library_->CreateWaveformComplexF64(vi, channel_name, number_of_samples, waveform_data_array.data(), &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1230,10 +1406,12 @@ namespace nifgen_grpc { auto waveform_data_array = const_cast(request->waveform_data_array().data()); ViInt32 waveform_handle {}; auto status = library_->CreateWaveformF64(vi, channel_name, waveform_size, waveform_data_array, &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1271,10 +1449,12 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformFromFileF64(vi, channel_name, file_name, byte_order, &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1298,10 +1478,12 @@ namespace nifgen_grpc { ViBoolean use_gain_and_offset_from_waveform = request->use_gain_and_offset_from_waveform(); ViInt32 waveform_handle {}; auto status = library_->CreateWaveformFromFileHWS(vi, channel_name, file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform, &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1330,10 +1512,12 @@ namespace nifgen_grpc { [](auto x) { return (ViInt16)x; }); ViInt32 waveform_handle {}; auto status = library_->CreateWaveformI16(vi, channel_name, waveform_size, waveform_data_array.data(), &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1371,10 +1555,12 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformFromFileI16(vi, channel_name, file_name, byte_order, &waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_handle(waveform_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1396,6 +1582,10 @@ namespace nifgen_grpc { ViInt32 waveform_size = static_cast(request->waveform_data_array().size()); auto waveform_data_array = const_cast(request->waveform_data_array().data()); auto status = library_->DefineUserStandardWaveform(vi, channel_name, waveform_size, waveform_data_array); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1417,6 +1607,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto waveform_name = request->waveform_name().c_str(); auto status = library_->DeleteNamedWaveform(vi, channel_name, waveform_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1438,6 +1632,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto script_name = request->script_name().c_str(); auto status = library_->DeleteScript(vi, channel_name, script_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1457,6 +1655,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1477,6 +1679,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableAnalogFilter(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1497,6 +1703,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableDigitalFilter(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1517,6 +1727,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->DisableDigitalPatterning(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1537,6 +1751,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto trigger_id = request->trigger_id().c_str(); auto status = library_->DisableScriptTrigger(vi, trigger_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1556,6 +1774,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1577,6 +1799,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViReal64 filter_correction_frequency = request->filter_correction_frequency(); auto status = library_->EnableAnalogFilter(vi, channel_name, filter_correction_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1597,6 +1823,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->EnableDigitalFilter(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1617,6 +1847,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_name = request->channel_name().c_str(); auto status = library_->EnableDigitalPatterning(vi, channel_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1638,11 +1872,13 @@ namespace nifgen_grpc { ViStatus error_code = request->error_code(); std::string error_message(256 - 1, '\0'); auto status = library_->ErrorHandler(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1663,11 +1899,13 @@ namespace nifgen_grpc { ViStatus error_code = request->error_code(); std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1688,12 +1926,14 @@ namespace nifgen_grpc { ViInt32 error_code {}; std::string error_message(256 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1714,10 +1954,10 @@ namespace nifgen_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 size_in_bytes = status; response->mutable_configuration()->Resize(size_in_bytes, 0); @@ -1727,9 +1967,11 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { - } return ::grpc::Status::OK; } } @@ -1750,6 +1992,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1787,6 +2033,10 @@ namespace nifgen_grpc { auto signal_identifier = request->signal_identifier().c_str(); auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1809,10 +2059,12 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1834,10 +2086,12 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1859,10 +2113,12 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 attribute_value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1884,10 +2140,12 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1909,11 +2167,13 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1936,10 +2196,10 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 array_size = status; std::string attribute_value; @@ -1951,11 +2211,13 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); - } return ::grpc::Status::OK; } } @@ -1978,10 +2240,10 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string channel_string; @@ -1993,11 +2255,13 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_channel_string(channel_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); - } return ::grpc::Status::OK; } } @@ -2019,10 +2283,10 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -2035,12 +2299,14 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -2065,14 +2331,16 @@ namespace nifgen_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2092,10 +2360,12 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->GetExtCalLastTemp(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2115,10 +2385,12 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_months(months); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2140,10 +2412,10 @@ namespace nifgen_grpc { ViInt32 number_of_coefficients_read {}; while (true) { auto status = library_->GetFIRFilterCoefficients(vi, channel_name, 0, nullptr, &number_of_coefficients_read); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_coefficients_array()->Resize(number_of_coefficients_read, 0); ViReal64* coefficients_array = response->mutable_coefficients_array()->mutable_data(); auto array_size = number_of_coefficients_read; @@ -2152,11 +2424,13 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_coefficients_array()->Resize(number_of_coefficients_read, 0); response->set_number_of_coefficients_read(number_of_coefficients_read); - } return ::grpc::Status::OK; } } @@ -2177,11 +2451,13 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 state {}; auto status = library_->GetHardwareState(vi, &state); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_state(static_cast(state)); response->set_state_raw(state); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2202,10 +2478,10 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string coercion_record; @@ -2217,11 +2493,13 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); - } return ::grpc::Status::OK; } } @@ -2243,10 +2521,10 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string interchange_warning; @@ -2258,11 +2536,13 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); - } return ::grpc::Status::OK; } } @@ -2287,14 +2567,16 @@ namespace nifgen_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2314,10 +2596,12 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->GetSelfCalLastTemp(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2337,10 +2621,12 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean self_cal_supported {}; auto status = library_->GetSelfCalSupported(vi, &self_cal_supported); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_cal_supported(self_cal_supported); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2361,10 +2647,12 @@ namespace nifgen_grpc { auto stream_endpoint = request->stream_endpoint().c_str(); ViUInt32 reader_handle {}; auto status = library_->GetStreamEndpointHandle(vi, stream_endpoint, &reader_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_reader_handle(reader_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2385,6 +2673,10 @@ namespace nifgen_grpc { ViInt32 size_in_bytes = static_cast(request->configuration().size()); auto configuration = const_cast(reinterpret_cast(request->configuration().data())); auto status = library_->ImportAttributeConfigurationBuffer(vi, size_in_bytes, configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2405,6 +2697,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2434,14 +2730,12 @@ namespace nifgen_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2471,14 +2765,12 @@ namespace nifgen_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2508,14 +2800,12 @@ namespace nifgen_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2534,6 +2824,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InitiateGeneration(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2553,6 +2847,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2573,10 +2871,12 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean done {}; auto status = library_->IsDone(vi, &done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_done(done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2596,6 +2896,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto endpoint_name = request->endpoint_name().c_str(); auto status = library_->ManualEnableP2PStream(vi, endpoint_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2619,13 +2923,15 @@ namespace nifgen_grpc { ViInt32 maximum_sequence_length {}; ViInt32 maximum_loop_count {}; auto status = library_->QueryArbSeqCapabilities(vi, &maximum_number_of_sequences, &minimum_sequence_length, &maximum_sequence_length, &maximum_loop_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_maximum_number_of_sequences(maximum_number_of_sequences); response->set_minimum_sequence_length(minimum_sequence_length); response->set_maximum_sequence_length(maximum_sequence_length); response->set_maximum_loop_count(maximum_loop_count); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2648,13 +2954,15 @@ namespace nifgen_grpc { ViInt32 minimum_waveform_size {}; ViInt32 maximum_waveform_size {}; auto status = library_->QueryArbWfmCapabilities(vi, &maximum_number_of_waveforms, &waveform_quantum, &minimum_waveform_size, &maximum_waveform_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_maximum_number_of_waveforms(maximum_number_of_waveforms); response->set_waveform_quantum(waveform_quantum); response->set_minimum_waveform_size(minimum_waveform_size); response->set_maximum_waveform_size(maximum_waveform_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2679,15 +2987,17 @@ namespace nifgen_grpc { ViReal64 maximum_frequency_list_duration {}; ViReal64 frequency_list_duration_quantum {}; auto status = library_->QueryFreqListCapabilities(vi, &maximum_number_of_freq_lists, &minimum_frequency_list_length, &maximum_frequency_list_length, &minimum_frequency_list_duration, &maximum_frequency_list_duration, &frequency_list_duration_quantum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_maximum_number_of_freq_lists(maximum_number_of_freq_lists); response->set_minimum_frequency_list_length(minimum_frequency_list_length); response->set_maximum_frequency_list_length(maximum_frequency_list_length); response->set_minimum_frequency_list_duration(minimum_frequency_list_duration); response->set_maximum_frequency_list_duration(maximum_frequency_list_duration); response->set_frequency_list_duration_quantum(frequency_list_duration_quantum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2707,10 +3017,12 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->ReadCurrentTemperature(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2729,6 +3041,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2750,6 +3066,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2769,6 +3089,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2788,6 +3112,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2807,6 +3135,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2828,13 +3160,15 @@ namespace nifgen_grpc { std::string instrument_driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2886,6 +3220,10 @@ namespace nifgen_grpc { } auto status = library_->RouteSignalOut(vi, channel_name, route_signal_from, route_signal_to); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2905,6 +3243,10 @@ namespace nifgen_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2926,12 +3268,14 @@ namespace nifgen_grpc { ViInt16 self_test_result {}; std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2967,6 +3311,10 @@ namespace nifgen_grpc { ViString trigger_id = (ViString)request->trigger_id().c_str(); auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2989,6 +3337,10 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3026,6 +3378,10 @@ namespace nifgen_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3048,6 +3404,10 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 attribute_value = request->attribute_value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3085,6 +3445,10 @@ namespace nifgen_grpc { } auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3108,6 +3472,10 @@ namespace nifgen_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3130,6 +3498,10 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); auto attribute_value = request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3168,6 +3540,10 @@ namespace nifgen_grpc { ViInt32 offset = request->offset(); auto status = library_->SetNamedWaveformNextWritePosition(vi, channel_name, waveform_name, relative_to, offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3206,6 +3582,10 @@ namespace nifgen_grpc { ViInt32 offset = request->offset(); auto status = library_->SetWaveformNextWritePosition(vi, channel_name, waveform_handle, relative_to, offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3226,6 +3606,10 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 max_time = request->max_time(); auto status = library_->WaitUntilDone(vi, max_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3255,6 +3639,10 @@ namespace nifgen_grpc { std::back_inserter(data), [](auto x) { return (ViInt16)x; }); auto status = library_->WriteBinary16Waveform(vi, channel_name, waveform_handle, size, data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3278,6 +3666,10 @@ namespace nifgen_grpc { ViInt32 size = static_cast(request->data().size()); auto data = convert_from_grpc(request->data()); auto status = library_->WriteComplexBinary16Waveform(vi, channel_name, waveform_handle, size, data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3301,6 +3693,10 @@ namespace nifgen_grpc { ViInt32 size = static_cast(request->data().size()); auto data = const_cast(request->data().data()); auto status = library_->WriteNamedWaveformF64(vi, channel_name, waveform_name, size, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3330,6 +3726,10 @@ namespace nifgen_grpc { std::back_inserter(data), [](auto x) { return (ViInt16)x; }); auto status = library_->WriteNamedWaveformI16(vi, channel_name, waveform_name, size, data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3358,6 +3758,10 @@ namespace nifgen_grpc { std::back_inserter(endpoint_data), [](auto x) { return (ViInt16)x; }); auto status = library_->WriteP2PEndpointI16(vi, endpoint_name, number_of_samples, endpoint_data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3379,6 +3783,10 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto script = request->script().c_str(); auto status = library_->WriteScript(vi, channel_name, script); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3402,6 +3810,10 @@ namespace nifgen_grpc { ViInt32 size = static_cast(request->data().size()); auto data = const_cast(request->data().data()); auto status = library_->WriteWaveform(vi, channel_name, waveform_handle, size, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3425,6 +3837,10 @@ namespace nifgen_grpc { auto data = convert_from_grpc(request->data()); ViInt32 waveform_handle = request->waveform_handle(); auto status = library_->WriteWaveformComplexF64(vi, channel_name, number_of_samples, data.data(), waveform_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3448,6 +3864,10 @@ namespace nifgen_grpc { ViInt32 size = static_cast(request->data().size()); auto data = convert_from_grpc(request->data()); auto status = library_->WriteNamedWaveformComplexF64(vi, channel_name, waveform_name, size, data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3471,6 +3891,10 @@ namespace nifgen_grpc { ViInt32 size = static_cast(request->data().size()); auto data = convert_from_grpc(request->data()); auto status = library_->WriteNamedWaveformComplexI16(vi, channel_name, waveform_name, size, data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifgen/nifgen_service.h b/generated/nifgen/nifgen_service.h index aaea23d94..e063f7d14 100644 --- a/generated/nifgen/nifgen_service.h +++ b/generated/nifgen/nifgen_service.h @@ -175,6 +175,7 @@ class NiFgenService final : public NiFgen::Service { private: NiFgenLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); NiFgenFeatureToggles feature_toggles_; }; diff --git a/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp b/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp index 9d3574169..b9d568881 100644 --- a/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp +++ b/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp @@ -76,6 +76,10 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -112,6 +116,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->ACPCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -133,6 +141,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_offsets = request->number_of_offsets(); auto status = library_->ACPCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -169,6 +181,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->ACPCfgOffsetChannelMode(instrument, selector_string, offset_channel_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -194,10 +210,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_power()->Resize(actual_array_size, 0); float32* absolute_power = response->mutable_absolute_power()->mutable_data(); auto array_size = actual_array_size; @@ -206,13 +222,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_absolute_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -238,10 +256,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_limit_with_exception_mask()->Resize(actual_array_size, 0); float32* limit_with_exception_mask = response->mutable_limit_with_exception_mask()->mutable_data(); response->mutable_limit_without_exception_mask()->Resize(actual_array_size, 0); @@ -252,14 +270,16 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_limit_with_exception_mask()->Resize(actual_array_size, 0); response->mutable_limit_without_exception_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -282,11 +302,13 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); int32 measurement_status {}; auto status = library_->ACPFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -313,15 +335,17 @@ namespace nirfmxbluetooth_grpc { float64 lower_margin {}; float64 upper_margin {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_absolute_power, &upper_absolute_power, &lower_relative_power, &upper_relative_power, &lower_margin, &upper_margin); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_lower_absolute_power(lower_absolute_power); response->set_upper_absolute_power(upper_absolute_power); response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); response->set_lower_margin(lower_margin); response->set_upper_margin(upper_margin); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -344,10 +368,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); float64* lower_absolute_power = response->mutable_lower_absolute_power()->mutable_data(); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); @@ -366,8 +390,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); response->mutable_lower_relative_power()->Resize(actual_array_size, 0); @@ -375,7 +402,6 @@ namespace nirfmxbluetooth_grpc { response->mutable_lower_margin()->Resize(actual_array_size, 0); response->mutable_upper_margin()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -398,10 +424,12 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); float64 reference_channel_power {}; auto status = library_->ACPFetchReferenceChannelPower(instrument, selector_string, timeout, &reference_channel_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_channel_power(reference_channel_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -426,10 +454,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -438,13 +466,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -465,6 +495,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -492,6 +526,10 @@ namespace nirfmxbluetooth_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -513,6 +551,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->AutoDetectSignal(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -535,10 +577,12 @@ namespace nirfmxbluetooth_grpc { float64 measurement_interval = request->measurement_interval(); float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_level(reference_level); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -559,10 +603,10 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -574,11 +618,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -600,10 +646,10 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -615,11 +661,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -641,10 +689,10 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildSlotString(selector_string, slot_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -656,11 +704,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -682,6 +732,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 channel_number = request->channel_number(); auto status = library_->CfgChannelNumber(instrument, selector_string, channel_number); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -703,6 +757,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 data_rate = request->data_rate(); auto status = library_->CfgDataRate(instrument, selector_string, data_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -742,6 +800,10 @@ namespace nirfmxbluetooth_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -763,6 +825,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -784,6 +850,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -821,6 +891,10 @@ namespace nirfmxbluetooth_grpc { int32 channel_number = request->channel_number(); auto status = library_->CfgFrequencyChannelNumber(instrument, selector_string, standard, channel_number); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -862,6 +936,10 @@ namespace nirfmxbluetooth_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -935,6 +1013,10 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -973,6 +1055,10 @@ namespace nirfmxbluetooth_grpc { float64 cte_length = request->cte_length(); float64 cte_slot_duration = request->cte_slot_duration(); auto status = library_->CfgLEDirectionFinding(instrument, selector_string, direction_finding_mode, cte_length, cte_slot_duration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1010,6 +1096,10 @@ namespace nirfmxbluetooth_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1046,6 +1136,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->CfgPacketType(instrument, selector_string, packet_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1082,6 +1176,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->CfgPayloadBitPattern(instrument, selector_string, payload_bit_pattern); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1119,6 +1217,10 @@ namespace nirfmxbluetooth_grpc { int32 payload_length = request->payload_length(); auto status = library_->CfgPayloadLength(instrument, selector_string, payload_length_mode, payload_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1142,6 +1244,10 @@ namespace nirfmxbluetooth_grpc { float64 reference_level = request->reference_level(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1179,6 +1285,10 @@ namespace nirfmxbluetooth_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1200,6 +1310,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1222,6 +1336,10 @@ namespace nirfmxbluetooth_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1243,10 +1361,12 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1266,6 +1386,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1286,6 +1410,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1307,6 +1435,10 @@ namespace nirfmxbluetooth_grpc { char* old_signal_name = (char*)request->old_signal_name().c_str(); char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1328,6 +1460,10 @@ namespace nirfmxbluetooth_grpc { int32 force_destroy = request->force_destroy(); session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1348,6 +1484,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1368,6 +1508,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1388,6 +1532,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1408,6 +1556,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1445,6 +1597,10 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->FrequencyRangeCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1466,6 +1622,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 span = request->span(); auto status = library_->FrequencyRangeCfgSpan(instrument, selector_string, span); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1489,11 +1649,13 @@ namespace nirfmxbluetooth_grpc { float64 high_frequency {}; float64 low_frequency {}; auto status = library_->FrequencyRangeFetchMeasurement(instrument, selector_string, timeout, &high_frequency, &low_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_high_frequency(high_frequency); response->set_low_frequency(low_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1518,10 +1680,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FrequencyRangeFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1530,13 +1692,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1560,10 +1724,10 @@ namespace nirfmxbluetooth_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -1574,13 +1738,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); response->set_actual_result_names_size(actual_result_names_size); response->set_default_result_exists(default_result_exists); - } return ::grpc::Status::OK; } } @@ -1603,10 +1769,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1629,10 +1797,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -1641,11 +1809,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1668,10 +1838,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1694,10 +1866,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -1706,11 +1878,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1733,10 +1907,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1758,8 +1934,11 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -1767,7 +1946,6 @@ namespace nirfmxbluetooth_grpc { }; response->set_attr_val(checked_convert_attr_val(attr_val)); response->set_attr_val_raw(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1790,10 +1968,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -1802,8 +1980,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -1820,7 +2001,6 @@ namespace nirfmxbluetooth_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1843,10 +2023,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1869,10 +2051,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1881,11 +2063,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1908,10 +2092,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1934,10 +2120,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1945,8 +2131,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -1958,7 +2147,6 @@ namespace nirfmxbluetooth_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1982,10 +2170,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1993,8 +2181,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -2004,7 +2195,6 @@ namespace nirfmxbluetooth_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2028,10 +2218,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2039,8 +2229,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -2050,7 +2243,6 @@ namespace nirfmxbluetooth_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2074,10 +2266,10 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string attr_val; @@ -2089,11 +2281,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); - } return ::grpc::Status::OK; } } @@ -2116,10 +2310,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2141,10 +2337,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2167,10 +2365,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2179,11 +2377,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2207,10 +2407,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2219,11 +2419,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2246,10 +2448,12 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2272,10 +2476,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -2283,12 +2487,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2310,10 +2516,10 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; int32 error_code {}; @@ -2326,12 +2532,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -2354,10 +2562,10 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; std::string error_description; @@ -2369,11 +2577,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -2403,15 +2613,13 @@ namespace nirfmxbluetooth_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXBT_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2439,14 +2647,12 @@ namespace nirfmxbluetooth_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXBT_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2467,6 +2673,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2504,6 +2714,10 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2540,6 +2754,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->ModAccCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2563,10 +2781,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchConstellationTrace(instrument, selector_string, timeout, constellation.data(), array_size, &actual_array_size); @@ -2574,8 +2792,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(constellation, response->mutable_constellation()); { auto shrunk_size = actual_array_size; @@ -2585,7 +2806,6 @@ namespace nirfmxbluetooth_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2610,12 +2830,14 @@ namespace nirfmxbluetooth_grpc { float64 peak_devm_maximum {}; float64 ninetynine_percent_devm {}; auto status = library_->ModAccFetchDEVM(instrument, selector_string, timeout, &peak_rms_devm_maximum, &peak_devm_maximum, &ninetynine_percent_devm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_peak_rms_devm_maximum(peak_rms_devm_maximum); response->set_peak_devm_maximum(peak_devm_maximum); response->set_ninetynine_percent_devm(ninetynine_percent_devm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2638,11 +2860,13 @@ namespace nirfmxbluetooth_grpc { float64 average_rms_magnitude_error_mean {}; float64 peak_rms_magnitude_error_maximum {}; auto status = library_->ModAccFetchDEVMMagnitudeError(instrument, selector_string, timeout, &average_rms_magnitude_error_mean, &peak_rms_magnitude_error_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_rms_magnitude_error_mean(average_rms_magnitude_error_mean); response->set_peak_rms_magnitude_error_maximum(peak_rms_magnitude_error_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2665,10 +2889,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDEVMPerSymbolTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); float32* devm_per_symbol = response->mutable_devm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -2677,11 +2901,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2705,11 +2931,13 @@ namespace nirfmxbluetooth_grpc { float64 average_rms_phase_error_mean {}; float64 peak_rms_phase_error_maximum {}; auto status = library_->ModAccFetchDEVMPhaseError(instrument, selector_string, timeout, &average_rms_phase_error_mean, &peak_rms_phase_error_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_rms_phase_error_mean(average_rms_phase_error_mean); response->set_peak_rms_phase_error_maximum(peak_rms_phase_error_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2732,10 +2960,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDemodulatedBitTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector demodulated_bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchDemodulatedBitTrace(instrument, selector_string, timeout, demodulated_bits.data(), array_size, &actual_array_size); @@ -2743,8 +2971,11 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_demodulated_bits()->Clear(); response->mutable_demodulated_bits()->Reserve(actual_array_size); std::transform( @@ -2756,7 +2987,6 @@ namespace nirfmxbluetooth_grpc { }); response->mutable_demodulated_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2780,11 +3010,13 @@ namespace nirfmxbluetooth_grpc { float64 df1avg_maximum {}; float64 df1avg_minimum {}; auto status = library_->ModAccFetchDf1(instrument, selector_string, timeout, &df1avg_maximum, &df1avg_minimum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_df1avg_maximum(df1avg_maximum); response->set_df1avg_minimum(df1avg_minimum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2807,10 +3039,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDf1maxTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_df1max()->Resize(actual_array_size, 0); @@ -2821,12 +3053,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_time()->Resize(actual_array_size, 0); response->mutable_df1max()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2850,11 +3084,13 @@ namespace nirfmxbluetooth_grpc { float64 df2avg_minimum {}; float64 percentage_of_symbols_above_df2max_threshold {}; auto status = library_->ModAccFetchDf2(instrument, selector_string, timeout, &df2avg_minimum, &percentage_of_symbols_above_df2max_threshold); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_df2avg_minimum(df2avg_minimum); response->set_percentage_of_symbols_above_df2max_threshold(percentage_of_symbols_above_df2max_threshold); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2877,10 +3113,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDf2maxTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_df2max()->Resize(actual_array_size, 0); @@ -2891,12 +3127,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_time()->Resize(actual_array_size, 0); response->mutable_df2max()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2921,12 +3159,14 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_drift_maximum {}; float64 peak_frequency_drift_rate_maximum {}; auto status = library_->ModAccFetchFrequencyErrorBR(instrument, selector_string, timeout, &initial_frequency_error_maximum, &peak_frequency_drift_maximum, &peak_frequency_drift_rate_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_initial_frequency_error_maximum(initial_frequency_error_maximum); response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); response->set_peak_frequency_drift_rate_maximum(peak_frequency_drift_rate_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2950,12 +3190,14 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_error_wi_plus_w0_maximum {}; float64 peak_frequency_error_w0_maximum {}; auto status = library_->ModAccFetchFrequencyErrorEDR(instrument, selector_string, timeout, &header_frequency_error_wi_maximum, &peak_frequency_error_wi_plus_w0_maximum, &peak_frequency_error_w0_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_header_frequency_error_wi_maximum(header_frequency_error_wi_maximum); response->set_peak_frequency_error_wi_plus_w0_maximum(peak_frequency_error_wi_plus_w0_maximum); response->set_peak_frequency_error_w0_maximum(peak_frequency_error_w0_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2980,13 +3222,15 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_drift_maximum {}; float64 peak_frequency_drift_rate_maximum {}; auto status = library_->ModAccFetchFrequencyErrorLE(instrument, selector_string, timeout, &peak_frequency_error_maximum, &initial_frequency_drift_maximum, &peak_frequency_drift_maximum, &peak_frequency_drift_rate_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_peak_frequency_error_maximum(peak_frequency_error_maximum); response->set_initial_frequency_drift_maximum(initial_frequency_drift_maximum); response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); response->set_peak_frequency_drift_rate_maximum(peak_frequency_drift_rate_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3009,10 +3253,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyErrorTraceBR(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_frequency_error()->Resize(actual_array_size, 0); @@ -3023,12 +3267,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_time()->Resize(actual_array_size, 0); response->mutable_frequency_error()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3052,10 +3298,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyErrorTraceLE(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_frequency_error()->Resize(actual_array_size, 0); @@ -3066,12 +3312,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_time()->Resize(actual_array_size, 0); response->mutable_frequency_error()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3095,10 +3343,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyErrorWiPlusW0TraceEDR(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_frequency_error_wi_plus_w0()->Resize(actual_array_size, 0); @@ -3109,12 +3357,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_time()->Resize(actual_array_size, 0); response->mutable_frequency_error_wi_plus_w0()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3140,10 +3390,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); auto array_size = actual_array_size; @@ -3152,13 +3402,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_frequency()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3182,10 +3434,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSDEVMTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_devm()->Resize(actual_array_size, 0); float32* rms_devm = response->mutable_rms_devm()->mutable_data(); auto array_size = actual_array_size; @@ -3194,11 +3446,13 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_rms_devm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3220,6 +3474,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3240,6 +3498,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3277,6 +3539,10 @@ namespace nirfmxbluetooth_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3296,6 +3562,10 @@ namespace nirfmxbluetooth_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3318,6 +3588,10 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3341,6 +3615,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3363,6 +3641,10 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3386,6 +3668,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3417,6 +3703,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3457,6 +3747,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3488,6 +3782,10 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3510,6 +3808,10 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3533,6 +3835,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3564,6 +3870,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3607,6 +3917,10 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3633,6 +3947,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3656,6 +3974,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3697,6 +4019,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3728,6 +4054,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3753,6 +4083,10 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3776,6 +4110,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3799,6 +4137,10 @@ namespace nirfmxbluetooth_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3821,6 +4163,10 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3844,6 +4190,10 @@ namespace nirfmxbluetooth_grpc { uInt8* attr_val = (uInt8*)request->attr_val().c_str(); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3881,6 +4231,10 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3917,6 +4271,10 @@ namespace nirfmxbluetooth_grpc { } auto status = library_->TXPCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3941,12 +4299,14 @@ namespace nirfmxbluetooth_grpc { float64 edr_dpsk_average_power_mean {}; float64 edr_dpsk_gfsk_average_power_ratio_mean {}; auto status = library_->TXPFetchEDRPowers(instrument, selector_string, timeout, &edr_gfsk_average_power_mean, &edr_dpsk_average_power_mean, &edr_dpsk_gfsk_average_power_ratio_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_edr_gfsk_average_power_mean(edr_gfsk_average_power_mean); response->set_edr_dpsk_average_power_mean(edr_dpsk_average_power_mean); response->set_edr_dpsk_gfsk_average_power_ratio_mean(edr_dpsk_gfsk_average_power_ratio_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3969,11 +4329,13 @@ namespace nirfmxbluetooth_grpc { float64 reference_period_average_power_mean {}; float64 reference_period_peak_absolute_power_deviation_maximum {}; auto status = library_->TXPFetchLECTEReferencePeriodPowers(instrument, selector_string, timeout, &reference_period_average_power_mean, &reference_period_peak_absolute_power_deviation_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_period_average_power_mean(reference_period_average_power_mean); response->set_reference_period_peak_absolute_power_deviation_maximum(reference_period_peak_absolute_power_deviation_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3996,11 +4358,13 @@ namespace nirfmxbluetooth_grpc { float64 transmit_slot_average_power_mean {}; float64 transmit_slot_peak_absolute_power_deviation_maximum {}; auto status = library_->TXPFetchLECTETransmitSlotPowers(instrument, selector_string, timeout, &transmit_slot_average_power_mean, &transmit_slot_peak_absolute_power_deviation_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_transmit_slot_average_power_mean(transmit_slot_average_power_mean); response->set_transmit_slot_peak_absolute_power_deviation_maximum(transmit_slot_peak_absolute_power_deviation_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4023,10 +4387,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchLECTETransmitSlotPowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); float64* transmit_slot_average_power_mean = response->mutable_transmit_slot_average_power_mean()->mutable_data(); response->mutable_transmit_slot_peak_absolute_power_deviation_maximum()->Resize(actual_array_size, 0); @@ -4037,12 +4401,14 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); response->mutable_transmit_slot_peak_absolute_power_deviation_maximum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4068,10 +4434,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -4080,13 +4446,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4112,13 +4480,15 @@ namespace nirfmxbluetooth_grpc { float64 average_power_minimum {}; float64 peak_to_average_power_ratio_maximum {}; auto status = library_->TXPFetchPowers(instrument, selector_string, timeout, &average_power_mean, &average_power_maximum, &average_power_minimum, &peak_to_average_power_ratio_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_power_mean(average_power_mean); response->set_average_power_maximum(average_power_maximum); response->set_average_power_minimum(average_power_minimum); response->set_peak_to_average_power_ratio_maximum(peak_to_average_power_ratio_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4155,6 +4525,10 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TwentydBBandwidthCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4180,13 +4554,15 @@ namespace nirfmxbluetooth_grpc { float64 high_frequency {}; float64 low_frequency {}; auto status = library_->TwentydBBandwidthFetchMeasurement(instrument, selector_string, timeout, &peak_power, &bandwidth, &high_frequency, &low_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_peak_power(peak_power); response->set_bandwidth(bandwidth); response->set_high_frequency(high_frequency); response->set_low_frequency(low_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4211,10 +4587,10 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TwentydBBandwidthFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -4223,13 +4599,15 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4250,6 +4628,10 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4271,6 +4653,10 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxbluetooth/nirfmxbluetooth_service.h b/generated/nirfmxbluetooth/nirfmxbluetooth_service.h index 86e375a2c..be83ebd76 100644 --- a/generated/nirfmxbluetooth/nirfmxbluetooth_service.h +++ b/generated/nirfmxbluetooth/nirfmxbluetooth_service.h @@ -178,6 +178,7 @@ class NiRFmxBluetoothService final : public NiRFmxBluetooth::Service { NiRFmxBluetoothLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; std::map frequencyreferencesource_output_map_ { {"OnboardClock", 1},{"RefIn", 2},{"PXI_Clk", 3},{"ClkIn", 4}, }; std::map nirfmxbluetoothstringattributevaluesmapped_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; diff --git a/generated/nirfmxinstr/nirfmxinstr_service.cpp b/generated/nirfmxinstr/nirfmxinstr_service.cpp index 05be36b3f..a57f898c7 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_service.cpp @@ -59,10 +59,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildCalibrationPlaneString(calibration_plane_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -74,11 +74,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -100,10 +102,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildInstrumentString(selector_string, instrument_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -115,11 +117,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -141,10 +145,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildLOString(selector_string, lo_index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -156,11 +160,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -182,10 +188,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildModuleString(selector_string, module_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -197,11 +203,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -239,6 +247,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->CfgExternalAttenuationInterpolationLinear(instrument, selector_string, table_name, format); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -260,6 +272,10 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* table_name = (char*)request->table_name().c_str(); auto status = library_->CfgExternalAttenuationInterpolationNearest(instrument, selector_string, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -281,6 +297,10 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* table_name = (char*)request->table_name().c_str(); auto status = library_->CfgExternalAttenuationInterpolationSpline(instrument, selector_string, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -321,6 +341,10 @@ namespace nirfmxinstr_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->CfgExternalAttenuationTable(instrument, selector_string, table_name, frequency, external_attenuation, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -362,6 +386,10 @@ namespace nirfmxinstr_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -399,6 +427,10 @@ namespace nirfmxinstr_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -436,6 +468,10 @@ namespace nirfmxinstr_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -478,6 +514,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->CfgSParameterExternalAttenuationTable(instrument, selector_string, table_name, frequency, frequency_array_size, s_parameters.data(), s_parameter_table_size, number_of_ports, s_parameter_orientation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -514,6 +554,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->CfgSParameterExternalAttenuationType(instrument, selector_string, s_parameter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -534,10 +578,12 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); int32 acquisition_done {}; auto status = library_->CheckAcquisitionStatus(instrument, &acquisition_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_acquisition_done(acquisition_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -559,12 +605,14 @@ namespace nirfmxinstr_grpc { int32 list_exists {}; int32 personality {}; auto status = library_->CheckIfListExists(instrument, list_name, &list_exists, &personality); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_list_exists(list_exists); response->set_personality(static_cast(personality)); response->set_personality_raw(personality); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -586,12 +634,14 @@ namespace nirfmxinstr_grpc { int32 signal_configuration_exists {}; int32 personality {}; auto status = library_->CheckIfSignalConfigurationExists(instrument, signal_name, &signal_configuration_exists, &personality); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_signal_configuration_exists(signal_configuration_exists); response->set_personality(static_cast(personality)); response->set_personality_raw(personality); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -612,6 +662,10 @@ namespace nirfmxinstr_grpc { int32 force_destroy = request->force_destroy(); session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -632,6 +686,10 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DeleteAllExternalAttenuationTables(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -653,6 +711,10 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* table_name = (char*)request->table_name().c_str(); auto status = library_->DeleteExternalAttenuationTable(instrument, selector_string, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -673,6 +735,10 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableCalibrationPlane(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -693,6 +759,10 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->EnableCalibrationPlane(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -748,6 +818,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->ExportSignal(instrument, export_signal_source, export_signal_output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -770,10 +844,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -796,10 +872,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -808,11 +884,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -835,10 +913,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -861,10 +941,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -873,11 +953,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -900,10 +982,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -925,8 +1009,11 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -934,7 +1021,6 @@ namespace nirfmxinstr_grpc { }; response->set_attr_val(checked_convert_attr_val(attr_val)); response->set_attr_val_raw(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -957,10 +1043,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -969,8 +1055,11 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -987,7 +1076,6 @@ namespace nirfmxinstr_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1010,10 +1098,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1036,10 +1126,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1048,11 +1138,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1075,10 +1167,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1101,10 +1195,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, channel_name, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1112,8 +1206,11 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -1125,7 +1222,6 @@ namespace nirfmxinstr_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1149,10 +1245,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1160,8 +1256,11 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -1171,7 +1270,6 @@ namespace nirfmxinstr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1195,10 +1293,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1206,8 +1304,11 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -1217,7 +1318,6 @@ namespace nirfmxinstr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1241,10 +1341,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeString(instrument, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string attr_val; @@ -1256,11 +1356,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); - } return ::grpc::Status::OK; } } @@ -1283,10 +1385,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1308,10 +1412,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1334,10 +1440,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1346,11 +1452,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1374,10 +1482,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1386,11 +1494,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1413,10 +1523,12 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, channel_name, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1439,10 +1551,10 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, channel_name, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -1450,12 +1562,14 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1478,10 +1592,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAvailablePorts(instrument, selector_string, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string available_ports; @@ -1493,11 +1607,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_available_ports(available_ports); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_available_ports())); - } return ::grpc::Status::OK; } } @@ -1519,10 +1635,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; int32 error_code {}; @@ -1535,12 +1651,14 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -1563,10 +1681,10 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; std::string error_description; @@ -1578,11 +1696,13 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -1604,10 +1724,12 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 external_attenuation {}; auto status = library_->GetExternalAttenuationTableActualValue(instrument, selector_string, &external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_external_attenuation(external_attenuation); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1646,10 +1768,10 @@ namespace nirfmxinstr_grpc { int32 actual_personality_array_size {}; while (true) { auto status = library_->GetListNames(instrument, selector_string, personality_filter, nullptr, 0, &actual_list_names_size, nullptr, 0, &actual_personality_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string list_names; if (actual_list_names_size > 0) { list_names.resize(actual_list_names_size - 1); @@ -1663,8 +1785,11 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_list_names(list_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_list_names())); response->set_actual_list_names_size(actual_list_names_size); @@ -1679,7 +1804,6 @@ namespace nirfmxinstr_grpc { }); response->mutable_personality()->Resize(actual_personality_array_size, 0); response->set_actual_personality_array_size(actual_personality_array_size); - } return ::grpc::Status::OK; } } @@ -1748,10 +1872,12 @@ namespace nirfmxinstr_grpc { CVIAbsoluteTime timestamp {}; auto status = library_->GetSelfCalibrateLastDateAndTime(instrument, selector_string, self_calibrate_step, ×tamp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(timestamp, response->mutable_timestamp()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1788,10 +1914,12 @@ namespace nirfmxinstr_grpc { float64 temperature {}; auto status = library_->GetSelfCalibrateLastTemperature(instrument, selector_string, self_calibrate_step, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1830,10 +1958,10 @@ namespace nirfmxinstr_grpc { int32 actual_personality_array_size {}; while (true) { auto status = library_->GetSignalConfigurationNames(instrument, selector_string, personality_filter, nullptr, 0, &actual_signal_names_size, nullptr, 0, &actual_personality_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string signal_names; if (actual_signal_names_size > 0) { signal_names.resize(actual_signal_names_size - 1); @@ -1847,14 +1975,16 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_signal_names(signal_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); response->set_actual_signal_names_size(actual_signal_names_size); response->mutable_personality()->Resize(actual_personality_array_size, 0); response->set_actual_personality_array_size(actual_personality_array_size); - } return ::grpc::Status::OK; } } @@ -1884,15 +2014,13 @@ namespace nirfmxinstr_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1920,14 +2048,12 @@ namespace nirfmxinstr_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1961,14 +2087,12 @@ namespace nirfmxinstr_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1990,8 +2114,11 @@ namespace nirfmxinstr_grpc { int32 self_calibrate_valid {}; int32 valid_steps {}; auto status = library_->IsSelfCalibrateValid(instrument, selector_string, &self_calibrate_valid, &valid_steps); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_calibrate_valid(self_calibrate_valid); if (valid_steps & 0x20) response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_AMPLITUDE_ACCURACY); @@ -2014,7 +2141,6 @@ namespace nirfmxinstr_grpc { if (valid_steps & 0x100) response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_SYNTHESIZER_ALIGNMENT); response->set_valid_steps_raw(valid_steps); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2035,6 +2161,10 @@ namespace nirfmxinstr_grpc { char* file_path = (char*)request->file_path().c_str(); int32 load_rf_instr_configuration = request->load_rf_instr_configuration(); auto status = library_->LoadAllConfigurations(instrument, file_path, load_rf_instr_configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2073,6 +2203,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->LoadSParameterExternalAttenuationTableFromS2PFile(instrument, selector_string, table_name, s2p_file_path, s_parameter_orientation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2094,6 +2228,10 @@ namespace nirfmxinstr_grpc { char* channel_name = (char*)request->channel_name().c_str(); int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, channel_name, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2113,6 +2251,10 @@ namespace nirfmxinstr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetDriver(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2132,6 +2274,10 @@ namespace nirfmxinstr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetEntireSession(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2151,6 +2297,10 @@ namespace nirfmxinstr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetToDefault(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2171,6 +2321,10 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* file_path = (char*)request->file_path().c_str(); auto status = library_->SaveAllConfigurations(instrument, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2192,6 +2346,10 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* table_name = (char*)request->table_name().c_str(); auto status = library_->SelectActiveExternalAttenuationTable(instrument, selector_string, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2228,6 +2386,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->SelfCalibrate(instrument, selector_string, steps_to_omit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2268,6 +2430,10 @@ namespace nirfmxinstr_grpc { float64 minimum_reference_level = request->minimum_reference_level(); float64 maximum_reference_level = request->maximum_reference_level(); auto status = library_->SelfCalibrateRange(instrument, selector_string, steps_to_omit, minimum_frequency, maximum_frequency, minimum_reference_level, maximum_reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2287,6 +2453,10 @@ namespace nirfmxinstr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeAdvanceTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2306,6 +2476,10 @@ namespace nirfmxinstr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeStartTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2328,6 +2502,10 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2351,6 +2529,10 @@ namespace nirfmxinstr_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2373,6 +2555,10 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2396,6 +2582,10 @@ namespace nirfmxinstr_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2427,6 +2617,10 @@ namespace nirfmxinstr_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI16(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2467,6 +2661,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->SetAttributeI32(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2498,6 +2696,10 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2520,6 +2722,10 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2543,6 +2749,10 @@ namespace nirfmxinstr_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2574,6 +2784,10 @@ namespace nirfmxinstr_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI8(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2617,6 +2831,10 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, channel_name, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2643,6 +2861,10 @@ namespace nirfmxinstr_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2666,6 +2888,10 @@ namespace nirfmxinstr_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2707,6 +2933,10 @@ namespace nirfmxinstr_grpc { } auto status = library_->SetAttributeString(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2738,6 +2968,10 @@ namespace nirfmxinstr_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeU16(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2763,6 +2997,10 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2786,6 +3024,10 @@ namespace nirfmxinstr_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2809,6 +3051,10 @@ namespace nirfmxinstr_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2831,6 +3077,10 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, channel_name, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2854,6 +3104,10 @@ namespace nirfmxinstr_grpc { uInt8* attr_val = (uInt8*)request->attr_val().c_str(); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, channel_name, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2874,10 +3128,12 @@ namespace nirfmxinstr_grpc { float64 fractional_seconds = request->fractional_seconds(); CVIAbsoluteTime timestamp {}; auto status = library_->TimestampFromValues(seconds_since_1970, fractional_seconds, ×tamp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(timestamp, response->mutable_timestamp()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2897,11 +3153,13 @@ namespace nirfmxinstr_grpc { int64 seconds_since_1970 {}; float64 fractional_seconds {}; auto status = library_->ValuesFromTimestamp(timestamp, &seconds_since_1970, &fractional_seconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_seconds_since_1970(seconds_since_1970); response->set_fractional_seconds(fractional_seconds); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2921,6 +3179,10 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxinstr/nirfmxinstr_service.h b/generated/nirfmxinstr/nirfmxinstr_service.h index 6943f0649..d8e3d0cc7 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.h +++ b/generated/nirfmxinstr/nirfmxinstr_service.h @@ -139,6 +139,7 @@ class NiRFmxInstrService final : public NiRFmxInstr::Service { NiRFmxInstrLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"},{5, "RefIn2"},{6, "PXI_ClkMaster"}, }; std::map frequencyreferencesource_output_map_ { {"OnboardClock", 1},{"RefIn", 2},{"PXI_Clk", 3},{"ClkIn", 4},{"RefIn2", 5},{"PXI_ClkMaster", 6}, }; std::map nirfmxinstrstringattributevaluesmapped_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"},{14, ""},{15, "RefOut"},{16, "RefOut2"},{17, "ClkOut"},{18, ""},{19, "OnboardClock"},{20, "RefIn"},{21, "PXI_Clk"},{22, "ClkIn"},{23, "RefIn2"},{24, "PXI_ClkMaster"},{25, "Automatic_SG_SA_Shared"},{26, "LO_In"},{27, "None"},{28, "Onboard"},{29, "Secondary"},{30, "SG_SA_Shared"},{31, "PFI0"},{32, "PFI1"},{33, "PXI_Trig0"},{34, "PXI_Trig1"},{35, "PXI_Trig2"},{36, "PXI_Trig3"},{37, "PXI_Trig4"},{38, "PXI_Trig5"},{39, "PXI_Trig6"},{40, "PXI_Trig7"},{41, "PXI_STAR"},{42, "PXIe_DStarC"},{43, "PXIe_DStarB"},{44, "TimerEvent"}, }; diff --git a/generated/nirfmxlte/nirfmxlte_service.cpp b/generated/nirfmxlte/nirfmxlte_service.cpp index 0265da843..191037dd6 100644 --- a/generated/nirfmxlte/nirfmxlte_service.cpp +++ b/generated/nirfmxlte/nirfmxlte_service.cpp @@ -92,6 +92,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -128,6 +132,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ACPCfgConfigurableNumberOfOffsetsEnabled(instrument, selector_string, configurable_number_of_offsets_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -164,6 +172,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -200,6 +212,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -221,6 +237,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgNumberOfEUTRAOffsets(instrument, selector_string, number_of_eutra_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -242,6 +262,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_gsm_offsets = request->number_of_gsm_offsets(); auto status = library_->ACPCfgNumberOfGSMOffsets(instrument, selector_string, number_of_gsm_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -263,6 +287,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_utra_offsets = request->number_of_utra_offsets(); auto status = library_->ACPCfgNumberOfUTRAOffsets(instrument, selector_string, number_of_utra_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -299,6 +327,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -352,6 +384,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -389,6 +425,10 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -411,6 +451,10 @@ namespace nirfmxlte_grpc { int32 number_of_utra_offsets = request->number_of_utra_offsets(); int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgUTRAAndEUTRAOffsets(instrument, selector_string, number_of_utra_offsets, number_of_eutra_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -437,10 +481,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -449,13 +493,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -479,11 +525,13 @@ namespace nirfmxlte_grpc { float64 absolute_power {}; float64 relative_power {}; auto status = library_->ACPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -506,10 +554,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -520,12 +568,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -551,13 +601,15 @@ namespace nirfmxlte_grpc { float64 lower_absolute_power {}; float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); response->set_lower_absolute_power(lower_absolute_power); response->set_upper_absolute_power(upper_absolute_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -580,10 +632,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -598,14 +650,16 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_lower_relative_power()->Resize(actual_array_size, 0); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -632,10 +686,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -644,13 +698,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -676,10 +732,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -688,13 +744,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -719,12 +777,14 @@ namespace nirfmxlte_grpc { float64 integration_bandwidth {}; float64 frequency {}; auto status = library_->ACPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); response->set_frequency(frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -746,10 +806,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 total_aggregated_power {}; auto status = library_->ACPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_aggregated_power(total_aggregated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -770,11 +832,13 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -794,6 +858,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -821,6 +889,10 @@ namespace nirfmxlte_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -848,6 +920,10 @@ namespace nirfmxlte_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -870,10 +946,12 @@ namespace nirfmxlte_grpc { float64 measurement_interval = request->measurement_interval(); float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_level(reference_level); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -894,10 +972,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -909,11 +987,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -935,10 +1015,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildClusterString(selector_string, cluster_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -950,11 +1030,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -976,10 +1058,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -991,11 +1073,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1017,10 +1101,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildPDSCHString(selector_string, pdsch_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1032,11 +1116,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1058,10 +1144,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -1073,11 +1159,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -1099,10 +1187,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSubblockString(selector_string, subblock_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1114,11 +1202,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1140,10 +1230,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSubframeString(selector_string, subframe_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1155,11 +1245,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1213,6 +1305,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1249,6 +1345,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CHPCfgIntegrationBandwidthType(instrument, selector_string, integration_bandwidth_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1302,6 +1402,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1339,6 +1443,10 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1362,11 +1470,13 @@ namespace nirfmxlte_grpc { float64 absolute_power {}; float64 relative_power {}; auto status = library_->CHPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1389,10 +1499,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -1403,12 +1513,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1434,10 +1546,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1446,13 +1558,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1477,12 +1591,14 @@ namespace nirfmxlte_grpc { float64 integration_bandwidth {}; float64 frequency {}; auto status = library_->CHPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); response->set_frequency(frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1504,10 +1620,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 total_aggregated_power {}; auto status = library_->CHPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_aggregated_power(total_aggregated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1528,11 +1646,13 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1568,6 +1688,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgAutoDMRSDetectionEnabled(instrument, selector_string, auto_dmrs_detection_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1604,6 +1728,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgAutoNPUSCHChannelDetectionEnabled(instrument, selector_string, auto_npusch_channel_detection_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1640,6 +1768,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgAutoResourceBlockDetectionEnabled(instrument, selector_string, auto_resource_block_detection_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1661,6 +1793,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 band = request->band(); auto status = library_->CfgBand(instrument, selector_string, band); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1697,6 +1833,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgCellSpecificRatio(instrument, selector_string, cell_specific_ratio); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1720,6 +1860,10 @@ namespace nirfmxlte_grpc { float64 component_carrier_frequency = request->component_carrier_frequency(); int32 cell_id = request->cell_id(); auto status = library_->CfgComponentCarrier(instrument, selector_string, component_carrier_bandwidth, component_carrier_frequency, cell_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1762,6 +1906,10 @@ namespace nirfmxlte_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->CfgComponentCarrierArray(instrument, selector_string, component_carrier_bandwidth, component_carrier_frequency, cell_id, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1799,6 +1947,10 @@ namespace nirfmxlte_grpc { int32 component_carrier_at_center_frequency = request->component_carrier_at_center_frequency(); auto status = library_->CfgComponentCarrierSpacing(instrument, selector_string, component_carrier_spacing_type, component_carrier_at_center_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1857,6 +2009,10 @@ namespace nirfmxlte_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1893,6 +2049,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgDownlinkAutoCellIDDetectionEnabled(instrument, selector_string, auto_cell_id_detection_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1962,6 +2122,10 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->CfgDownlinkAutoChannelDetection(instrument, selector_string, auto_pdsch_channel_detection_enabled, auto_control_channel_power_detection_enabled, auto_pcfich_cfi_detection_enabled, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1998,6 +2162,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgDownlinkChannelConfigurationMode(instrument, selector_string, channel_configuration_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2019,6 +2187,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_subframes = request->number_of_subframes(); auto status = library_->CfgDownlinkNumberOfSubframes(instrument, selector_string, number_of_subframes); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2041,6 +2213,10 @@ namespace nirfmxlte_grpc { float64 pss_power = request->pss_power(); float64 sss_power = request->sss_power(); auto status = library_->CfgDownlinkSynchronizationSignal(instrument, selector_string, pss_power, sss_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2077,6 +2253,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgDownlinkTestModel(instrument, selector_string, downlink_test_model); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2107,6 +2287,10 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->downlink_test_model().size()); auto status = library_->CfgDownlinkTestModelArray(instrument, selector_string, downlink_test_model, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2159,6 +2343,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgDuplexScheme(instrument, selector_string, duplex_scheme, uplink_downlink_configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2195,6 +2383,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgEMTCAnalysisEnabled(instrument, selector_string, emtc_analysis_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2216,6 +2408,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2237,6 +2433,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2275,6 +2475,10 @@ namespace nirfmxlte_grpc { int32 band = request->band(); int32 earfcn = request->earfcn(); auto status = library_->CfgFrequencyEARFCN(instrument, selector_string, link_direction, band, earfcn); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2316,6 +2520,10 @@ namespace nirfmxlte_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2389,6 +2597,10 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2425,6 +2637,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgLinkDirection(instrument, selector_string, link_direction); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2462,6 +2678,10 @@ namespace nirfmxlte_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2499,6 +2719,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgNBIoTComponentCarrier(instrument, selector_string, n_cell_id, uplink_subcarrier_spacing); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2554,6 +2778,10 @@ namespace nirfmxlte_grpc { int32 npusch_dmrs_delta_ss = request->npusch_dmrs_delta_ss(); auto status = library_->CfgNPUSCHDMRS(instrument, selector_string, npusch_dmrs_base_sequence_mode, npusch_dmrs_base_sequence_index, npusch_dmrs_cyclic_shift, npusch_dmrs_group_hopping_enabled, npusch_dmrs_delta_ss); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2575,6 +2803,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 format = request->format(); auto status = library_->CfgNPUSCHFormat(instrument, selector_string, format); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2596,6 +2828,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 starting_slot = request->starting_slot(); auto status = library_->CfgNPUSCHStartingSlot(instrument, selector_string, starting_slot); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2634,6 +2870,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgNPUSCHTones(instrument, selector_string, tone_offset, number_of_tones, modulation_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2655,6 +2895,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_component_carriers = request->number_of_component_carriers(); auto status = library_->CfgNumberOfComponentCarriers(instrument, selector_string, number_of_component_carriers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2676,6 +2920,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_dut_antennas = request->number_of_dut_antennas(); auto status = library_->CfgNumberOfDUTAntennas(instrument, selector_string, number_of_dut_antennas); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2697,6 +2945,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_pdsch_channels = request->number_of_pdsch_channels(); auto status = library_->CfgNumberOfPDSCHChannels(instrument, selector_string, number_of_pdsch_channels); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2718,6 +2970,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_resource_block_clusters = request->number_of_resource_block_clusters(); auto status = library_->CfgNumberOfPUSCHResourceBlockClusters(instrument, selector_string, number_of_resource_block_clusters); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2739,6 +2995,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_subblocks = request->number_of_subblocks(); auto status = library_->CfgNumberOfSubblocks(instrument, selector_string, number_of_subblocks); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2760,6 +3020,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 pbch_power = request->pbch_power(); auto status = library_->CfgPBCH(instrument, selector_string, pbch_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2782,6 +3046,10 @@ namespace nirfmxlte_grpc { int32 cfi = request->cfi(); float64 power = request->power(); auto status = library_->CfgPCFICH(instrument, selector_string, cfi, power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2803,6 +3071,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 pdcch_power = request->pdcch_power(); auto status = library_->CfgPDCCH(instrument, selector_string, pdcch_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2841,6 +3113,10 @@ namespace nirfmxlte_grpc { char* resource_block_allocation = (char*)request->resource_block_allocation().c_str(); float64 power = request->power(); auto status = library_->CfgPDSCH(instrument, selector_string, cw0_modulation_type, resource_block_allocation, power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2894,6 +3170,10 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPHICH(instrument, selector_string, resource, duration, power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2915,6 +3195,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 modulation_type = request->modulation_type(); auto status = library_->CfgPSSCHModulationType(instrument, selector_string, modulation_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2937,6 +3221,10 @@ namespace nirfmxlte_grpc { int32 resource_block_offset = request->resource_block_offset(); int32 number_of_resource_blocks = request->number_of_resource_blocks(); auto status = library_->CfgPSSCHResourceBlocks(instrument, selector_string, resource_block_offset, number_of_resource_blocks); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2973,6 +3261,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgPUSCHModulationType(instrument, selector_string, modulation_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2995,6 +3287,10 @@ namespace nirfmxlte_grpc { int32 resource_block_offset = request->resource_block_offset(); int32 number_of_resource_blocks = request->number_of_resource_blocks(); auto status = library_->CfgPUSCHResourceBlocks(instrument, selector_string, resource_block_offset, number_of_resource_blocks); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3018,6 +3314,10 @@ namespace nirfmxlte_grpc { float64 reference_level = request->reference_level(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3055,6 +3355,10 @@ namespace nirfmxlte_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3076,6 +3380,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3098,6 +3406,10 @@ namespace nirfmxlte_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3119,6 +3431,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 transmit_antenna_to_analyze = request->transmit_antenna_to_analyze(); auto status = library_->CfgTransmitAntennaToAnalyze(instrument, selector_string, transmit_antenna_to_analyze); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3155,6 +3471,10 @@ namespace nirfmxlte_grpc { } auto status = library_->CfgeNodeBCategory(instrument, selector_string, enodeb_category); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3176,10 +3496,12 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3199,6 +3521,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3219,6 +3545,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3239,6 +3569,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3260,6 +3594,10 @@ namespace nirfmxlte_grpc { char* old_signal_name = (char*)request->old_signal_name().c_str(); char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3281,6 +3619,10 @@ namespace nirfmxlte_grpc { int32 force_destroy = request->force_destroy(); session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3301,6 +3643,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3321,6 +3667,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3341,6 +3691,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3361,7 +3715,11 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); - response->set_status(status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3384,10 +3742,10 @@ namespace nirfmxlte_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -3398,13 +3756,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); response->set_actual_result_names_size(actual_result_names_size); response->set_default_result_exists(default_result_exists); - } return ::grpc::Status::OK; } } @@ -3427,10 +3787,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3453,10 +3815,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -3465,11 +3827,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3492,10 +3856,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3518,10 +3884,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -3530,11 +3896,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3557,10 +3925,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3582,8 +3952,11 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -3591,7 +3964,6 @@ namespace nirfmxlte_grpc { }; response->set_attr_val(checked_convert_attr_val(attr_val)); response->set_attr_val_raw(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3614,10 +3986,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -3626,8 +3998,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -3644,7 +4019,6 @@ namespace nirfmxlte_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3667,10 +4041,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3693,10 +4069,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -3705,11 +4081,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3732,10 +4110,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3758,10 +4138,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -3769,8 +4149,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -3782,7 +4165,6 @@ namespace nirfmxlte_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3806,10 +4188,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -3817,8 +4199,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -3828,7 +4213,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3852,10 +4236,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -3863,8 +4247,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -3874,7 +4261,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3898,10 +4284,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string attr_val; @@ -3913,11 +4299,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); - } return ::grpc::Status::OK; } } @@ -3940,10 +4328,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3965,10 +4355,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3991,10 +4383,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -4003,11 +4395,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4031,10 +4425,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -4043,11 +4437,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4070,10 +4466,12 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4096,10 +4494,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -4107,12 +4505,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4134,10 +4534,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; int32 error_code {}; @@ -4150,12 +4550,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -4178,10 +4580,10 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; std::string error_description; @@ -4193,11 +4595,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -4227,15 +4631,13 @@ namespace nirfmxlte_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXLTE_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4263,14 +4665,12 @@ namespace nirfmxlte_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXLTE_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4291,6 +4691,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4328,6 +4732,10 @@ namespace nirfmxlte_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4364,6 +4772,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ModAccCfgCommonClockSourceEnabled(instrument, selector_string, common_clock_source_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4400,6 +4812,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ModAccCfgEVMUnit(instrument, selector_string, evm_unit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4421,6 +4837,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 fft_window_offset = request->fft_window_offset(); auto status = library_->ModAccCfgFFTWindowOffset(instrument, selector_string, fft_window_offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4459,6 +4879,10 @@ namespace nirfmxlte_grpc { float64 fft_window_offset = request->fft_window_offset(); float64 fft_window_length = request->fft_window_length(); auto status = library_->ModAccCfgFFTWindowPosition(instrument, selector_string, fft_window_type, fft_window_offset, fft_window_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4495,6 +4919,10 @@ namespace nirfmxlte_grpc { } auto status = library_->ModAccCfgInBandEmissionMaskType(instrument, selector_string, in_band_emission_mask_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4533,6 +4961,10 @@ namespace nirfmxlte_grpc { int32 measurement_offset = request->measurement_offset(); int32 measurement_length = request->measurement_length(); auto status = library_->ModAccCfgSynchronizationModeAndInterval(instrument, selector_string, synchronization_mode, measurement_offset, measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4556,10 +4988,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCSRSConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector csrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchCSRSConstellation(instrument, selector_string, timeout, csrs_constellation.data(), array_size, &actual_array_size); @@ -4567,8 +4999,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(csrs_constellation, response->mutable_csrs_constellation()); { auto shrunk_size = actual_array_size; @@ -4578,7 +5013,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4601,10 +5035,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 mean_rms_csrs_evm {}; auto status = library_->ModAccFetchCSRSEVM(instrument, selector_string, timeout, &mean_rms_csrs_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_csrs_evm(mean_rms_csrs_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4627,10 +5063,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCSRSEVMArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); float64* mean_rms_csrs_evm = response->mutable_mean_rms_csrs_evm()->mutable_data(); auto array_size = actual_array_size; @@ -4639,11 +5075,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4671,15 +5109,17 @@ namespace nirfmxlte_grpc { int32 peak_composite_evm_subcarrier_index {}; int32 peak_composite_evm_slot_index {}; auto status = library_->ModAccFetchCompositeEVM(instrument, selector_string, timeout, &mean_rms_composite_evm, &maximum_peak_composite_evm, &mean_frequency_error, &peak_composite_evm_symbol_index, &peak_composite_evm_subcarrier_index, &peak_composite_evm_slot_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_composite_evm(mean_rms_composite_evm); response->set_maximum_peak_composite_evm(maximum_peak_composite_evm); response->set_mean_frequency_error(mean_frequency_error); response->set_peak_composite_evm_symbol_index(peak_composite_evm_symbol_index); response->set_peak_composite_evm_subcarrier_index(peak_composite_evm_subcarrier_index); response->set_peak_composite_evm_slot_index(peak_composite_evm_slot_index); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4702,10 +5142,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCompositeEVMArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); float64* mean_rms_composite_evm = response->mutable_mean_rms_composite_evm()->mutable_data(); response->mutable_maximum_peak_composite_evm()->Resize(actual_array_size, 0); @@ -4724,8 +5164,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); response->mutable_maximum_peak_composite_evm()->Resize(actual_array_size, 0); response->mutable_mean_frequency_error()->Resize(actual_array_size, 0); @@ -4733,7 +5176,6 @@ namespace nirfmxlte_grpc { response->mutable_peak_composite_evm_subcarrier_index()->Resize(actual_array_size, 0); response->mutable_peak_composite_evm_slot_index()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4759,13 +5201,15 @@ namespace nirfmxlte_grpc { float64 mean_rms_composite_phase_error {}; float64 max_peak_composite_phase_error {}; auto status = library_->ModAccFetchCompositeMagnitudeAndPhaseError(instrument, selector_string, timeout, &mean_rms_composite_magnitude_error, &max_peak_composite_magnitude_error, &mean_rms_composite_phase_error, &max_peak_composite_phase_error); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_composite_magnitude_error(mean_rms_composite_magnitude_error); response->set_max_peak_composite_magnitude_error(max_peak_composite_magnitude_error); response->set_mean_rms_composite_phase_error(mean_rms_composite_phase_error); response->set_max_peak_composite_phase_error(max_peak_composite_phase_error); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4788,10 +5232,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCompositeMagnitudeAndPhaseErrorArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); float64* mean_rms_composite_magnitude_error = response->mutable_mean_rms_composite_magnitude_error()->mutable_data(); response->mutable_maximum_peak_composite_magnitude_error()->Resize(actual_array_size, 0); @@ -4806,14 +5250,16 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); response->mutable_maximum_peak_composite_magnitude_error()->Resize(actual_array_size, 0); response->mutable_mean_rms_composite_phase_error()->Resize(actual_array_size, 0); response->mutable_maximum_peak_composite_phase_error()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4836,10 +5282,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); int32 detected_cell_id {}; auto status = library_->ModAccFetchDownlinkDetectedCellID(instrument, selector_string, timeout, &detected_cell_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_detected_cell_id(detected_cell_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4862,10 +5310,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkDetectedCellIDArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_detected_cell_id()->Resize(actual_array_size, 0); int32* detected_cell_id = reinterpret_cast(response->mutable_detected_cell_id()->mutable_data()); auto array_size = actual_array_size; @@ -4874,11 +5322,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_detected_cell_id()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4902,10 +5352,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPBCHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pbch_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPBCHConstellation(instrument, selector_string, timeout, pbch_constellation.data(), array_size, &actual_array_size); @@ -4913,8 +5363,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pbch_constellation, response->mutable_pbch_constellation()); { auto shrunk_size = actual_array_size; @@ -4924,7 +5377,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4948,10 +5400,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPCFICHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pcfich_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPCFICHConstellation(instrument, selector_string, timeout, pcfich_constellation.data(), array_size, &actual_array_size); @@ -4959,8 +5411,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pcfich_constellation, response->mutable_pcfich_constellation()); { auto shrunk_size = actual_array_size; @@ -4970,7 +5425,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4994,10 +5448,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPDCCHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pdcch_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPDCCHConstellation(instrument, selector_string, timeout, pdcch_constellation.data(), array_size, &actual_array_size); @@ -5005,8 +5459,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pdcch_constellation, response->mutable_pdcch_constellation()); { auto shrunk_size = actual_array_size; @@ -5016,7 +5473,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5040,10 +5496,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPHICHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector phich_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPHICHConstellation(instrument, selector_string, timeout, phich_constellation.data(), array_size, &actual_array_size); @@ -5051,8 +5507,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(phich_constellation, response->mutable_phich_constellation()); { auto shrunk_size = actual_array_size; @@ -5062,7 +5521,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5088,11 +5546,13 @@ namespace nirfmxlte_grpc { float64 rs_transmit_power {}; float64 ofdm_symbol_transmit_power {}; auto status = library_->ModAccFetchDownlinkTransmitPower(instrument, selector_string, timeout, &rs_transmit_power, &ofdm_symbol_transmit_power, reserved1, reserved2); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_rs_transmit_power(rs_transmit_power); response->set_ofdm_symbol_transmit_power(ofdm_symbol_transmit_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5117,10 +5577,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkTransmitPowerArray(instrument, selector_string, timeout, nullptr, nullptr, reserved1, reserved2, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); float64* rs_transmit_power = response->mutable_rs_transmit_power()->mutable_data(); response->mutable_ofdm_symbol_transmit_power()->Resize(actual_array_size, 0); @@ -5131,12 +5591,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); response->mutable_ofdm_symbol_transmit_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5162,10 +5624,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMHighPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_evm_high_per_symbol()->Resize(actual_array_size, 0); float32* evm_high_per_symbol = response->mutable_evm_high_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5174,13 +5636,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_evm_high_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5206,10 +5670,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMLowPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_evm_low_per_symbol()->Resize(actual_array_size, 0); float32* evm_low_per_symbol = response->mutable_evm_low_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5218,13 +5682,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_evm_low_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5250,10 +5716,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMPerSlotTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_per_slot()->Resize(actual_array_size, 0); float32* rms_evm_per_slot = response->mutable_rms_evm_per_slot()->mutable_data(); auto array_size = actual_array_size; @@ -5262,13 +5728,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_per_slot()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5294,10 +5762,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMPerSubcarrierTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* mean_rms_evm_per_subcarrier = response->mutable_mean_rms_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5306,13 +5774,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_mean_rms_evm_per_subcarrier()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5338,10 +5808,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_per_symbol()->Resize(actual_array_size, 0); float32* rms_evm_per_symbol = response->mutable_rms_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5350,13 +5820,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5381,12 +5853,14 @@ namespace nirfmxlte_grpc { float64 mean_iq_gain_imbalance {}; float64 mean_iq_quadrature_error {}; auto status = library_->ModAccFetchIQImpairments(instrument, selector_string, timeout, &mean_iq_origin_offset, &mean_iq_gain_imbalance, &mean_iq_quadrature_error); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_iq_origin_offset(mean_iq_origin_offset); response->set_mean_iq_gain_imbalance(mean_iq_gain_imbalance); response->set_mean_iq_quadrature_error(mean_iq_quadrature_error); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5409,10 +5883,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchIQImpairmentsArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); float64* mean_iq_origin_offset = response->mutable_mean_iq_origin_offset()->mutable_data(); response->mutable_mean_iq_gain_imbalance()->Resize(actual_array_size, 0); @@ -5425,13 +5899,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); response->mutable_mean_iq_gain_imbalance()->Resize(actual_array_size, 0); response->mutable_mean_iq_quadrature_error()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5454,10 +5930,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 in_band_emission_margin {}; auto status = library_->ModAccFetchInBandEmissionMargin(instrument, selector_string, timeout, &in_band_emission_margin); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_in_band_emission_margin(in_band_emission_margin); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5480,10 +5958,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchInBandEmissionMarginArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); float64* in_band_emission_margin = response->mutable_in_band_emission_margin()->mutable_data(); auto array_size = actual_array_size; @@ -5492,11 +5970,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5522,10 +6002,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchInBandEmissionTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_in_band_emission()->Resize(actual_array_size, 0); float32* in_band_emission = response->mutable_in_band_emission()->mutable_data(); response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -5536,14 +6016,16 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_in_band_emission()->Resize(actual_array_size, 0); response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5569,10 +6051,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumEVMPerSlotTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_maximum_evm_per_slot()->Resize(actual_array_size, 0); float32* maximum_evm_per_slot = response->mutable_maximum_evm_per_slot()->mutable_data(); auto array_size = actual_array_size; @@ -5581,13 +6063,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_maximum_evm_per_slot()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5613,10 +6097,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumEVMPerSubcarrierTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_maximum_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* maximum_evm_per_subcarrier = response->mutable_maximum_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5625,13 +6109,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_maximum_evm_per_subcarrier()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5657,10 +6143,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumEVMPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_maximum_evm_per_symbol()->Resize(actual_array_size, 0); float32* maximum_evm_per_symbol = response->mutable_maximum_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5669,13 +6155,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_maximum_evm_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5701,10 +6189,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumMagnitudeErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_maximum_magnitude_error_per_symbol()->Resize(actual_array_size, 0); float32* maximum_magnitude_error_per_symbol = response->mutable_maximum_magnitude_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5713,13 +6201,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_maximum_magnitude_error_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5745,10 +6235,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumPhaseErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_maximum_phase_error_per_symbol()->Resize(actual_array_size, 0); float32* maximum_phase_error_per_symbol = response->mutable_maximum_phase_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5757,13 +6247,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_maximum_phase_error_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5788,10 +6280,10 @@ namespace nirfmxlte_grpc { int32 dmrs_constellation_actual_array_size {}; while (true) { auto status = library_->ModAccFetchNPUSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); auto data_constellation_array_size = data_constellation_actual_array_size; @@ -5801,8 +6293,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data_constellation, response->mutable_data_constellation()); { auto shrunk_size = data_constellation_actual_array_size; @@ -5821,7 +6316,6 @@ namespace nirfmxlte_grpc { } } response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); - } return ::grpc::Status::OK; } } @@ -5845,11 +6339,13 @@ namespace nirfmxlte_grpc { float64 npusch_mean_rms_dmrs_evm {}; float64 npusch_maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchNPUSCHDMRSEVM(instrument, selector_string, timeout, &npusch_mean_rms_dmrs_evm, &npusch_maximum_peak_dmrs_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_npusch_mean_rms_dmrs_evm(npusch_mean_rms_dmrs_evm); response->set_npusch_maximum_peak_dmrs_evm(npusch_maximum_peak_dmrs_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5872,11 +6368,13 @@ namespace nirfmxlte_grpc { float64 npusch_mean_rms_data_evm {}; float64 npusch_maximum_peak_data_evm {}; auto status = library_->ModAccFetchNPUSCHDataEVM(instrument, selector_string, timeout, &npusch_mean_rms_data_evm, &npusch_maximum_peak_data_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_npusch_mean_rms_data_evm(npusch_mean_rms_data_evm); response->set_npusch_maximum_peak_data_evm(npusch_maximum_peak_data_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5899,11 +6397,13 @@ namespace nirfmxlte_grpc { float64 npusch_mean_data_power {}; float64 npusch_mean_dmrs_power {}; auto status = library_->ModAccFetchNPUSCHSymbolPower(instrument, selector_string, timeout, &npusch_mean_data_power, &npusch_mean_dmrs_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_npusch_mean_data_power(npusch_mean_data_power); response->set_npusch_mean_dmrs_power(npusch_mean_dmrs_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5926,10 +6426,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH1024QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam1024_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH1024QAMConstellation(instrument, selector_string, timeout, qam1024_constellation.data(), array_size, &actual_array_size); @@ -5937,8 +6437,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); { auto shrunk_size = actual_array_size; @@ -5948,7 +6451,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5971,10 +6473,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 mean_rms_1024qam_evm {}; auto status = library_->ModAccFetchPDSCH1024QAMEVM(instrument, selector_string, timeout, &mean_rms_1024qam_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_1024qam_evm(mean_rms_1024qam_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5997,10 +6501,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH1024QAMEVMArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); float64* mean_rms_1024qam_evm = response->mutable_mean_rms_1024qam_evm()->mutable_data(); auto array_size = actual_array_size; @@ -6009,11 +6513,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6037,10 +6543,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH16QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam16_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH16QAMConstellation(instrument, selector_string, timeout, qam16_constellation.data(), array_size, &actual_array_size); @@ -6048,8 +6554,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); { auto shrunk_size = actual_array_size; @@ -6059,7 +6568,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6083,10 +6591,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH256QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam256_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH256QAMConstellation(instrument, selector_string, timeout, qam256_constellation.data(), array_size, &actual_array_size); @@ -6094,8 +6602,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); { auto shrunk_size = actual_array_size; @@ -6105,7 +6616,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6129,10 +6639,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH64QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam64_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH64QAMConstellation(instrument, selector_string, timeout, qam64_constellation.data(), array_size, &actual_array_size); @@ -6140,8 +6650,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); { auto shrunk_size = actual_array_size; @@ -6151,7 +6664,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6178,14 +6690,16 @@ namespace nirfmxlte_grpc { float64 mean_rms_64qam_evm {}; float64 mean_rms_256qam_evm {}; auto status = library_->ModAccFetchPDSCHEVM(instrument, selector_string, timeout, &mean_rms_evm, &mean_rms_qpsk_evm, &mean_rms_16qam_evm, &mean_rms_64qam_evm, &mean_rms_256qam_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_evm(mean_rms_evm); response->set_mean_rms_qpsk_evm(mean_rms_qpsk_evm); response->set_mean_rms_16qam_evm(mean_rms_16qam_evm); response->set_mean_rms_64qam_evm(mean_rms_64qam_evm); response->set_mean_rms_256qam_evm(mean_rms_256qam_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6208,10 +6722,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHEVMArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); float64* mean_rms_evm = response->mutable_mean_rms_evm()->mutable_data(); response->mutable_mean_rms_qpsk_evm()->Resize(actual_array_size, 0); @@ -6228,15 +6742,17 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_qpsk_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_16qam_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_64qam_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_256qam_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6260,10 +6776,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHQPSKConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qpsk_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHQPSKConstellation(instrument, selector_string, timeout, qpsk_constellation.data(), array_size, &actual_array_size); @@ -6271,8 +6787,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); { auto shrunk_size = actual_array_size; @@ -6282,7 +6801,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6307,10 +6825,10 @@ namespace nirfmxlte_grpc { int32 dmrs_constellation_actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); auto data_constellation_array_size = data_constellation_actual_array_size; @@ -6320,8 +6838,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data_constellation, response->mutable_data_constellation()); { auto shrunk_size = data_constellation_actual_array_size; @@ -6340,7 +6861,6 @@ namespace nirfmxlte_grpc { } } response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); - } return ::grpc::Status::OK; } } @@ -6364,11 +6884,13 @@ namespace nirfmxlte_grpc { float64 pssch_mean_rms_dmrs_evm {}; float64 pssch_maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchPSSCHDMRSEVM(instrument, selector_string, timeout, &pssch_mean_rms_dmrs_evm, &pssch_maximum_peak_dmrs_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pssch_mean_rms_dmrs_evm(pssch_mean_rms_dmrs_evm); response->set_pssch_maximum_peak_dmrs_evm(pssch_maximum_peak_dmrs_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6391,10 +6913,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHDMRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); float64* pssch_mean_rms_dmrs_evm = response->mutable_pssch_mean_rms_dmrs_evm()->mutable_data(); response->mutable_pssch_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); @@ -6405,12 +6927,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); response->mutable_pssch_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6434,11 +6958,13 @@ namespace nirfmxlte_grpc { float64 pssch_mean_rms_data_evm {}; float64 pssch_maximum_peak_data_evm {}; auto status = library_->ModAccFetchPSSCHDataEVM(instrument, selector_string, timeout, &pssch_mean_rms_data_evm, &pssch_maximum_peak_data_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pssch_mean_rms_data_evm(pssch_mean_rms_data_evm); response->set_pssch_maximum_peak_data_evm(pssch_maximum_peak_data_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6461,10 +6987,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHDataEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); float64* pssch_mean_rms_data_evm = response->mutable_pssch_mean_rms_data_evm()->mutable_data(); response->mutable_pssch_maximum_peak_data_evm()->Resize(actual_array_size, 0); @@ -6475,12 +7001,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); response->mutable_pssch_maximum_peak_data_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6504,11 +7032,13 @@ namespace nirfmxlte_grpc { float64 pssch_mean_data_power {}; float64 pssch_mean_dmrs_power {}; auto status = library_->ModAccFetchPSSCHSymbolPower(instrument, selector_string, timeout, &pssch_mean_data_power, &pssch_mean_dmrs_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pssch_mean_data_power(pssch_mean_data_power); response->set_pssch_mean_dmrs_power(pssch_mean_dmrs_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6531,10 +7061,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHSymbolPowerArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); float64* pssch_mean_data_power = response->mutable_pssch_mean_data_power()->mutable_data(); response->mutable_pssch_mean_dmrs_power()->Resize(actual_array_size, 0); @@ -6545,12 +7075,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); response->mutable_pssch_mean_dmrs_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6575,10 +7107,10 @@ namespace nirfmxlte_grpc { int32 dmrs_constellation_actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); auto data_constellation_array_size = data_constellation_actual_array_size; @@ -6588,8 +7120,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data_constellation, response->mutable_data_constellation()); { auto shrunk_size = data_constellation_actual_array_size; @@ -6608,7 +7143,6 @@ namespace nirfmxlte_grpc { } } response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); - } return ::grpc::Status::OK; } } @@ -6632,11 +7166,13 @@ namespace nirfmxlte_grpc { float64 mean_rms_dmrs_evm {}; float64 maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchPUSCHDMRSEVM(instrument, selector_string, timeout, &mean_rms_dmrs_evm, &maximum_peak_dmrs_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_dmrs_evm(mean_rms_dmrs_evm); response->set_maximum_peak_dmrs_evm(maximum_peak_dmrs_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6659,10 +7195,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDMRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); float64* mean_rms_dmrs_evm = response->mutable_mean_rms_dmrs_evm()->mutable_data(); response->mutable_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); @@ -6673,12 +7209,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); response->mutable_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6702,11 +7240,13 @@ namespace nirfmxlte_grpc { float64 mean_rms_data_evm {}; float64 maximum_peak_data_evm {}; auto status = library_->ModAccFetchPUSCHDataEVM(instrument, selector_string, timeout, &mean_rms_data_evm, &maximum_peak_data_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_data_evm(mean_rms_data_evm); response->set_maximum_peak_data_evm(maximum_peak_data_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6729,10 +7269,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDataEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); float64* mean_rms_data_evm = response->mutable_mean_rms_data_evm()->mutable_data(); response->mutable_maximum_peak_data_evm()->Resize(actual_array_size, 0); @@ -6743,12 +7283,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); response->mutable_maximum_peak_data_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6772,10 +7314,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, bits.data(), array_size, &actual_array_size); @@ -6783,8 +7325,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_bits()->Clear(); response->mutable_bits()->Reserve(actual_array_size); std::transform( @@ -6796,7 +7341,6 @@ namespace nirfmxlte_grpc { }); response->mutable_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6820,11 +7364,13 @@ namespace nirfmxlte_grpc { float64 pusch_mean_data_power {}; float64 pusch_mean_dmrs_power {}; auto status = library_->ModAccFetchPUSCHSymbolPower(instrument, selector_string, timeout, &pusch_mean_data_power, &pusch_mean_dmrs_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pusch_mean_data_power(pusch_mean_data_power); response->set_pusch_mean_dmrs_power(pusch_mean_dmrs_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6847,10 +7393,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHSymbolPowerArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); float64* pusch_mean_data_power = response->mutable_pusch_mean_data_power()->mutable_data(); response->mutable_pusch_mean_dmrs_power()->Resize(actual_array_size, 0); @@ -6861,12 +7407,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); response->mutable_pusch_mean_dmrs_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6892,10 +7440,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSMagnitudeErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_magnitude_error_per_symbol()->Resize(actual_array_size, 0); float32* rms_magnitude_error_per_symbol = response->mutable_rms_magnitude_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -6904,13 +7452,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_magnitude_error_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6936,10 +7486,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSPhaseErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_phase_error_per_symbol()->Resize(actual_array_size, 0); float32* rms_phase_error_per_symbol = response->mutable_rms_phase_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -6948,13 +7498,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_phase_error_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6978,10 +7530,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSRSConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector srs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchSRSConstellation(instrument, selector_string, timeout, srs_constellation.data(), array_size, &actual_array_size); @@ -6989,8 +7541,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(srs_constellation, response->mutable_srs_constellation()); { auto shrunk_size = actual_array_size; @@ -7000,7 +7555,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7024,11 +7578,13 @@ namespace nirfmxlte_grpc { float64 mean_rms_srs_evm {}; float64 mean_srs_power {}; auto status = library_->ModAccFetchSRSEVM(instrument, selector_string, timeout, &mean_rms_srs_evm, &mean_srs_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_srs_evm(mean_rms_srs_evm); response->set_mean_srs_power(mean_srs_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7051,10 +7607,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); float64* mean_rms_srs_evm = response->mutable_mean_rms_srs_evm()->mutable_data(); response->mutable_mean_srs_power()->Resize(actual_array_size, 0); @@ -7065,12 +7621,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); response->mutable_mean_srs_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7096,13 +7654,15 @@ namespace nirfmxlte_grpc { float64 range1_maximum_to_range2_minimum {}; float64 range2_maximum_to_range1_minimum {}; auto status = library_->ModAccFetchSpectralFlatness(instrument, selector_string, timeout, &range1_maximum_to_range1_minimum, &range2_maximum_to_range2_minimum, &range1_maximum_to_range2_minimum, &range2_maximum_to_range1_minimum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_range1_maximum_to_range1_minimum(range1_maximum_to_range1_minimum); response->set_range2_maximum_to_range2_minimum(range2_maximum_to_range2_minimum); response->set_range1_maximum_to_range2_minimum(range1_maximum_to_range2_minimum); response->set_range2_maximum_to_range1_minimum(range2_maximum_to_range1_minimum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7125,10 +7685,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSpectralFlatnessArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); float64* range1_maximum_to_range1_minimum = response->mutable_range1_maximum_to_range1_minimum()->mutable_data(); response->mutable_range2_maximum_to_range2_minimum()->Resize(actual_array_size, 0); @@ -7143,14 +7703,16 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); response->mutable_range2_maximum_to_range2_minimum()->Resize(actual_array_size, 0); response->mutable_range1_maximum_to_range2_minimum()->Resize(actual_array_size, 0); response->mutable_range2_maximum_to_range1_minimum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7176,10 +7738,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSpectralFlatnessTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectral_flatness()->Resize(actual_array_size, 0); float32* spectral_flatness = response->mutable_spectral_flatness()->mutable_data(); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); @@ -7192,15 +7754,17 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectral_flatness()->Resize(actual_array_size, 0); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7225,12 +7789,14 @@ namespace nirfmxlte_grpc { float64 subblock_mean_iq_gain_imbalance {}; float64 subblock_mean_iq_quadrature_error {}; auto status = library_->ModAccFetchSubblockIQImpairments(instrument, selector_string, timeout, &subblock_mean_iq_origin_offset, &subblock_mean_iq_gain_imbalance, &subblock_mean_iq_quadrature_error); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_mean_iq_origin_offset(subblock_mean_iq_origin_offset); response->set_subblock_mean_iq_gain_imbalance(subblock_mean_iq_gain_imbalance); response->set_subblock_mean_iq_quadrature_error(subblock_mean_iq_quadrature_error); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7252,10 +7818,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 subblock_in_band_emission_margin {}; auto status = library_->ModAccFetchSubblockInBandEmissionMargin(instrument, selector_string, timeout, &subblock_in_band_emission_margin); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_in_band_emission_margin(subblock_in_band_emission_margin); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7278,10 +7846,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSubblockInBandEmissionTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); float64* subblock_in_band_emission = response->mutable_subblock_in_band_emission()->mutable_data(); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -7294,13 +7862,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); response->mutable_subblock_in_band_emission_rb_indices()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7324,10 +7894,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSynchronizationSignalConstellation(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector sss_constellation(actual_array_size, NIComplexSingle()); std::vector pss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -7336,8 +7906,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); { auto shrunk_size = actual_array_size; @@ -7355,7 +7928,6 @@ namespace nirfmxlte_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7379,11 +7951,13 @@ namespace nirfmxlte_grpc { float64 mean_rms_pss_evm {}; float64 mean_rms_sss_evm {}; auto status = library_->ModAccFetchSynchronizationSignalEVM(instrument, selector_string, timeout, &mean_rms_pss_evm, &mean_rms_sss_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_rms_pss_evm(mean_rms_pss_evm); response->set_mean_rms_sss_evm(mean_rms_sss_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7406,10 +7980,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSynchronizationSignalEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); float64* mean_rms_pss_evm = response->mutable_mean_rms_pss_evm()->mutable_data(); response->mutable_mean_rms_sss_evm()->Resize(actual_array_size, 0); @@ -7420,12 +7994,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_sss_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7479,6 +8055,10 @@ namespace nirfmxlte_grpc { } auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7532,6 +8112,10 @@ namespace nirfmxlte_grpc { } auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7569,6 +8153,10 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7594,13 +8182,15 @@ namespace nirfmxlte_grpc { float64 start_frequency {}; float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &absolute_power, &start_frequency, &stop_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_occupied_bandwidth(occupied_bandwidth); response->set_absolute_power(absolute_power); response->set_start_frequency(start_frequency); response->set_stop_frequency(stop_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7625,10 +8215,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OBWFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -7637,13 +8227,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7697,6 +8289,10 @@ namespace nirfmxlte_grpc { } auto status = library_->PVTCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7733,6 +8329,10 @@ namespace nirfmxlte_grpc { } auto status = library_->PVTCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7755,6 +8355,10 @@ namespace nirfmxlte_grpc { float64 off_power_exclusion_before = request->off_power_exclusion_before(); float64 off_power_exclusion_after = request->off_power_exclusion_after(); auto status = library_->PVTCfgOFFPowerExclusionPeriods(instrument, selector_string, off_power_exclusion_before, off_power_exclusion_after); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7781,15 +8385,17 @@ namespace nirfmxlte_grpc { float64 mean_absolute_on_power {}; float64 burst_width {}; auto status = library_->PVTFetchMeasurement(instrument, selector_string, timeout, &measurement_status, &mean_absolute_off_power_before, &mean_absolute_off_power_after, &mean_absolute_on_power, &burst_width); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_mean_absolute_off_power_before(mean_absolute_off_power_before); response->set_mean_absolute_off_power_after(mean_absolute_off_power_after); response->set_mean_absolute_on_power(mean_absolute_on_power); response->set_burst_width(burst_width); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7812,10 +8418,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_mean_absolute_off_power_before()->Resize(actual_array_size, 0); @@ -7832,8 +8438,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -7849,7 +8458,6 @@ namespace nirfmxlte_grpc { response->mutable_mean_absolute_on_power()->Resize(actual_array_size, 0); response->mutable_burst_width()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7875,10 +8483,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_signal_power()->Resize(actual_array_size, 0); float32* signal_power = response->mutable_signal_power()->mutable_data(); response->mutable_absolute_limit()->Resize(actual_array_size, 0); @@ -7889,14 +8497,16 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_signal_power()->Resize(actual_array_size, 0); response->mutable_absolute_limit()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7918,6 +8528,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7938,6 +8552,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7991,6 +8609,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8012,6 +8634,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 component_carrier_maximum_output_power = request->component_carrier_maximum_output_power(); auto status = library_->SEMCfgComponentCarrierMaximumOutputPower(instrument, selector_string, component_carrier_maximum_output_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8034,6 +8660,10 @@ namespace nirfmxlte_grpc { auto component_carrier_maximum_output_power = const_cast(request->component_carrier_maximum_output_power().data()); int32 number_of_elements = static_cast(request->component_carrier_maximum_output_power().size()); auto status = library_->SEMCfgComponentCarrierMaximumOutputPowerArray(instrument, selector_string, component_carrier_maximum_output_power, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8072,6 +8702,10 @@ namespace nirfmxlte_grpc { float64 delta_f_maximum = request->delta_f_maximum(); float64 aggregated_maximum_power = request->aggregated_maximum_power(); auto status = library_->SEMCfgDownlinkMask(instrument, selector_string, downlink_mask_type, delta_f_maximum, aggregated_maximum_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8093,6 +8727,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8115,6 +8753,10 @@ namespace nirfmxlte_grpc { float64 offset_absolute_limit_start = request->offset_absolute_limit_start(); float64 offset_absolute_limit_stop = request->offset_absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, offset_absolute_limit_start, offset_absolute_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8154,6 +8796,10 @@ namespace nirfmxlte_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, offset_absolute_limit_start, offset_absolute_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8175,6 +8821,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 offset_bandwidth_integral = request->offset_bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, offset_bandwidth_integral); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8197,6 +8847,10 @@ namespace nirfmxlte_grpc { auto offset_bandwidth_integral = const_cast(reinterpret_cast(request->offset_bandwidth_integral().data())); int32 number_of_elements = static_cast(request->offset_bandwidth_integral().size()); auto status = library_->SEMCfgOffsetBandwidthIntegralArray(instrument, selector_string, offset_bandwidth_integral, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8235,6 +8889,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8285,6 +8943,10 @@ namespace nirfmxlte_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8321,6 +8983,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8351,6 +9017,10 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->limit_fail_mask().size()); auto status = library_->SEMCfgOffsetLimitFailMaskArray(instrument, selector_string, limit_fail_mask, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8388,6 +9058,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, offset_rbw, offset_rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8435,6 +9109,10 @@ namespace nirfmxlte_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, offset_rbw, offset_rbw_filter_type, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8457,6 +9135,10 @@ namespace nirfmxlte_grpc { float64 relative_limit_start = request->relative_limit_start(); float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_start, relative_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8496,6 +9178,10 @@ namespace nirfmxlte_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8533,6 +9219,10 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8569,6 +9259,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SEMCfgUplinkMaskType(instrument, selector_string, uplink_mask_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8592,11 +9286,13 @@ namespace nirfmxlte_grpc { float64 absolute_integrated_power {}; float64 relative_integrated_power {}; auto status = library_->SEMFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_integrated_power(absolute_integrated_power); response->set_relative_integrated_power(relative_integrated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8619,10 +9315,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -8633,12 +9329,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8665,15 +9363,17 @@ namespace nirfmxlte_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8696,10 +9396,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -8716,8 +9416,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -8733,7 +9436,6 @@ namespace nirfmxlte_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8760,14 +9462,16 @@ namespace nirfmxlte_grpc { float64 peak_frequency {}; float64 relative_peak_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power, &absolute_peak_power, &peak_frequency, &relative_peak_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_integrated_power(absolute_integrated_power); response->set_relative_integrated_power(relative_integrated_power); response->set_absolute_peak_power(absolute_peak_power); response->set_peak_frequency(peak_frequency); response->set_relative_peak_power(relative_peak_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8790,10 +9494,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -8810,15 +9514,17 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); response->mutable_absolute_peak_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_relative_peak_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8841,11 +9547,13 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8870,10 +9578,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); response->mutable_composite_mask()->Resize(actual_array_size, 0); @@ -8884,14 +9592,16 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->mutable_composite_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8916,12 +9626,14 @@ namespace nirfmxlte_grpc { float64 integration_bandwidth {}; float64 frequency {}; auto status = library_->SEMFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); response->set_frequency(frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8943,10 +9655,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 total_aggregated_power {}; auto status = library_->SEMFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_aggregated_power(total_aggregated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8972,15 +9686,17 @@ namespace nirfmxlte_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9003,10 +9719,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -9023,8 +9739,11 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -9040,7 +9759,6 @@ namespace nirfmxlte_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9067,14 +9785,16 @@ namespace nirfmxlte_grpc { float64 peak_frequency {}; float64 relative_peak_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power, &absolute_peak_power, &peak_frequency, &relative_peak_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_integrated_power(absolute_integrated_power); response->set_relative_integrated_power(relative_integrated_power); response->set_absolute_peak_power(absolute_peak_power); response->set_peak_frequency(peak_frequency); response->set_relative_peak_power(relative_peak_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9097,10 +9817,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9117,15 +9837,17 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); response->mutable_absolute_peak_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_relative_peak_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9163,6 +9885,10 @@ namespace nirfmxlte_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9182,6 +9908,10 @@ namespace nirfmxlte_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9204,6 +9934,10 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9227,6 +9961,10 @@ namespace nirfmxlte_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9249,6 +9987,10 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9272,6 +10014,10 @@ namespace nirfmxlte_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9303,6 +10049,10 @@ namespace nirfmxlte_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9343,6 +10093,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9374,6 +10128,10 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9396,6 +10154,10 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9419,6 +10181,10 @@ namespace nirfmxlte_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9450,6 +10216,10 @@ namespace nirfmxlte_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9493,6 +10263,10 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9519,6 +10293,10 @@ namespace nirfmxlte_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9542,6 +10320,10 @@ namespace nirfmxlte_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9583,6 +10365,10 @@ namespace nirfmxlte_grpc { } auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9614,6 +10400,10 @@ namespace nirfmxlte_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9639,6 +10429,10 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9662,6 +10456,10 @@ namespace nirfmxlte_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9685,6 +10483,10 @@ namespace nirfmxlte_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9707,6 +10509,10 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9730,6 +10536,10 @@ namespace nirfmxlte_grpc { uInt8* attr_val = (uInt8*)request->attr_val().c_str(); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9768,6 +10578,10 @@ namespace nirfmxlte_grpc { int32 measurement_offset = request->measurement_offset(); int32 measurement_length = request->measurement_length(); auto status = library_->SlotPhaseCfgSynchronizationModeAndInterval(instrument, selector_string, synchronization_mode, measurement_offset, measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9790,10 +10604,12 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); float64 maximum_phase_discontinuity {}; auto status = library_->SlotPhaseFetchMaximumPhaseDiscontinuity(instrument, selector_string, timeout, &maximum_phase_discontinuity); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_maximum_phase_discontinuity(maximum_phase_discontinuity); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9816,10 +10632,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchMaximumPhaseDiscontinuityArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); float64* maximum_phase_discontinuity = response->mutable_maximum_phase_discontinuity()->mutable_data(); auto array_size = actual_array_size; @@ -9828,11 +10644,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9856,10 +10674,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchPhaseDiscontinuities(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); float64* slot_phase_discontinuity = response->mutable_slot_phase_discontinuity()->mutable_data(); auto array_size = actual_array_size; @@ -9868,11 +10686,13 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9898,10 +10718,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchSamplePhaseError(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_sample_phase_error()->Resize(actual_array_size, 0); float32* sample_phase_error = response->mutable_sample_phase_error()->mutable_data(); auto array_size = actual_array_size; @@ -9910,13 +10730,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_sample_phase_error()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9942,10 +10764,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchSamplePhaseErrorLinearFitTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_sample_phase_error_linear_fit()->Resize(actual_array_size, 0); float32* sample_phase_error_linear_fit = response->mutable_sample_phase_error_linear_fit()->mutable_data(); auto array_size = actual_array_size; @@ -9954,13 +10776,15 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_sample_phase_error_linear_fit()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9983,6 +10807,10 @@ namespace nirfmxlte_grpc { int32 measurement_offset = request->measurement_offset(); int32 measurement_length = request->measurement_length(); auto status = library_->SlotPowerCfgMeasurementInterval(instrument, selector_string, measurement_offset, measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10006,10 +10834,10 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPowerFetchPowers(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_subframe_power()->Resize(actual_array_size, 0); float64* subframe_power = response->mutable_subframe_power()->mutable_data(); response->mutable_subframe_power_delta()->Resize(actual_array_size, 0); @@ -10020,12 +10848,14 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_subframe_power()->Resize(actual_array_size, 0); response->mutable_subframe_power_delta()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -10046,6 +10876,10 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10067,6 +10901,10 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxlte/nirfmxlte_service.h b/generated/nirfmxlte/nirfmxlte_service.h index 00a5ba968..dafa9303a 100644 --- a/generated/nirfmxlte/nirfmxlte_service.h +++ b/generated/nirfmxlte/nirfmxlte_service.h @@ -332,6 +332,7 @@ class NiRFmxLTEService final : public NiRFmxLTE::Service { NiRFmxLTELibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXIe_DStarB", 12},{"TimerEvent", 13}, }; std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; diff --git a/generated/nirfmxnr/nirfmxnr_service.cpp b/generated/nirfmxnr/nirfmxnr_service.cpp index ff9b1531e..bbfaeeb4e 100644 --- a/generated/nirfmxnr/nirfmxnr_service.cpp +++ b/generated/nirfmxnr/nirfmxnr_service.cpp @@ -92,6 +92,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -128,6 +132,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -164,6 +172,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -185,6 +197,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_endc_offsets = request->number_of_endc_offsets(); auto status = library_->ACPCfgNumberOfENDCOffsets(instrument, selector_string, number_of_endc_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -206,6 +222,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgNumberOfEUTRAOffsets(instrument, selector_string, number_of_eutra_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -227,6 +247,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_nr_offsets = request->number_of_nr_offsets(); auto status = library_->ACPCfgNumberOfNROffsets(instrument, selector_string, number_of_nr_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -248,6 +272,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_utra_offsets = request->number_of_utra_offsets(); auto status = library_->ACPCfgNumberOfUTRAOffsets(instrument, selector_string, number_of_utra_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -284,6 +312,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -337,6 +369,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -374,6 +410,10 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -400,10 +440,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -412,13 +452,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -442,11 +484,13 @@ namespace nirfmxnr_grpc { float64 absolute_power {}; float64 relative_power {}; auto status = library_->ACPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -469,10 +513,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -483,12 +527,14 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -514,13 +560,15 @@ namespace nirfmxnr_grpc { float64 lower_absolute_power {}; float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); response->set_lower_absolute_power(lower_absolute_power); response->set_upper_absolute_power(upper_absolute_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -543,10 +591,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -561,14 +609,16 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_lower_relative_power()->Resize(actual_array_size, 0); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -595,10 +645,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -607,13 +657,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -639,10 +691,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -651,13 +703,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -682,12 +736,14 @@ namespace nirfmxnr_grpc { float64 integration_bandwidth {}; float64 frequency {}; auto status = library_->ACPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); response->set_frequency(frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -709,10 +765,12 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); float64 total_aggregated_power {}; auto status = library_->ACPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_aggregated_power(total_aggregated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -733,11 +791,13 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -757,6 +817,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -784,6 +848,10 @@ namespace nirfmxnr_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -811,6 +879,10 @@ namespace nirfmxnr_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -833,10 +905,12 @@ namespace nirfmxnr_grpc { float64 measurement_interval = request->measurement_interval(); float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_level(reference_level); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -857,10 +931,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildBandwidthPartString(selector_string, bandwidth_part_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -872,11 +946,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -898,10 +974,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCORESETClusterString(selector_string, coreset_cluster_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -913,11 +989,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -939,10 +1017,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCORESETString(selector_string, coreset_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -954,11 +1032,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -980,10 +1060,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -995,11 +1075,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1022,10 +1104,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildListStepString(list_name, result_name, step_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -1037,11 +1119,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -1063,10 +1147,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildListString(list_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -1078,11 +1162,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -1104,10 +1190,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1119,11 +1205,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1145,10 +1233,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDCCHString(selector_string, pdcch_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1160,11 +1248,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1186,10 +1276,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDSCHClusterString(selector_string, pdsch_cluster_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1201,11 +1291,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1227,10 +1319,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDSCHString(selector_string, pdsch_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1242,11 +1334,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1268,10 +1362,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPUSCHClusterString(selector_string, pusch_cluster_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1283,11 +1377,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1309,10 +1405,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPUSCHString(selector_string, pusch_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1324,11 +1420,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1350,10 +1448,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -1365,11 +1463,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -1391,10 +1491,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildSubblockString(selector_string, subblock_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1406,11 +1506,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1432,10 +1534,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildUserString(selector_string, user_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -1447,11 +1549,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -1505,6 +1609,10 @@ namespace nirfmxnr_grpc { } auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1558,6 +1666,10 @@ namespace nirfmxnr_grpc { } auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1595,6 +1707,10 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1618,11 +1734,13 @@ namespace nirfmxnr_grpc { float64 absolute_power {}; float64 relative_power {}; auto status = library_->CHPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1645,10 +1763,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -1659,12 +1777,14 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1690,10 +1810,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1702,13 +1822,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1731,10 +1853,12 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); float64 subblock_power {}; auto status = library_->CHPFetchSubblockPower(instrument, selector_string, timeout, &subblock_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_power(subblock_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1756,10 +1880,12 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); float64 total_aggregated_power {}; auto status = library_->CHPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_aggregated_power(total_aggregated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1780,11 +1906,13 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1842,6 +1970,10 @@ namespace nirfmxnr_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1863,6 +1995,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1884,6 +2020,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1925,6 +2065,10 @@ namespace nirfmxnr_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1998,6 +2142,10 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2035,6 +2183,10 @@ namespace nirfmxnr_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2058,6 +2210,10 @@ namespace nirfmxnr_grpc { float64 reference_level = request->reference_level(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2095,6 +2251,10 @@ namespace nirfmxnr_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2116,6 +2276,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2138,6 +2302,10 @@ namespace nirfmxnr_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2174,6 +2342,10 @@ namespace nirfmxnr_grpc { } auto status = library_->CfggNodeBCategory(instrument, selector_string, gnodeb_category); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2195,10 +2367,12 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2218,6 +2392,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2238,6 +2416,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2258,6 +2440,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2279,6 +2465,10 @@ namespace nirfmxnr_grpc { char* old_signal_name = (char*)request->old_signal_name().c_str(); char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2300,6 +2490,10 @@ namespace nirfmxnr_grpc { int32 force_destroy = request->force_destroy(); session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2320,6 +2514,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2340,6 +2538,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* list_name = (char*)request->list_name().c_str(); auto status = library_->CreateList(instrument, list_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2361,10 +2563,12 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 created_step_index {}; auto status = library_->CreateListStep(instrument, selector_string, &created_step_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_created_step_index(created_step_index); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2384,6 +2588,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2404,6 +2612,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* list_name = (char*)request->list_name().c_str(); auto status = library_->DeleteList(instrument, list_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2424,6 +2636,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2444,6 +2660,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2467,10 +2687,10 @@ namespace nirfmxnr_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -2481,13 +2701,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); response->set_actual_result_names_size(actual_result_names_size); response->set_default_result_exists(default_result_exists); - } return ::grpc::Status::OK; } } @@ -2510,10 +2732,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2536,10 +2760,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -2548,11 +2772,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2575,10 +2801,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2601,10 +2829,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -2613,11 +2841,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2640,10 +2870,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2665,8 +2897,11 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -2674,7 +2909,6 @@ namespace nirfmxnr_grpc { }; response->set_attr_val(checked_convert_attr_val(attr_val)); response->set_attr_val_raw(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2697,10 +2931,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -2709,8 +2943,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -2727,7 +2964,6 @@ namespace nirfmxnr_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2750,10 +2986,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2776,10 +3014,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2788,11 +3026,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2815,10 +3055,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2841,10 +3083,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2852,8 +3094,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -2865,7 +3110,6 @@ namespace nirfmxnr_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2889,10 +3133,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2900,8 +3144,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -2911,7 +3158,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2935,10 +3181,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2946,8 +3192,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -2957,7 +3206,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2981,10 +3229,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string attr_val; @@ -2996,11 +3244,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); - } return ::grpc::Status::OK; } } @@ -3023,10 +3273,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3048,10 +3300,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3074,10 +3328,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -3086,11 +3340,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3114,10 +3370,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -3126,11 +3382,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3153,10 +3411,12 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3179,10 +3439,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -3190,12 +3450,14 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3217,10 +3479,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; int32 error_code {}; @@ -3233,12 +3495,14 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -3261,10 +3525,10 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; std::string error_description; @@ -3276,11 +3540,13 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -3310,15 +3576,13 @@ namespace nirfmxnr_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXNR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3346,14 +3610,12 @@ namespace nirfmxnr_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXNR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3374,6 +3636,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3395,6 +3661,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->ModAccAutoLevel(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3431,6 +3701,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ModAccCfgMeasurementMode(instrument, selector_string, measurement_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3467,6 +3741,10 @@ namespace nirfmxnr_grpc { } auto status = library_->ModAccCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3491,6 +3769,10 @@ namespace nirfmxnr_grpc { auto reference_waveform = convert_from_grpc(request->reference_waveform()); int32 array_size = static_cast(request->reference_waveform().size()); auto status = library_->ModAccCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3510,6 +3792,10 @@ namespace nirfmxnr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ModAccClearNoiseCalibrationDatabase(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3533,11 +3819,13 @@ namespace nirfmxnr_grpc { float64 composite_rms_evm_mean {}; float64 composite_peak_evm_maximum {}; auto status = library_->ModAccFetchCompositeEVM(instrument, selector_string, timeout, &composite_rms_evm_mean, &composite_peak_evm_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_composite_rms_evm_mean(composite_rms_evm_mean); response->set_composite_peak_evm_maximum(composite_peak_evm_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3559,10 +3847,12 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); float64 frequency_error_mean {}; auto status = library_->ModAccFetchFrequencyErrorMean(instrument, selector_string, timeout, &frequency_error_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency_error_mean(frequency_error_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3587,10 +3877,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchIQGainImbalancePerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_gain_imbalance_per_subcarrier_mean = response->mutable_iq_gain_imbalance_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3599,13 +3889,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3631,10 +3923,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_quadrature_error_per_subcarrier_mean = response->mutable_iq_quadrature_error_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3643,13 +3935,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3675,10 +3969,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchInBandEmissionTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_in_band_emission()->Resize(actual_array_size, 0); float32* in_band_emission = response->mutable_in_band_emission()->mutable_data(); response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -3689,14 +3983,16 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_in_band_emission()->Resize(actual_array_size, 0); response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3720,10 +4016,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pbch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPBCHDMRSConstellationTrace(instrument, selector_string, timeout, pbch_dmrs_constellation.data(), array_size, &actual_array_size); @@ -3731,8 +4027,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pbch_dmrs_constellation, response->mutable_pbch_dmrs_constellation()); { auto shrunk_size = actual_array_size; @@ -3742,7 +4041,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3768,10 +4066,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pbch_dmrs_rms_evm_per_subcarrier_mean = response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3780,13 +4078,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3812,10 +4112,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pbch_dmrs_rms_evm_per_symbol_mean = response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3824,13 +4124,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3854,10 +4156,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pbch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPBCHDataConstellationTrace(instrument, selector_string, timeout, pbch_data_constellation.data(), array_size, &actual_array_size); @@ -3865,8 +4167,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pbch_data_constellation, response->mutable_pbch_data_constellation()); { auto shrunk_size = actual_array_size; @@ -3876,7 +4181,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3902,10 +4206,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pbch_data_rms_evm_per_subcarrier_mean = response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3914,13 +4218,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3946,10 +4252,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pbch_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pbch_data_rms_evm_per_symbol_mean = response->mutable_pbch_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3958,13 +4264,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_pbch_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3988,10 +4296,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH1024QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam1024_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH1024QAMConstellationTrace(instrument, selector_string, timeout, qam1024_constellation.data(), array_size, &actual_array_size); @@ -3999,8 +4307,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); { auto shrunk_size = actual_array_size; @@ -4010,7 +4321,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4034,10 +4344,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH16QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam16_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH16QAMConstellationTrace(instrument, selector_string, timeout, qam16_constellation.data(), array_size, &actual_array_size); @@ -4045,8 +4355,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); { auto shrunk_size = actual_array_size; @@ -4056,7 +4369,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4080,10 +4392,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH256QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam256_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH256QAMConstellationTrace(instrument, selector_string, timeout, qam256_constellation.data(), array_size, &actual_array_size); @@ -4091,8 +4403,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); { auto shrunk_size = actual_array_size; @@ -4102,7 +4417,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4126,10 +4440,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH64QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qam64_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH64QAMConstellationTrace(instrument, selector_string, timeout, qam64_constellation.data(), array_size, &actual_array_size); @@ -4137,8 +4451,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); { auto shrunk_size = actual_array_size; @@ -4148,7 +4465,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4172,10 +4488,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH8PSKConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector psk8_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH8PSKConstellationTrace(instrument, selector_string, timeout, psk8_constellation.data(), array_size, &actual_array_size); @@ -4183,8 +4499,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(psk8_constellation, response->mutable_psk8_constellation()); { auto shrunk_size = actual_array_size; @@ -4194,7 +4513,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4218,10 +4536,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pdsch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHDMRSConstellationTrace(instrument, selector_string, timeout, pdsch_dmrs_constellation.data(), array_size, &actual_array_size); @@ -4229,8 +4547,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pdsch_dmrs_constellation, response->mutable_pdsch_dmrs_constellation()); { auto shrunk_size = actual_array_size; @@ -4240,7 +4561,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4264,10 +4584,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pdsch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHDataConstellationTrace(instrument, selector_string, timeout, pdsch_data_constellation.data(), array_size, &actual_array_size); @@ -4275,8 +4595,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pdsch_data_constellation, response->mutable_pdsch_data_constellation()); { auto shrunk_size = actual_array_size; @@ -4286,7 +4609,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4310,10 +4632,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHDemodulatedBits(instrument, selector_string, timeout, bits.data(), array_size, &actual_array_size); @@ -4321,8 +4643,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_bits()->Clear(); response->mutable_bits()->Reserve(actual_array_size); std::transform( @@ -4334,7 +4659,6 @@ namespace nirfmxnr_grpc { }); response->mutable_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4358,10 +4682,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHPTRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pdsch_ptrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHPTRSConstellationTrace(instrument, selector_string, timeout, pdsch_ptrs_constellation.data(), array_size, &actual_array_size); @@ -4369,8 +4693,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pdsch_ptrs_constellation, response->mutable_pdsch_ptrs_constellation()); { auto shrunk_size = actual_array_size; @@ -4380,7 +4707,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4404,10 +4730,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHQPSKConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector qpsk_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHQPSKConstellationTrace(instrument, selector_string, timeout, qpsk_constellation.data(), array_size, &actual_array_size); @@ -4415,8 +4741,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); { auto shrunk_size = actual_array_size; @@ -4426,7 +4755,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4450,10 +4778,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPSSConstellationTrace(instrument, selector_string, timeout, pss_constellation.data(), array_size, &actual_array_size); @@ -4461,8 +4789,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pss_constellation, response->mutable_pss_constellation()); { auto shrunk_size = actual_array_size; @@ -4472,7 +4803,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4498,10 +4828,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pss_rms_evm_per_subcarrier_mean = response->mutable_pss_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4510,13 +4840,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_pss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4542,10 +4874,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_pss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pss_rms_evm_per_symbol_mean = response->mutable_pss_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4554,13 +4886,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_pss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4584,10 +4918,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pusch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDMRSConstellationTrace(instrument, selector_string, timeout, pusch_dmrs_constellation.data(), array_size, &actual_array_size); @@ -4595,8 +4929,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pusch_dmrs_constellation, response->mutable_pusch_dmrs_constellation()); { auto shrunk_size = actual_array_size; @@ -4606,7 +4943,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4630,10 +4966,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pusch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDataConstellationTrace(instrument, selector_string, timeout, pusch_data_constellation.data(), array_size, &actual_array_size); @@ -4641,8 +4977,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pusch_data_constellation, response->mutable_pusch_data_constellation()); { auto shrunk_size = actual_array_size; @@ -4652,7 +4991,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4676,10 +5014,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, bits.data(), array_size, &actual_array_size); @@ -4687,8 +5025,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_bits()->Clear(); response->mutable_bits()->Reserve(actual_array_size); std::transform( @@ -4700,7 +5041,6 @@ namespace nirfmxnr_grpc { }); response->mutable_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4724,10 +5064,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHPTRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pusch_ptrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHPTRSConstellationTrace(instrument, selector_string, timeout, pusch_ptrs_constellation.data(), array_size, &actual_array_size); @@ -4735,8 +5075,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pusch_ptrs_constellation, response->mutable_pusch_ptrs_constellation()); { auto shrunk_size = actual_array_size; @@ -4746,7 +5089,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4772,10 +5114,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPeakEVMPerSlotMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_peak_evm_per_slot_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_slot_maximum = response->mutable_peak_evm_per_slot_maximum()->mutable_data(); auto array_size = actual_array_size; @@ -4784,13 +5126,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_peak_evm_per_slot_maximum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4816,10 +5160,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPeakEVMPerSubcarrierMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_peak_evm_per_subcarrier_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_subcarrier_maximum = response->mutable_peak_evm_per_subcarrier_maximum()->mutable_data(); auto array_size = actual_array_size; @@ -4828,13 +5172,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_peak_evm_per_subcarrier_maximum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4860,10 +5206,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPeakEVMPerSymbolMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_peak_evm_per_symbol_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_symbol_maximum = response->mutable_peak_evm_per_symbol_maximum()->mutable_data(); auto array_size = actual_array_size; @@ -4872,13 +5218,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_peak_evm_per_symbol_maximum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4904,10 +5252,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMHighPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_high_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_high_per_symbol_mean = response->mutable_rms_evm_high_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4916,13 +5264,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_high_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4948,10 +5298,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMLowPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_low_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_low_per_symbol_mean = response->mutable_rms_evm_low_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4960,13 +5310,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_low_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4992,10 +5344,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMPerSlotMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_per_slot_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_slot_mean = response->mutable_rms_evm_per_slot_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5004,13 +5356,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_per_slot_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5036,10 +5390,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_subcarrier_mean = response->mutable_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5048,13 +5402,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5080,10 +5436,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_symbol_mean = response->mutable_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5092,13 +5448,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5122,10 +5480,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSSSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector sss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchSSSConstellationTrace(instrument, selector_string, timeout, sss_constellation.data(), array_size, &actual_array_size); @@ -5133,8 +5491,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); { auto shrunk_size = actual_array_size; @@ -5144,7 +5505,6 @@ namespace nirfmxnr_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5170,10 +5530,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSSSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_sss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* sss_rms_evm_per_subcarrier_mean = response->mutable_sss_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5182,13 +5542,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_sss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5214,10 +5576,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSSSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_sss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* sss_rms_evm_per_symbol_mean = response->mutable_sss_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5226,13 +5588,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_sss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5258,10 +5622,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSpectralFlatnessTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectral_flatness()->Resize(actual_array_size, 0); float32* spectral_flatness = response->mutable_spectral_flatness()->mutable_data(); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); @@ -5274,15 +5638,17 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectral_flatness()->Resize(actual_array_size, 0); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5306,10 +5672,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSubblockInBandEmissionTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); float64* subblock_in_band_emission = response->mutable_subblock_in_band_emission()->mutable_data(); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -5322,13 +5688,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); response->mutable_subblock_in_band_emission_rb_indices()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5350,11 +5718,13 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 calibration_data_valid {}; auto status = library_->ModAccValidateCalibrationData(instrument, selector_string, &calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_calibration_data_valid(static_cast(calibration_data_valid)); response->set_calibration_data_valid_raw(calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5407,6 +5777,10 @@ namespace nirfmxnr_grpc { } auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5460,6 +5834,10 @@ namespace nirfmxnr_grpc { } auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5497,6 +5875,10 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5522,13 +5904,15 @@ namespace nirfmxnr_grpc { float64 start_frequency {}; float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &absolute_power, &start_frequency, &stop_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_occupied_bandwidth(occupied_bandwidth); response->set_absolute_power(absolute_power); response->set_start_frequency(start_frequency); response->set_stop_frequency(stop_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5553,10 +5937,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OBWFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -5565,13 +5949,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5625,6 +6011,10 @@ namespace nirfmxnr_grpc { } auto status = library_->PVTCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5661,6 +6051,10 @@ namespace nirfmxnr_grpc { } auto status = library_->PVTCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5683,6 +6077,10 @@ namespace nirfmxnr_grpc { float64 off_power_exclusion_before = request->off_power_exclusion_before(); float64 off_power_exclusion_after = request->off_power_exclusion_after(); auto status = library_->PVTCfgOFFPowerExclusionPeriods(instrument, selector_string, off_power_exclusion_before, off_power_exclusion_after); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5709,15 +6107,17 @@ namespace nirfmxnr_grpc { float64 absolute_on_power {}; float64 burst_width {}; auto status = library_->PVTFetchMeasurement(instrument, selector_string, timeout, &measurement_status, &absolute_off_power_before, &absolute_off_power_after, &absolute_on_power, &burst_width); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_absolute_off_power_before(absolute_off_power_before); response->set_absolute_off_power_after(absolute_off_power_after); response->set_absolute_on_power(absolute_on_power); response->set_burst_width(burst_width); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5740,10 +6140,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_absolute_off_power_before()->Resize(actual_array_size, 0); @@ -5760,8 +6160,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -5777,7 +6180,6 @@ namespace nirfmxnr_grpc { response->mutable_absolute_on_power()->Resize(actual_array_size, 0); response->mutable_burst_width()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5803,10 +6205,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_signal_power()->Resize(actual_array_size, 0); float32* signal_power = response->mutable_signal_power()->mutable_data(); response->mutable_absolute_limit()->Resize(actual_array_size, 0); @@ -5817,14 +6219,16 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_signal_power()->Resize(actual_array_size, 0); response->mutable_absolute_limit()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5850,10 +6254,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchWindowedSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_windowed_signal_power()->Resize(actual_array_size, 0); float32* windowed_signal_power = response->mutable_windowed_signal_power()->mutable_data(); auto array_size = actual_array_size; @@ -5862,13 +6266,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_windowed_signal_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5890,6 +6296,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5910,6 +6320,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5963,6 +6377,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5984,6 +6402,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 component_carrier_rated_output_power = request->component_carrier_rated_output_power(); auto status = library_->SEMCfgComponentCarrierRatedOutputPower(instrument, selector_string, component_carrier_rated_output_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6006,6 +6428,10 @@ namespace nirfmxnr_grpc { auto component_carrier_rated_output_power = const_cast(request->component_carrier_rated_output_power().data()); int32 number_of_elements = static_cast(request->component_carrier_rated_output_power().size()); auto status = library_->SEMCfgComponentCarrierRatedOutputPowerArray(instrument, selector_string, component_carrier_rated_output_power, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6027,6 +6453,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6049,6 +6479,10 @@ namespace nirfmxnr_grpc { float64 absolute_limit_start = request->absolute_limit_start(); float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, absolute_limit_start, absolute_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6088,6 +6522,10 @@ namespace nirfmxnr_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, absolute_limit_start, absolute_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6109,6 +6547,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 bandwidth_integral = request->bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, bandwidth_integral); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6131,6 +6573,10 @@ namespace nirfmxnr_grpc { auto bandwidth_integral = const_cast(reinterpret_cast(request->bandwidth_integral().data())); int32 number_of_elements = static_cast(request->bandwidth_integral().size()); auto status = library_->SEMCfgOffsetBandwidthIntegralArray(instrument, selector_string, bandwidth_integral, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6169,6 +6615,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6219,6 +6669,10 @@ namespace nirfmxnr_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6255,6 +6709,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6285,6 +6743,10 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->limit_fail_mask().size()); auto status = library_->SEMCfgOffsetLimitFailMaskArray(instrument, selector_string, limit_fail_mask, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6322,6 +6784,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, offset_rbw, offset_rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6369,6 +6835,10 @@ namespace nirfmxnr_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, offset_rbw, offset_rbw_filter_type, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6391,6 +6861,10 @@ namespace nirfmxnr_grpc { float64 relative_limit_start = request->relative_limit_start(); float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_start, relative_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6430,6 +6904,10 @@ namespace nirfmxnr_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6467,6 +6945,10 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6503,6 +6985,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SEMCfgUplinkMaskType(instrument, selector_string, uplink_mask_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6528,13 +7014,15 @@ namespace nirfmxnr_grpc { float64 peak_frequency {}; float64 relative_power {}; auto status = library_->SEMFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &peak_absolute_power, &peak_frequency, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6557,10 +7045,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); @@ -6575,14 +7063,16 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6609,15 +7099,17 @@ namespace nirfmxnr_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6640,10 +7132,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -6660,8 +7152,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -6677,7 +7172,6 @@ namespace nirfmxnr_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6704,14 +7198,16 @@ namespace nirfmxnr_grpc { float64 peak_frequency {}; float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_peak_relative_power(peak_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6734,10 +7230,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -6754,15 +7250,17 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_peak_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6785,11 +7283,13 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6814,10 +7314,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); response->mutable_composite_mask()->Resize(actual_array_size, 0); @@ -6828,14 +7328,16 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->mutable_composite_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6860,12 +7362,14 @@ namespace nirfmxnr_grpc { float64 integration_bandwidth {}; float64 frequency {}; auto status = library_->SEMFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); response->set_frequency(frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6887,10 +7391,12 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); float64 total_aggregated_power {}; auto status = library_->SEMFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_aggregated_power(total_aggregated_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6916,15 +7422,17 @@ namespace nirfmxnr_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6947,10 +7455,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -6967,8 +7475,11 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -6984,7 +7495,6 @@ namespace nirfmxnr_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7011,14 +7521,16 @@ namespace nirfmxnr_grpc { float64 peak_frequency {}; float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_peak_relative_power(peak_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7041,10 +7553,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7061,15 +7573,17 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_peak_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7107,6 +7621,10 @@ namespace nirfmxnr_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7126,6 +7644,10 @@ namespace nirfmxnr_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7148,6 +7670,10 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7171,6 +7697,10 @@ namespace nirfmxnr_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7193,6 +7723,10 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7216,6 +7750,10 @@ namespace nirfmxnr_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7247,6 +7785,10 @@ namespace nirfmxnr_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7287,6 +7829,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7318,6 +7864,10 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7340,6 +7890,10 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7363,6 +7917,10 @@ namespace nirfmxnr_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7394,6 +7952,10 @@ namespace nirfmxnr_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7437,6 +7999,10 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7463,6 +8029,10 @@ namespace nirfmxnr_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7486,6 +8056,10 @@ namespace nirfmxnr_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7527,6 +8101,10 @@ namespace nirfmxnr_grpc { } auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7558,6 +8136,10 @@ namespace nirfmxnr_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7583,6 +8165,10 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7606,6 +8192,10 @@ namespace nirfmxnr_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7629,6 +8219,10 @@ namespace nirfmxnr_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7651,6 +8245,10 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7674,6 +8272,10 @@ namespace nirfmxnr_grpc { uInt8* attr_val = (uInt8*)request->attr_val().c_str(); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7697,11 +8299,13 @@ namespace nirfmxnr_grpc { float64 average_power_mean {}; float64 peak_power_maximum {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_power_mean, &peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_power_mean(average_power_mean); response->set_peak_power_maximum(peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7726,10 +8330,10 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -7738,13 +8342,15 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7765,6 +8371,10 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7786,6 +8396,10 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxnr/nirfmxnr_service.h b/generated/nirfmxnr/nirfmxnr_service.h index 8a2d938ee..d77c11230 100644 --- a/generated/nirfmxnr/nirfmxnr_service.h +++ b/generated/nirfmxnr/nirfmxnr_service.h @@ -264,6 +264,7 @@ class NiRFmxNRService final : public NiRFmxNR::Service { NiRFmxNRLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXIe_DStarB", 12},{"TimerEvent", 13}, }; std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"},{5, "RefIn2"},{6, "PXI_Clk_Master"}, }; diff --git a/generated/nirfmxspecan/nirfmxspecan_service.cpp b/generated/nirfmxspecan/nirfmxspecan_service.cpp index 1e06aeb6b..bef5de60b 100644 --- a/generated/nirfmxspecan/nirfmxspecan_service.cpp +++ b/generated/nirfmxspecan/nirfmxspecan_service.cpp @@ -92,6 +92,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -115,6 +119,10 @@ namespace nirfmxspecan_grpc { int32 number_of_offsets = request->number_of_offsets(); float64 channel_spacing = request->channel_spacing(); auto status = library_->ACPCfgCarrierAndOffsets(instrument, selector_string, integration_bandwidth, number_of_offsets, channel_spacing); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -136,6 +144,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 carrier_frequency = request->carrier_frequency(); auto status = library_->ACPCfgCarrierFrequency(instrument, selector_string, carrier_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -157,6 +169,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->ACPCfgCarrierIntegrationBandwidth(instrument, selector_string, integration_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -193,6 +209,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgCarrierMode(instrument, selector_string, carrier_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -230,6 +250,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->ACPCfgCarrierRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -267,6 +291,10 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->ACPCfgFFT(instrument, selector_string, fft_window, fft_padding); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -303,6 +331,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -339,6 +371,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -360,6 +396,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_carriers = request->number_of_carriers(); auto status = library_->ACPCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -381,6 +421,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_offsets = request->number_of_offsets(); auto status = library_->ACPCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -434,6 +478,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgOffset(instrument, selector_string, offset_frequency, offset_sideband, offset_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -492,6 +540,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->ACPCfgOffsetArray(instrument, selector_string, offset_frequency, offset_sideband, offset_enabled, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -528,6 +580,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgOffsetFrequencyDefinition(instrument, selector_string, offset_frequency_definition); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -549,6 +605,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->ACPCfgOffsetIntegrationBandwidth(instrument, selector_string, integration_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -571,6 +631,10 @@ namespace nirfmxspecan_grpc { auto integration_bandwidth = const_cast(request->integration_bandwidth().data()); int32 number_of_elements = static_cast(request->integration_bandwidth().size()); auto status = library_->ACPCfgOffsetIntegrationBandwidthArray(instrument, selector_string, integration_bandwidth, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -608,6 +672,10 @@ namespace nirfmxspecan_grpc { int32 offset_reference_specific = request->offset_reference_specific(); auto status = library_->ACPCfgOffsetPowerReference(instrument, selector_string, offset_reference_carrier, offset_reference_specific); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -655,6 +723,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->ACPCfgOffsetPowerReferenceArray(instrument, selector_string, offset_power_reference_carrier, offset_power_reference_specific, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -692,6 +764,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->ACPCfgOffsetRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -739,6 +815,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->ACPCfgOffsetRRCFilterArray(instrument, selector_string, rrc_filter_enabled, rrc_alpha, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -760,6 +840,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 relative_attenuation = request->relative_attenuation(); auto status = library_->ACPCfgOffsetRelativeAttenuation(instrument, selector_string, relative_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -782,6 +866,10 @@ namespace nirfmxspecan_grpc { auto relative_attenuation = const_cast(request->relative_attenuation().data()); int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->ACPCfgOffsetRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -818,6 +906,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -871,6 +963,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -908,6 +1004,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -934,10 +1034,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -946,13 +1046,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -978,13 +1080,15 @@ namespace nirfmxspecan_grpc { float64 carrier_offset {}; float64 integration_bandwidth {}; auto status = library_->ACPFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &total_relative_power, &carrier_offset, &integration_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_total_relative_power(total_relative_power); response->set_carrier_offset(carrier_offset); response->set_integration_bandwidth(integration_bandwidth); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1006,10 +1110,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 frequency_resolution {}; auto status = library_->ACPFetchFrequencyResolution(instrument, selector_string, timeout, &frequency_resolution); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency_resolution(frequency_resolution); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1034,13 +1140,15 @@ namespace nirfmxspecan_grpc { float64 lower_absolute_power {}; float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); response->set_lower_absolute_power(lower_absolute_power); response->set_upper_absolute_power(upper_absolute_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1063,10 +1171,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -1081,14 +1189,16 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_lower_relative_power()->Resize(actual_array_size, 0); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1115,10 +1225,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -1127,13 +1237,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1159,10 +1271,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1171,13 +1283,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1200,10 +1314,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 total_carrier_power {}; auto status = library_->ACPFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_carrier_power(total_carrier_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1229,14 +1345,16 @@ namespace nirfmxspecan_grpc { float64 offset_ch1_lower_relative_power {}; float64 offset_ch1_upper_relative_power {}; auto status = library_->ACPRead(instrument, selector_string, timeout, &carrier_absolute_power, &offset_ch0_lower_relative_power, &offset_ch0_upper_relative_power, &offset_ch1_lower_relative_power, &offset_ch1_upper_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_carrier_absolute_power(carrier_absolute_power); response->set_offset_ch0_lower_relative_power(offset_ch0_lower_relative_power); response->set_offset_ch0_upper_relative_power(offset_ch0_upper_relative_power); response->set_offset_ch1_lower_relative_power(offset_ch1_lower_relative_power); response->set_offset_ch1_upper_relative_power(offset_ch1_upper_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1257,11 +1375,13 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1298,6 +1418,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->AMPMCfgAMToAMCurveFit(instrument, selector_string, am_to_am_curve_fit_order, am_to_am_curve_fit_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1335,6 +1459,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->AMPMCfgAMToPMCurveFit(instrument, selector_string, am_to_pm_curve_fit_order, am_to_pm_curve_fit_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1372,6 +1500,10 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->AMPMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1410,6 +1542,10 @@ namespace nirfmxspecan_grpc { auto compression_level = const_cast(request->compression_level().data()); int32 array_size = static_cast(request->compression_level().size()); auto status = library_->AMPMCfgCompressionPoints(instrument, selector_string, compression_point_enabled, compression_level, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1431,6 +1567,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 dut_average_input_power = request->dut_average_input_power(); auto status = library_->AMPMCfgDUTAverageInputPower(instrument, selector_string, dut_average_input_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1452,6 +1592,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->AMPMCfgMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1489,6 +1633,10 @@ namespace nirfmxspecan_grpc { float64 sample_rate = request->sample_rate(); auto status = library_->AMPMCfgMeasurementSampleRate(instrument, selector_string, sample_rate_mode, sample_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1525,6 +1673,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->AMPMCfgReferencePowerType(instrument, selector_string, reference_power_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1581,6 +1733,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->AMPMCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size, idle_duration_present, signal_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1617,6 +1773,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->AMPMCfgSynchronizationMethod(instrument, selector_string, synchronization_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1670,6 +1830,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->AMPMCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1693,10 +1857,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchAMToAMTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_reference_powers()->Resize(actual_array_size, 0); float32* reference_powers = response->mutable_reference_powers()->mutable_data(); response->mutable_measured_am_to_am()->Resize(actual_array_size, 0); @@ -1709,13 +1873,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_reference_powers()->Resize(actual_array_size, 0); response->mutable_measured_am_to_am()->Resize(actual_array_size, 0); response->mutable_curve_fit_am_to_am()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1739,10 +1905,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchAMToPMTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_reference_powers()->Resize(actual_array_size, 0); float32* reference_powers = response->mutable_reference_powers()->mutable_data(); response->mutable_measured_am_to_pm()->Resize(actual_array_size, 0); @@ -1755,13 +1921,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_reference_powers()->Resize(actual_array_size, 0); response->mutable_measured_am_to_pm()->Resize(actual_array_size, 0); response->mutable_curve_fit_am_to_pm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1785,10 +1953,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchCompressionPoints(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_input_compression_point()->Resize(actual_array_size, 0); float64* input_compression_point = response->mutable_input_compression_point()->mutable_data(); response->mutable_output_compression_point()->Resize(actual_array_size, 0); @@ -1799,12 +1967,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_input_compression_point()->Resize(actual_array_size, 0); response->mutable_output_compression_point()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1828,10 +1998,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchCurveFitCoefficients(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); float32* am_to_am_coefficients = response->mutable_am_to_am_coefficients()->mutable_data(); response->mutable_am_to_pm_coefficients()->Resize(actual_array_size, 0); @@ -1842,12 +2012,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); response->mutable_am_to_pm_coefficients()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1871,11 +2043,13 @@ namespace nirfmxspecan_grpc { float64 am_to_am_residual {}; float64 am_to_pm_residual {}; auto status = library_->AMPMFetchCurveFitResidual(instrument, selector_string, timeout, &am_to_am_residual, &am_to_pm_residual); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_am_to_am_residual(am_to_am_residual); response->set_am_to_pm_residual(am_to_pm_residual); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1899,12 +2073,14 @@ namespace nirfmxspecan_grpc { float64 one_db_compression_point {}; float64 mean_rms_evm {}; auto status = library_->AMPMFetchDUTCharacteristics(instrument, selector_string, timeout, &mean_linear_gain, &one_db_compression_point, &mean_rms_evm); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_linear_gain(mean_linear_gain); response->set_one_db_compression_point(one_db_compression_point); response->set_mean_rms_evm(mean_rms_evm); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1928,12 +2104,14 @@ namespace nirfmxspecan_grpc { float64 phase_error_range {}; float64 mean_phase_error {}; auto status = library_->AMPMFetchError(instrument, selector_string, timeout, &gain_error_range, &phase_error_range, &mean_phase_error); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_gain_error_range(gain_error_range); response->set_phase_error_range(phase_error_range); response->set_mean_phase_error(mean_phase_error); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1958,10 +2136,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector processed_mean_acquired_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->AMPMFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, processed_mean_acquired_waveform.data(), array_size, &actual_array_size); @@ -1969,8 +2147,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); convert_to_grpc(processed_mean_acquired_waveform, response->mutable_processed_mean_acquired_waveform()); @@ -1982,7 +2163,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2008,10 +2188,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector processed_reference_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->AMPMFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, processed_reference_waveform.data(), array_size, &actual_array_size); @@ -2019,8 +2199,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); convert_to_grpc(processed_reference_waveform, response->mutable_processed_reference_waveform()); @@ -2032,7 +2215,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2058,10 +2240,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchRelativePhaseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_relative_phase()->Resize(actual_array_size, 0); float32* relative_phase = response->mutable_relative_phase()->mutable_data(); auto array_size = actual_array_size; @@ -2070,13 +2252,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_relative_phase()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2102,10 +2286,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchRelativePowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_relative_power()->Resize(actual_array_size, 0); float32* relative_power = response->mutable_relative_power()->mutable_data(); auto array_size = actual_array_size; @@ -2114,13 +2298,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2141,6 +2327,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2168,6 +2358,10 @@ namespace nirfmxspecan_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2195,6 +2389,10 @@ namespace nirfmxspecan_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2218,10 +2416,12 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, bandwidth, measurement_interval, &reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_level(reference_level); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2242,10 +2442,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2257,11 +2457,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2283,10 +2485,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildHarmonicString(selector_string, harmonic_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2298,11 +2500,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2324,10 +2528,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildIntermodString(selector_string, intermod_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2339,11 +2543,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2366,10 +2572,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildListStepString(list_name, result_name, step_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -2381,11 +2587,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -2407,10 +2615,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildListString(list_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -2422,11 +2630,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -2448,10 +2658,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildMarkerString(selector_string, marker_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2463,11 +2673,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2489,10 +2701,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2504,11 +2716,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2532,10 +2746,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildRangeSpurString(signal_name, result_name, range_number, spur_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -2547,11 +2761,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -2573,10 +2789,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildRangeString(selector_string, range_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2588,11 +2804,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2614,10 +2832,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSegmentString(selector_string, segment_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2629,11 +2847,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2655,10 +2875,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -2670,11 +2890,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -2696,10 +2918,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSpurString(selector_string, spur_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -2711,11 +2933,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -2737,6 +2961,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->CCDFCfgMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2758,6 +2986,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_records = request->number_of_records(); auto status = library_->CCDFCfgNumberOfRecords(instrument, selector_string, number_of_records); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2796,6 +3028,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->CCDFCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2849,6 +3085,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->CCDFCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2876,15 +3116,17 @@ namespace nirfmxspecan_grpc { float64 one_thousandth_percent_power {}; float64 one_ten_thousandth_percent_power {}; auto status = library_->CCDFFetchBasicPowerProbabilities(instrument, selector_string, timeout, &ten_percent_power, &one_percent_power, &one_tenth_percent_power, &one_hundredth_percent_power, &one_thousandth_percent_power, &one_ten_thousandth_percent_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ten_percent_power(ten_percent_power); response->set_one_percent_power(one_percent_power); response->set_one_tenth_percent_power(one_tenth_percent_power); response->set_one_hundredth_percent_power(one_hundredth_percent_power); response->set_one_thousandth_percent_power(one_thousandth_percent_power); response->set_one_ten_thousandth_percent_power(one_ten_thousandth_percent_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2909,10 +3151,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CCDFFetchGaussianProbabilitiesTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_gaussian_probabilities()->Resize(actual_array_size, 0); float32* gaussian_probabilities = response->mutable_gaussian_probabilities()->mutable_data(); auto array_size = actual_array_size; @@ -2921,13 +3163,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_gaussian_probabilities()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2953,13 +3197,15 @@ namespace nirfmxspecan_grpc { float64 peak_power {}; int32 measured_samples_count {}; auto status = library_->CCDFFetchPower(instrument, selector_string, timeout, &mean_power, &mean_power_percentile, &peak_power, &measured_samples_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_power(mean_power); response->set_mean_power_percentile(mean_power_percentile); response->set_peak_power(peak_power); response->set_measured_samples_count(measured_samples_count); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2984,10 +3230,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CCDFFetchProbabilitiesTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_probabilities()->Resize(actual_array_size, 0); float32* probabilities = response->mutable_probabilities()->mutable_data(); auto array_size = actual_array_size; @@ -2996,13 +3242,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_probabilities()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3028,13 +3276,15 @@ namespace nirfmxspecan_grpc { float64 peak_power {}; int32 measured_samples_count {}; auto status = library_->CCDFRead(instrument, selector_string, timeout, &mean_power, &mean_power_percentile, &peak_power, &measured_samples_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_power(mean_power); response->set_mean_power_percentile(mean_power_percentile); response->set_peak_power(peak_power); response->set_measured_samples_count(measured_samples_count); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3087,7 +3337,11 @@ namespace nirfmxspecan_grpc { } auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); - response->set_status(status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3108,6 +3362,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 carrier_frequency = request->carrier_frequency(); auto status = library_->CHPCfgCarrierOffset(instrument, selector_string, carrier_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3145,6 +3403,10 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->CHPCfgFFT(instrument, selector_string, fft_window, fft_padding); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3166,6 +3428,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->CHPCfgIntegrationBandwidth(instrument, selector_string, integration_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3187,6 +3453,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_carriers = request->number_of_carriers(); auto status = library_->CHPCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3240,6 +3510,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3277,6 +3551,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->CHPCfgRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3298,6 +3576,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 span = request->span(); auto status = library_->CHPCfgSpan(instrument, selector_string, span); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3335,6 +3617,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3359,12 +3645,14 @@ namespace nirfmxspecan_grpc { float64 psd {}; float64 relative_power {}; auto status = library_->CHPFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &psd, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_psd(psd); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3389,10 +3677,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -3401,13 +3689,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3430,10 +3720,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 total_carrier_power {}; auto status = library_->CHPFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_carrier_power(total_carrier_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3456,11 +3748,13 @@ namespace nirfmxspecan_grpc { float64 absolute_power {}; float64 psd {}; auto status = library_->CHPRead(instrument, selector_string, timeout, &absolute_power, &psd); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_psd(psd); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3481,11 +3775,13 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3543,6 +3839,10 @@ namespace nirfmxspecan_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3564,6 +3864,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3585,6 +3889,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3626,6 +3934,10 @@ namespace nirfmxspecan_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3683,6 +3995,10 @@ namespace nirfmxspecan_grpc { float64 trigger_min_quiet_time_duration = request->trigger_min_quiet_time_duration(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_level, iq_power_edge_slope, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3720,6 +4036,10 @@ namespace nirfmxspecan_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3743,6 +4063,10 @@ namespace nirfmxspecan_grpc { float64 reference_level = request->reference_level(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3780,6 +4104,10 @@ namespace nirfmxspecan_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3801,6 +4129,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3823,6 +4155,10 @@ namespace nirfmxspecan_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3844,10 +4180,12 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3867,6 +4205,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3887,6 +4229,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3907,6 +4253,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3928,6 +4278,10 @@ namespace nirfmxspecan_grpc { char* old_signal_name = (char*)request->old_signal_name().c_str(); char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3949,6 +4303,10 @@ namespace nirfmxspecan_grpc { int32 force_destroy = request->force_destroy(); session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3969,6 +4327,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3989,6 +4351,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* list_name = (char*)request->list_name().c_str(); auto status = library_->CreateList(instrument, list_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4010,10 +4376,12 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 created_step_index {}; auto status = library_->CreateListStep(instrument, selector_string, &created_step_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_created_step_index(created_step_index); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4033,6 +4401,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4080,10 +4452,10 @@ namespace nirfmxspecan_grpc { float64 power_offset {}; while (true) { auto status = library_->DPDApplyDigitalPredistortion(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, measurement_timeout, &x0_out, &dx_out, nullptr, 0, &actual_array_size, &papr, &power_offset); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector waveform_out(actual_array_size, NIComplexSingle()); auto array_size_out = actual_array_size; status = library_->DPDApplyDigitalPredistortion(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, measurement_timeout, &x0_out, &dx_out, waveform_out.data(), array_size_out, &actual_array_size, &papr, &power_offset); @@ -4091,8 +4463,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0_out(x0_out); response->set_dx_out(dx_out); convert_to_grpc(waveform_out, response->mutable_waveform_out()); @@ -4106,7 +4481,6 @@ namespace nirfmxspecan_grpc { response->set_actual_array_size(actual_array_size); response->set_papr(papr); response->set_power_offset(power_offset); - } return ::grpc::Status::OK; } } @@ -4152,10 +4526,10 @@ namespace nirfmxspecan_grpc { float64 papr {}; while (true) { auto status = library_->DPDApplyPreDPDSignalConditioning(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, &x0_out, &dx_out, nullptr, 0, &actual_array_size, &papr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector waveform_out(actual_array_size, NIComplexSingle()); auto array_size_out = actual_array_size; status = library_->DPDApplyPreDPDSignalConditioning(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, &x0_out, &dx_out, waveform_out.data(), array_size_out, &actual_array_size, &papr); @@ -4163,8 +4537,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0_out(x0_out); response->set_dx_out(dx_out); convert_to_grpc(waveform_out, response->mutable_waveform_out()); @@ -4177,7 +4554,6 @@ namespace nirfmxspecan_grpc { } response->set_actual_array_size(actual_array_size); response->set_papr(papr); - } return ::grpc::Status::OK; } } @@ -4214,6 +4590,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgApplyDPDConfigurationInput(instrument, selector_string, configuration_input); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4250,6 +4630,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgApplyDPDLookupTableCorrectionType(instrument, selector_string, lut_correction_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4286,6 +4670,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgApplyDPDMemoryModelCorrectionType(instrument, selector_string, memory_model_correction_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4308,6 +4696,10 @@ namespace nirfmxspecan_grpc { auto dpd_polynomial = convert_from_grpc(request->dpd_polynomial()); int32 array_size = static_cast(request->dpd_polynomial().size()); auto status = library_->DPDCfgApplyDPDUserDPDPolynomial(instrument, selector_string, dpd_polynomial.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4347,6 +4739,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->DPDCfgApplyDPDUserLookupTable(instrument, selector_string, lut_input_powers, lut_complex_gains.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4384,6 +4780,10 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->DPDCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4420,6 +4820,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgDPDModel(instrument, selector_string, dpd_model); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4441,6 +4845,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 dut_average_input_power = request->dut_average_input_power(); auto status = library_->DPDCfgDUTAverageInputPower(instrument, selector_string, dut_average_input_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4467,6 +4875,10 @@ namespace nirfmxspecan_grpc { int32 memory_polynomial_maximum_lead = request->memory_polynomial_maximum_lead(); int32 memory_polynomial_maximum_lag = request->memory_polynomial_maximum_lag(); auto status = library_->DPDCfgGeneralizedMemoryPolynomialCrossTerms(instrument, selector_string, memory_polynomial_lead_order, memory_polynomial_lag_order, memory_polynomial_lead_memory_depth, memory_polynomial_lag_memory_depth, memory_polynomial_maximum_lead, memory_polynomial_maximum_lag); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4503,6 +4915,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgIterativeDPDEnabled(instrument, selector_string, iterative_dpd_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4540,6 +4956,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgLookupTableAMToAMCurveFit(instrument, selector_string, am_to_am_curve_fit_order, am_to_am_curve_fit_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4577,6 +4997,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgLookupTableAMToPMCurveFit(instrument, selector_string, am_to_pm_curve_fit_order, am_to_pm_curve_fit_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4598,6 +5022,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 step_size = request->step_size(); auto status = library_->DPDCfgLookupTableStepSize(instrument, selector_string, step_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4651,6 +5079,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgLookupTableThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4687,6 +5119,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgLookupTableType(instrument, selector_string, lookup_table_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4708,6 +5144,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->DPDCfgMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4745,6 +5185,10 @@ namespace nirfmxspecan_grpc { float64 sample_rate = request->sample_rate(); auto status = library_->DPDCfgMeasurementSampleRate(instrument, selector_string, sample_rate_mode, sample_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4767,6 +5211,10 @@ namespace nirfmxspecan_grpc { int32 memory_polynomial_order = request->memory_polynomial_order(); int32 memory_polynomial_memory_depth = request->memory_polynomial_memory_depth(); auto status = library_->DPDCfgMemoryPolynomial(instrument, selector_string, memory_polynomial_order, memory_polynomial_memory_depth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4789,6 +5237,10 @@ namespace nirfmxspecan_grpc { auto previous_dpd_polynomial = convert_from_grpc(request->previous_dpd_polynomial()); int32 array_size = static_cast(request->previous_dpd_polynomial().size()); auto status = library_->DPDCfgPreviousDPDPolynomial(instrument, selector_string, previous_dpd_polynomial.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4845,6 +5297,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size, idle_duration_present, signal_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4881,6 +5337,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->DPDCfgSynchronizationMethod(instrument, selector_string, synchronization_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -4903,10 +5363,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 pre_cfr_papr {}; auto status = library_->DPDFetchApplyDPDPreCFRPAPR(instrument, selector_string, timeout, &pre_cfr_papr); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pre_cfr_papr(pre_cfr_papr); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4928,10 +5390,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 average_gain {}; auto status = library_->DPDFetchAverageGain(instrument, selector_string, timeout, &average_gain); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_gain(average_gain); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4954,10 +5418,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchDPDPolynomial(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector dpd_polynomial(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DPDFetchDPDPolynomial(instrument, selector_string, timeout, dpd_polynomial.data(), array_size, &actual_array_size); @@ -4965,8 +5429,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(dpd_polynomial, response->mutable_dpd_polynomial()); { auto shrunk_size = actual_array_size; @@ -4976,7 +5443,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5000,10 +5466,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchLookupTable(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_input_powers()->Resize(actual_array_size, 0); float32* input_powers = response->mutable_input_powers()->mutable_data(); std::vector complex_gains(actual_array_size, NIComplexSingle()); @@ -5013,8 +5479,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_input_powers()->Resize(actual_array_size, 0); convert_to_grpc(complex_gains, response->mutable_complex_gains()); { @@ -5025,7 +5494,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5048,10 +5516,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 nmse {}; auto status = library_->DPDFetchNMSE(instrument, selector_string, timeout, &nmse); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_nmse(nmse); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5076,10 +5546,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector processed_mean_acquired_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DPDFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, processed_mean_acquired_waveform.data(), array_size, &actual_array_size); @@ -5087,8 +5557,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); convert_to_grpc(processed_mean_acquired_waveform, response->mutable_processed_mean_acquired_waveform()); @@ -5100,7 +5573,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5126,10 +5598,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector processed_reference_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DPDFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, processed_reference_waveform.data(), array_size, &actual_array_size); @@ -5137,8 +5609,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); convert_to_grpc(processed_reference_waveform, response->mutable_processed_reference_waveform()); @@ -5150,7 +5625,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5171,6 +5645,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* list_name = (char*)request->list_name().c_str(); auto status = library_->DeleteList(instrument, list_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5191,6 +5669,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5211,6 +5693,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5264,6 +5750,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->FCntCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5285,6 +5775,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->FCntCfgMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5323,6 +5817,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->FCntCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5376,6 +5874,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->FCntCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -5398,10 +5900,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 allan_deviation {}; auto status = library_->FCntFetchAllanDeviation(instrument, selector_string, timeout, &allan_deviation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_allan_deviation(allan_deviation); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5426,10 +5930,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FCntFetchFrequencyTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_frequency_trace()->Resize(actual_array_size, 0); float32* frequency_trace = response->mutable_frequency_trace()->mutable_data(); auto array_size = actual_array_size; @@ -5438,13 +5942,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_frequency_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5469,12 +5975,14 @@ namespace nirfmxspecan_grpc { float64 average_absolute_frequency {}; float64 mean_phase {}; auto status = library_->FCntFetchMeasurement(instrument, selector_string, timeout, &average_relative_frequency, &average_absolute_frequency, &mean_phase); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_relative_frequency(average_relative_frequency); response->set_average_absolute_frequency(average_absolute_frequency); response->set_mean_phase(mean_phase); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5499,10 +6007,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FCntFetchPhaseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_phase_trace()->Resize(actual_array_size, 0); float32* phase_trace = response->mutable_phase_trace()->mutable_data(); auto array_size = actual_array_size; @@ -5511,13 +6019,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_phase_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5543,10 +6053,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FCntFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power_trace()->Resize(actual_array_size, 0); float32* power_trace = response->mutable_power_trace()->mutable_data(); auto array_size = actual_array_size; @@ -5555,13 +6065,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power_trace()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5586,12 +6098,14 @@ namespace nirfmxspecan_grpc { float64 average_absolute_frequency {}; float64 mean_phase {}; auto status = library_->FCntRead(instrument, selector_string, timeout, &average_relative_frequency, &average_absolute_frequency, &mean_phase); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_relative_frequency(average_relative_frequency); response->set_average_absolute_frequency(average_absolute_frequency); response->set_mean_phase(mean_phase); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5614,10 +6128,10 @@ namespace nirfmxspecan_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -5628,13 +6142,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); response->set_actual_result_names_size(actual_result_names_size); response->set_default_result_exists(default_result_exists); - } return ::grpc::Status::OK; } } @@ -5657,10 +6173,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5683,10 +6201,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -5695,11 +6213,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5722,10 +6242,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5748,10 +6270,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -5760,11 +6282,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5787,10 +6311,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5812,8 +6338,11 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -5821,7 +6350,6 @@ namespace nirfmxspecan_grpc { }; response->set_attr_val(checked_convert_attr_val(attr_val)); response->set_attr_val_raw(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5844,10 +6372,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -5856,8 +6384,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -5874,7 +6405,6 @@ namespace nirfmxspecan_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5897,10 +6427,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5923,10 +6455,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -5935,11 +6467,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5962,10 +6496,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5988,10 +6524,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -5999,8 +6535,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -6012,7 +6551,6 @@ namespace nirfmxspecan_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6036,10 +6574,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -6047,8 +6585,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -6058,7 +6599,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6082,10 +6622,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -6093,8 +6633,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -6104,7 +6647,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6128,10 +6670,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string attr_val; @@ -6143,11 +6685,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); - } return ::grpc::Status::OK; } } @@ -6170,10 +6714,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6195,10 +6741,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6221,10 +6769,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -6233,11 +6781,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6261,10 +6811,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -6273,11 +6823,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6300,10 +6852,12 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6326,10 +6880,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -6337,12 +6891,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6364,10 +6920,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; int32 error_code {}; @@ -6380,12 +6936,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -6408,10 +6966,10 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; std::string error_description; @@ -6423,11 +6981,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -6464,6 +7024,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->HarmCfgAutoHarmonics(instrument, selector_string, auto_harmonics_setup_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6517,6 +7081,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->HarmCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6538,6 +7106,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->HarmCfgFundamentalMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6576,6 +7148,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->HarmCfgFundamentalRBW(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6615,6 +7191,10 @@ namespace nirfmxspecan_grpc { float64 harmonic_measurement_interval = request->harmonic_measurement_interval(); auto status = library_->HarmCfgHarmonic(instrument, selector_string, harmonic_order, harmonic_bandwidth, harmonic_enabled, harmonic_measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6668,6 +7248,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->HarmCfgHarmonicArray(instrument, selector_string, harmonic_order, harmonic_bandwidth, harmonic_enabled, harmonic_measurement_interval, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6689,6 +7273,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_harmonics = request->number_of_harmonics(); auto status = library_->HarmCfgNumberOfHarmonics(instrument, selector_string, number_of_harmonics); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6714,13 +7302,15 @@ namespace nirfmxspecan_grpc { float64 rbw {}; float64 frequency {}; auto status = library_->HarmFetchHarmonicMeasurement(instrument, selector_string, timeout, &average_relative_power, &average_absolute_power, &rbw, &frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_relative_power(average_relative_power); response->set_average_absolute_power(average_absolute_power); response->set_rbw(rbw); response->set_frequency(frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6743,10 +7333,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->HarmFetchHarmonicMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_average_relative_power()->Resize(actual_array_size, 0); float64* average_relative_power = response->mutable_average_relative_power()->mutable_data(); response->mutable_average_absolute_power()->Resize(actual_array_size, 0); @@ -6761,14 +7351,16 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_average_relative_power()->Resize(actual_array_size, 0); response->mutable_average_absolute_power()->Resize(actual_array_size, 0); response->mutable_rbw()->Resize(actual_array_size, 0); response->mutable_frequency()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6794,10 +7386,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->HarmFetchHarmonicPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -6806,13 +7398,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6837,12 +7431,14 @@ namespace nirfmxspecan_grpc { float64 average_fundamental_power {}; float64 fundamental_frequency {}; auto status = library_->HarmFetchTHD(instrument, selector_string, timeout, &total_harmonic_distortion, &average_fundamental_power, &fundamental_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_harmonic_distortion(total_harmonic_distortion); response->set_average_fundamental_power(average_fundamental_power); response->set_fundamental_frequency(fundamental_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6865,11 +7461,13 @@ namespace nirfmxspecan_grpc { float64 total_harmonic_distortion {}; float64 average_fundamental_power {}; auto status = library_->HarmRead(instrument, selector_string, timeout, &total_harmonic_distortion, &average_fundamental_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_harmonic_distortion(total_harmonic_distortion); response->set_average_fundamental_power(average_fundamental_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6906,6 +7504,10 @@ namespace nirfmxspecan_grpc { int32 maximum_intermod_order = request->maximum_intermod_order(); auto status = library_->IMCfgAutoIntermodsSetup(instrument, selector_string, auto_intermods_setup_enabled, maximum_intermod_order); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6959,6 +7561,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->IMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6996,6 +7602,10 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->IMCfgFFT(instrument, selector_string, fft_window, fft_padding); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7032,6 +7642,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->IMCfgFrequencyDefinition(instrument, selector_string, frequency_definition); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7054,6 +7668,10 @@ namespace nirfmxspecan_grpc { float64 lower_tone_frequency = request->lower_tone_frequency(); float64 upper_tone_frequency = request->upper_tone_frequency(); auto status = library_->IMCfgFundamentalTones(instrument, selector_string, lower_tone_frequency, upper_tone_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7109,6 +7727,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->IMCfgIntermod(instrument, selector_string, intermod_order, lower_intermod_frequency, upper_intermod_frequency, intermod_side, intermod_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7173,6 +7795,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->IMCfgIntermodArray(instrument, selector_string, intermod_order, lower_intermod_frequency, upper_intermod_frequency, intermod_side, intermod_enabled, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7209,6 +7835,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->IMCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7230,6 +7860,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_intermods = request->number_of_intermods(); auto status = library_->IMCfgNumberOfIntermods(instrument, selector_string, number_of_intermods); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7283,6 +7917,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->IMCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7320,6 +7958,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->IMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7343,11 +7985,13 @@ namespace nirfmxspecan_grpc { float64 lower_tone_power {}; float64 upper_tone_power {}; auto status = library_->IMFetchFundamentalMeasurement(instrument, selector_string, timeout, &lower_tone_power, &upper_tone_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_lower_tone_power(lower_tone_power); response->set_upper_tone_power(upper_tone_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7372,13 +8016,15 @@ namespace nirfmxspecan_grpc { float64 lower_output_intercept_power {}; float64 upper_output_intercept_power {}; auto status = library_->IMFetchInterceptPower(instrument, selector_string, timeout, &intermod_order, &worst_case_output_intercept_power, &lower_output_intercept_power, &upper_output_intercept_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_intermod_order(intermod_order); response->set_worst_case_output_intercept_power(worst_case_output_intercept_power); response->set_lower_output_intercept_power(lower_output_intercept_power); response->set_upper_output_intercept_power(upper_output_intercept_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7401,10 +8047,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IMFetchInterceptPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_intermod_order()->Resize(actual_array_size, 0); int32* intermod_order = reinterpret_cast(response->mutable_intermod_order()->mutable_data()); response->mutable_worst_case_output_intercept_power()->Resize(actual_array_size, 0); @@ -7419,14 +8065,16 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_intermod_order()->Resize(actual_array_size, 0); response->mutable_worst_case_output_intercept_power()->Resize(actual_array_size, 0); response->mutable_lower_output_intercept_power()->Resize(actual_array_size, 0); response->mutable_upper_output_intercept_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7451,12 +8099,14 @@ namespace nirfmxspecan_grpc { float64 lower_intermod_power {}; float64 upper_intermod_power {}; auto status = library_->IMFetchIntermodMeasurement(instrument, selector_string, timeout, &intermod_order, &lower_intermod_power, &upper_intermod_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_intermod_order(intermod_order); response->set_lower_intermod_power(lower_intermod_power); response->set_upper_intermod_power(upper_intermod_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7479,10 +8129,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IMFetchIntermodMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_intermod_order()->Resize(actual_array_size, 0); int32* intermod_order = reinterpret_cast(response->mutable_intermod_order()->mutable_data()); response->mutable_lower_intermod_power()->Resize(actual_array_size, 0); @@ -7495,13 +8145,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_intermod_order()->Resize(actual_array_size, 0); response->mutable_lower_intermod_power()->Resize(actual_array_size, 0); response->mutable_upper_intermod_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7528,10 +8180,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IMFetchSpectrum(instrument, selector_string, timeout, spectrum_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -7540,13 +8192,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7571,6 +8225,10 @@ namespace nirfmxspecan_grpc { float64 acquisition_time = request->acquisition_time(); float64 pretrigger_time = request->pretrigger_time(); auto status = library_->IQCfgAcquisition(instrument, selector_string, sample_rate, number_of_records, acquisition_time, pretrigger_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7608,6 +8266,10 @@ namespace nirfmxspecan_grpc { float64 bandwidth = request->bandwidth(); auto status = library_->IQCfgBandwidth(instrument, selector_string, bandwidth_auto, bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7635,10 +8297,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IQFetchData(instrument, selector_string, timeout, record_to_fetch, samples_to_read, &t0, &dt, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector data(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->IQFetchData(instrument, selector_string, timeout, record_to_fetch, samples_to_read, &t0, &dt, data.data(), array_size, &actual_array_size); @@ -7646,8 +8308,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_t0(t0); response->set_dt(dt); convert_to_grpc(data, response->mutable_data()); @@ -7659,7 +8324,6 @@ namespace nirfmxspecan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7681,10 +8345,12 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 records_done {}; auto status = library_->IQGetRecordsDone(instrument, selector_string, &records_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_records_done(records_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7713,15 +8379,13 @@ namespace nirfmxspecan_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXSPECAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7749,14 +8413,12 @@ namespace nirfmxspecan_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXSPECAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7777,6 +8439,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7798,6 +8464,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_markers = request->number_of_markers(); auto status = library_->MarkerCfgNumberOfMarkers(instrument, selector_string, number_of_markers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7835,6 +8505,10 @@ namespace nirfmxspecan_grpc { float64 peak_excursion = request->peak_excursion(); auto status = library_->MarkerCfgPeakExcursion(instrument, selector_string, peak_excursion_enabled, peak_excursion); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7856,6 +8530,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 reference_marker = request->reference_marker(); auto status = library_->MarkerCfgReferenceMarker(instrument, selector_string, reference_marker); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7893,6 +8571,10 @@ namespace nirfmxspecan_grpc { float64 threshold = request->threshold(); auto status = library_->MarkerCfgThreshold(instrument, selector_string, threshold_enabled, threshold); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7929,6 +8611,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->MarkerCfgTrace(instrument, selector_string, trace); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7965,6 +8651,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->MarkerCfgType(instrument, selector_string, marker_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7986,6 +8676,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 marker_x_location = request->marker_x_location(); auto status = library_->MarkerCfgXLocation(instrument, selector_string, marker_x_location); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8008,11 +8702,13 @@ namespace nirfmxspecan_grpc { float64 marker_x_location {}; float64 marker_y_location {}; auto status = library_->MarkerFetchXY(instrument, selector_string, &marker_x_location, &marker_y_location); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_marker_x_location(marker_x_location); response->set_marker_y_location(marker_y_location); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8049,10 +8745,12 @@ namespace nirfmxspecan_grpc { int32 next_peak_found {}; auto status = library_->MarkerNextPeak(instrument, selector_string, next_peak, &next_peak_found); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_next_peak_found(next_peak_found); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8073,10 +8771,12 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_peaks {}; auto status = library_->MarkerPeakSearch(instrument, selector_string, &number_of_peaks); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_peaks(number_of_peaks); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8113,6 +8813,10 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->NFCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8169,6 +8873,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgCalibrationLoss(instrument, selector_string, calibration_loss_compensation_enabled, calibration_loss_frequency, calibration_loss, calibration_loss_temperature, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8217,6 +8925,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgColdSourceDUTSParameters(instrument, selector_string, dut_s_parameters_frequency, dut_s21, dut_s12, dut_s11, dut_s22, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8257,6 +8969,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgColdSourceInputTermination(instrument, selector_string, termination_vswr, termination_vswr_frequency, termination_temperature, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8293,6 +9009,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->NFCfgColdSourceMode(instrument, selector_string, cold_source_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8349,6 +9069,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgDUTInputLoss(instrument, selector_string, dut_input_loss_compensation_enabled, dut_input_loss_frequency, dut_input_loss, dut_input_loss_temperature, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8405,6 +9129,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgDUTOutputLoss(instrument, selector_string, dut_output_loss_compensation_enabled, dut_output_loss_frequency, dut_output_loss, dut_output_loss_temperature, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8427,6 +9155,10 @@ namespace nirfmxspecan_grpc { auto frequency_list = const_cast(request->frequency_list().data()); int32 array_size = static_cast(request->frequency_list().size()); auto status = library_->NFCfgFrequencyList(instrument, selector_string, frequency_list, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8450,6 +9182,10 @@ namespace nirfmxspecan_grpc { float64 stop_frequency = request->stop_frequency(); int32 number_of_points = request->number_of_points(); auto status = library_->NFCfgFrequencyListStartStopPoints(instrument, selector_string, start_frequency, stop_frequency, number_of_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8473,6 +9209,10 @@ namespace nirfmxspecan_grpc { float64 stop_frequency = request->stop_frequency(); float64 step_size = request->step_size(); auto status = library_->NFCfgFrequencyListStartStopStep(instrument, selector_string, start_frequency, stop_frequency, step_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8494,6 +9234,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_bandwidth = request->measurement_bandwidth(); auto status = library_->NFCfgMeasurementBandwidth(instrument, selector_string, measurement_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8515,6 +9259,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->NFCfgMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8551,6 +9299,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->NFCfgMeasurementMethod(instrument, selector_string, measurement_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8587,6 +9339,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->NFCfgYFactorMode(instrument, selector_string, y_factor_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8628,6 +9384,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgYFactorNoiseSourceENR(instrument, selector_string, enr_frequency, enr, cold_temperature, off_temperature, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8684,6 +9444,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->NFCfgYFactorNoiseSourceLoss(instrument, selector_string, noise_source_loss_compensation_enabled, noise_source_loss_frequency, noise_source_loss, noise_source_loss_temperature, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8705,6 +9469,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 settling_time = request->settling_time(); auto status = library_->NFCfgYFactorNoiseSourceSettlingTime(instrument, selector_string, settling_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8725,6 +9493,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* calibration_setup_id = (char*)request->calibration_setup_id().c_str(); auto status = library_->NFClearCalibrationDatabase(instrument, calibration_setup_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -8748,10 +9520,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchAnalyzerNoiseFigure(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); float64* analyzer_noise_figure = response->mutable_analyzer_noise_figure()->mutable_data(); auto array_size = actual_array_size; @@ -8760,11 +9532,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8788,10 +9562,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchColdSourcePower(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_cold_source_power()->Resize(actual_array_size, 0); float64* cold_source_power = response->mutable_cold_source_power()->mutable_data(); auto array_size = actual_array_size; @@ -8800,11 +9574,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_cold_source_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8828,10 +9604,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchDUTNoiseFigureAndGain(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); float64* dut_noise_figure = response->mutable_dut_noise_figure()->mutable_data(); response->mutable_dut_noise_temperature()->Resize(actual_array_size, 0); @@ -8844,13 +9620,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); response->mutable_dut_noise_temperature()->Resize(actual_array_size, 0); response->mutable_dut_gain()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8874,10 +9652,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchYFactorPowers(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_hot_power()->Resize(actual_array_size, 0); float64* hot_power = response->mutable_hot_power()->mutable_data(); response->mutable_cold_power()->Resize(actual_array_size, 0); @@ -8888,12 +9666,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_hot_power()->Resize(actual_array_size, 0); response->mutable_cold_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8917,10 +9697,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchYFactors(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); float64* measurement_y_factor = response->mutable_measurement_y_factor()->mutable_data(); response->mutable_calibration_y_factor()->Resize(actual_array_size, 0); @@ -8931,12 +9711,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); response->mutable_calibration_y_factor()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -8960,10 +9742,12 @@ namespace nirfmxspecan_grpc { float64 dut_max_noise_figure = request->dut_max_noise_figure(); float64 reference_level {}; auto status = library_->NFRecommendReferenceLevel(instrument, selector_string, dut_max_gain, dut_max_noise_figure, &reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_reference_level(reference_level); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8984,11 +9768,13 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 calibration_data_valid {}; auto status = library_->NFValidateCalibrationData(instrument, selector_string, &calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_calibration_data_valid(static_cast(calibration_data_valid)); response->set_calibration_data_valid_raw(calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9041,6 +9827,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9062,6 +9852,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 bandwidth_percentage = request->bandwidth_percentage(); auto status = library_->OBWCfgBandwidthPercentage(instrument, selector_string, bandwidth_percentage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9099,6 +9893,10 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->OBWCfgFFT(instrument, selector_string, fft_window, fft_padding); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9135,6 +9933,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->OBWCfgPowerUnits(instrument, selector_string, power_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9188,6 +9990,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9209,6 +10015,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 span = request->span(); auto status = library_->OBWCfgSpan(instrument, selector_string, span); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9246,6 +10056,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9272,14 +10086,16 @@ namespace nirfmxspecan_grpc { float64 start_frequency {}; float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &average_power, &frequency_resolution, &start_frequency, &stop_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_occupied_bandwidth(occupied_bandwidth); response->set_average_power(average_power); response->set_frequency_resolution(frequency_resolution); response->set_start_frequency(start_frequency); response->set_stop_frequency(stop_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9304,10 +10120,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OBWFetchSpectrumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -9316,13 +10132,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9349,14 +10167,16 @@ namespace nirfmxspecan_grpc { float64 start_frequency {}; float64 stop_frequency {}; auto status = library_->OBWRead(instrument, selector_string, timeout, &occupied_bandwidth, &average_power, &frequency_resolution, &start_frequency, &stop_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_occupied_bandwidth(occupied_bandwidth); response->set_average_power(average_power); response->set_frequency_resolution(frequency_resolution); response->set_start_frequency(start_frequency); response->set_stop_frequency(stop_frequency); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9377,6 +10197,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_bandwidth = request->measurement_bandwidth(); auto status = library_->PAVTCfgMeasurementBandwidth(instrument, selector_string, measurement_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9399,6 +10223,10 @@ namespace nirfmxspecan_grpc { float64 measurement_offset = request->measurement_offset(); float64 measurement_length = request->measurement_length(); auto status = library_->PAVTCfgMeasurementInterval(instrument, selector_string, measurement_offset, measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9435,6 +10263,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->PAVTCfgMeasurementIntervalMode(instrument, selector_string, measurement_interval_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9471,6 +10303,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->PAVTCfgMeasurementLocationType(instrument, selector_string, measurement_location_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9492,6 +10328,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_segments = request->number_of_segments(); auto status = library_->PAVTCfgNumberOfSegments(instrument, selector_string, number_of_segments); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9514,6 +10354,10 @@ namespace nirfmxspecan_grpc { float64 segment_measurement_offset = request->segment_measurement_offset(); float64 segment_measurement_length = request->segment_measurement_length(); auto status = library_->PAVTCfgSegmentMeasurementInterval(instrument, selector_string, segment_measurement_offset, segment_measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9553,6 +10397,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->PAVTCfgSegmentMeasurementIntervalArray(instrument, selector_string, segment_measurement_offset, segment_measurement_length, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9575,6 +10423,10 @@ namespace nirfmxspecan_grpc { auto segment_start_time = const_cast(request->segment_start_time().data()); int32 number_of_elements = static_cast(request->segment_start_time().size()); auto status = library_->PAVTCfgSegmentStartTimeList(instrument, selector_string, segment_start_time, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9598,6 +10450,10 @@ namespace nirfmxspecan_grpc { float64 segment0_start_time = request->segment0_start_time(); float64 segment_interval = request->segment_interval(); auto status = library_->PAVTCfgSegmentStartTimeStep(instrument, selector_string, number_of_segments, segment0_start_time, segment_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9634,6 +10490,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->PAVTCfgSegmentType(instrument, selector_string, segment_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9664,6 +10524,10 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->segment_type().size()); auto status = library_->PAVTCfgSegmentTypeArray(instrument, selector_string, segment_type, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9690,10 +10554,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PAVTFetchAmplitudeTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_amplitude()->Resize(actual_array_size, 0); float32* amplitude = response->mutable_amplitude()->mutable_data(); auto array_size = actual_array_size; @@ -9702,13 +10566,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_amplitude()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9734,13 +10600,15 @@ namespace nirfmxspecan_grpc { float64 mean_absolute_phase {}; float64 mean_absolute_amplitude {}; auto status = library_->PAVTFetchPhaseAndAmplitude(instrument, selector_string, timeout, &mean_relative_phase, &mean_relative_amplitude, &mean_absolute_phase, &mean_absolute_amplitude); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mean_relative_phase(mean_relative_phase); response->set_mean_relative_amplitude(mean_relative_amplitude); response->set_mean_absolute_phase(mean_absolute_phase); response->set_mean_absolute_amplitude(mean_absolute_amplitude); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9763,10 +10631,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PAVTFetchPhaseAndAmplitudeArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); float64* mean_relative_phase = response->mutable_mean_relative_phase()->mutable_data(); response->mutable_mean_relative_amplitude()->Resize(actual_array_size, 0); @@ -9781,14 +10649,16 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); response->mutable_mean_relative_amplitude()->Resize(actual_array_size, 0); response->mutable_mean_absolute_phase()->Resize(actual_array_size, 0); response->mutable_mean_absolute_amplitude()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9815,10 +10685,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PAVTFetchPhaseTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_phase()->Resize(actual_array_size, 0); float32* phase = response->mutable_phase()->mutable_data(); auto array_size = actual_array_size; @@ -9827,13 +10697,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_phase()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -9857,6 +10729,10 @@ namespace nirfmxspecan_grpc { float64 stop_frequency = request->stop_frequency(); float64 rbw_percentage = request->rbw_percentage(); auto status = library_->PhaseNoiseCfgAutoRange(instrument, selector_string, start_frequency, stop_frequency, rbw_percentage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9878,6 +10754,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 averaging_multiplier = request->averaging_multiplier(); auto status = library_->PhaseNoiseCfgAveragingMultiplier(instrument, selector_string, averaging_multiplier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9934,6 +10814,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->PhaseNoiseCfgCancellation(instrument, selector_string, cancellation_enabled, cancellation_threshold, frequency, reference_phase_noise, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -9989,6 +10873,10 @@ namespace nirfmxspecan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->PhaseNoiseCfgIntegratedNoise(instrument, selector_string, integrated_noise_range_definition, integrated_noise_start_frequency, integrated_noise_stop_frequency, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10010,6 +10898,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_ranges = request->number_of_ranges(); auto status = library_->PhaseNoiseCfgNumberOfRanges(instrument, selector_string, number_of_ranges); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10055,6 +10947,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->PhaseNoiseCfgRangeArray(instrument, selector_string, range_start_frequency, range_stop_frequency, range_rbw_percentage, range_averaging_count, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10091,6 +10987,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->PhaseNoiseCfgRangeDefinition(instrument, selector_string, range_definition); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10128,6 +11028,10 @@ namespace nirfmxspecan_grpc { float64 smoothing_percentage = request->smoothing_percentage(); auto status = library_->PhaseNoiseCfgSmoothing(instrument, selector_string, smoothing_type, smoothing_percentage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10150,6 +11054,10 @@ namespace nirfmxspecan_grpc { auto frequency_list = const_cast(request->frequency_list().data()); int32 array_size = static_cast(request->frequency_list().size()); auto status = library_->PhaseNoiseCfgSpotNoiseFrequencyList(instrument, selector_string, frequency_list, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10187,6 +11095,10 @@ namespace nirfmxspecan_grpc { float64 peak_excursion = request->peak_excursion(); auto status = library_->PhaseNoiseCfgSpurRemoval(instrument, selector_string, spur_removal_enabled, peak_excursion); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10210,11 +11122,13 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency {}; float64 carrier_power {}; auto status = library_->PhaseNoiseFetchCarrierMeasurement(instrument, selector_string, timeout, &carrier_frequency, &carrier_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_carrier_frequency(carrier_frequency); response->set_carrier_power(carrier_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10237,10 +11151,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchIntegratedNoise(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); float64* integrated_phase_noise = response->mutable_integrated_phase_noise()->mutable_data(); response->mutable_residual_pm_in_radian()->Resize(actual_array_size, 0); @@ -10257,15 +11171,17 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); response->mutable_residual_pm_in_radian()->Resize(actual_array_size, 0); response->mutable_residual_pm_in_degree()->Resize(actual_array_size, 0); response->mutable_residual_fm()->Resize(actual_array_size, 0); response->mutable_jitter()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -10289,10 +11205,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchMeasuredLogPlotTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); response->mutable_measured_phase_noise()->Resize(actual_array_size, 0); @@ -10303,12 +11219,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_frequency()->Resize(actual_array_size, 0); response->mutable_measured_phase_noise()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -10332,10 +11250,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchSmoothedLogPlotTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); response->mutable_smoothed_phase_noise()->Resize(actual_array_size, 0); @@ -10346,12 +11264,14 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_frequency()->Resize(actual_array_size, 0); response->mutable_smoothed_phase_noise()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -10375,10 +11295,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchSpotNoise(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); float64* spot_phase_noise = response->mutable_spot_phase_noise()->mutable_data(); auto array_size = actual_array_size; @@ -10387,11 +11307,13 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -10413,6 +11335,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10433,6 +11359,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10486,6 +11416,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10507,6 +11441,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 carrier_channel_bandwidth = request->carrier_channel_bandwidth(); auto status = library_->SEMCfgCarrierChannelBandwidth(instrument, selector_string, carrier_channel_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10543,6 +11481,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgCarrierEnabled(instrument, selector_string, carrier_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10564,6 +11506,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 carrier_frequency = request->carrier_frequency(); auto status = library_->SEMCfgCarrierFrequency(instrument, selector_string, carrier_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10585,6 +11531,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->SEMCfgCarrierIntegrationBandwidth(instrument, selector_string, integration_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10638,6 +11588,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgCarrierRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10675,6 +11629,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->SEMCfgCarrierRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10712,6 +11670,10 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->SEMCfgFFT(instrument, selector_string, fft_window, fft_padding); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10733,6 +11695,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_carriers = request->number_of_carriers(); auto status = library_->SEMCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10754,6 +11720,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10792,6 +11762,10 @@ namespace nirfmxspecan_grpc { float64 absolute_limit_start = request->absolute_limit_start(); float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10842,6 +11816,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10863,6 +11841,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 bandwidth_integral = request->bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, bandwidth_integral); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10917,6 +11899,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_enabled, offset_sideband); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -10978,6 +11964,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_enabled, offset_sideband, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11014,6 +12004,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgOffsetFrequencyDefinition(instrument, selector_string, offset_frequency_definition); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11050,6 +12044,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11103,6 +12101,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11161,6 +12163,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, rbw_auto, rbw, rbw_filter_type, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11182,6 +12188,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 relative_attenuation = request->relative_attenuation(); auto status = library_->SEMCfgOffsetRelativeAttenuation(instrument, selector_string, relative_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11204,6 +12214,10 @@ namespace nirfmxspecan_grpc { auto relative_attenuation = const_cast(request->relative_attenuation().data()); int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->SEMCfgOffsetRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11242,6 +12256,10 @@ namespace nirfmxspecan_grpc { float64 relative_limit_start = request->relative_limit_start(); float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_mode, relative_limit_start, relative_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11292,6 +12310,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_mode, relative_limit_start, relative_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11328,6 +12350,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgPowerUnits(instrument, selector_string, power_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11364,6 +12390,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SEMCfgReferenceType(instrument, selector_string, reference_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11401,6 +12431,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -11426,10 +12460,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchAbsoluteMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_mask()->Resize(actual_array_size, 0); float32* absolute_mask = response->mutable_absolute_mask()->mutable_data(); auto array_size = actual_array_size; @@ -11438,13 +12472,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_absolute_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -11470,13 +12506,15 @@ namespace nirfmxspecan_grpc { float64 peak_frequency {}; float64 total_relative_power {}; auto status = library_->SEMFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &peak_absolute_power, &peak_frequency, &total_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_total_relative_power(total_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11498,11 +12536,13 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); int32 composite_measurement_status {}; auto status = library_->SEMFetchCompositeMeasurementStatus(instrument, selector_string, timeout, &composite_measurement_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_composite_measurement_status(static_cast(composite_measurement_status)); response->set_composite_measurement_status_raw(composite_measurement_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11524,10 +12564,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 frequency_resolution {}; auto status = library_->SEMFetchFrequencyResolution(instrument, selector_string, timeout, &frequency_resolution); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency_resolution(frequency_resolution); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11553,15 +12595,17 @@ namespace nirfmxspecan_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11584,10 +12628,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -11604,8 +12648,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -11621,7 +12668,6 @@ namespace nirfmxspecan_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -11648,14 +12694,16 @@ namespace nirfmxspecan_grpc { float64 peak_frequency {}; float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_peak_relative_power(peak_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11678,10 +12726,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -11698,15 +12746,17 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_peak_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -11732,10 +12782,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchRelativeMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_relative_mask()->Resize(actual_array_size, 0); float32* relative_mask = response->mutable_relative_mask()->mutable_data(); auto array_size = actual_array_size; @@ -11744,13 +12794,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_relative_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -11776,10 +12828,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -11788,13 +12840,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -11817,10 +12871,12 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); float64 total_carrier_power {}; auto status = library_->SEMFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_carrier_power(total_carrier_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11846,15 +12902,17 @@ namespace nirfmxspecan_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11877,10 +12935,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -11897,8 +12955,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -11914,7 +12975,6 @@ namespace nirfmxspecan_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -11941,14 +13001,16 @@ namespace nirfmxspecan_grpc { float64 peak_frequency {}; float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_peak_relative_power(peak_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11971,10 +13033,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -11991,15 +13053,17 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_peak_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -12037,6 +13101,10 @@ namespace nirfmxspecan_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12056,6 +13124,10 @@ namespace nirfmxspecan_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12078,6 +13150,10 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12101,6 +13177,10 @@ namespace nirfmxspecan_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12123,6 +13203,10 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12146,6 +13230,10 @@ namespace nirfmxspecan_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12177,6 +13265,10 @@ namespace nirfmxspecan_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12217,6 +13309,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12248,6 +13344,10 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12270,6 +13370,10 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12293,6 +13397,10 @@ namespace nirfmxspecan_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12324,6 +13432,10 @@ namespace nirfmxspecan_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12367,6 +13479,10 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12393,6 +13509,10 @@ namespace nirfmxspecan_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12416,6 +13536,10 @@ namespace nirfmxspecan_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12457,6 +13581,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12488,6 +13616,10 @@ namespace nirfmxspecan_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12513,6 +13645,10 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12536,6 +13672,10 @@ namespace nirfmxspecan_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12559,6 +13699,10 @@ namespace nirfmxspecan_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12581,6 +13725,10 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12604,6 +13752,10 @@ namespace nirfmxspecan_grpc { uInt8* attr_val = (uInt8*)request->attr_val().c_str(); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12657,6 +13809,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpectrumCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12694,6 +13850,10 @@ namespace nirfmxspecan_grpc { int32 detector_points = request->detector_points(); auto status = library_->SpectrumCfgDetector(instrument, selector_string, detector_type, detector_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12731,6 +13891,10 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->SpectrumCfgFFT(instrument, selector_string, fft_window, fft_padding); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12753,6 +13917,10 @@ namespace nirfmxspecan_grpc { float64 start_frequency = request->start_frequency(); float64 stop_frequency = request->stop_frequency(); auto status = library_->SpectrumCfgFrequencyStartStop(instrument, selector_string, start_frequency, stop_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12789,6 +13957,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpectrumCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12825,6 +13997,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpectrumCfgPowerUnits(instrument, selector_string, spectrum_power_units); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12878,6 +14054,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpectrumCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12899,6 +14079,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 span = request->span(); auto status = library_->SpectrumCfgSpan(instrument, selector_string, span); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12936,6 +14120,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SpectrumCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12974,6 +14162,10 @@ namespace nirfmxspecan_grpc { float64 vbw = request->vbw(); float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->SpectrumCfgVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -12998,12 +14190,14 @@ namespace nirfmxspecan_grpc { float64 peak_frequency {}; float64 frequency_resolution {}; auto status = library_->SpectrumFetchMeasurement(instrument, selector_string, timeout, &peak_amplitude, &peak_frequency, &frequency_resolution); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_peak_amplitude(peak_amplitude); response->set_peak_frequency(peak_frequency); response->set_frequency_resolution(frequency_resolution); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13028,10 +14222,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpectrumFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -13040,13 +14234,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -13072,10 +14268,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpectrumFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -13084,13 +14280,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -13116,10 +14314,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpectrumRead(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -13128,13 +14326,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -13156,11 +14356,13 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 noise_calibration_data_valid {}; auto status = library_->SpectrumValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13213,6 +14415,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpurCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13249,6 +14455,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpurCfgFFTWindowType(instrument, selector_string, fft_window); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13270,6 +14480,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_ranges = request->number_of_ranges(); auto status = library_->SpurCfgNumberOfRanges(instrument, selector_string, number_of_ranges); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13308,6 +14522,10 @@ namespace nirfmxspecan_grpc { float64 absolute_limit_start = request->absolute_limit_start(); float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SpurCfgRangeAbsoluteLimit(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13358,6 +14576,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangeAbsoluteLimitArray(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13395,6 +14617,10 @@ namespace nirfmxspecan_grpc { int32 detector_points = request->detector_points(); auto status = library_->SpurCfgRangeDetector(instrument, selector_string, detector_type, detector_points); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13442,6 +14668,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangeDetectorArray(instrument, selector_string, detector_type, detector_points, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13480,6 +14710,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpurCfgRangeFrequency(instrument, selector_string, start_frequency, stop_frequency, range_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13530,6 +14764,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangeFrequencyArray(instrument, selector_string, start_frequency, stop_frequency, range_enabled, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13551,6 +14789,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_spurs_to_report = request->number_of_spurs_to_report(); auto status = library_->SpurCfgRangeNumberOfSpursToReport(instrument, selector_string, number_of_spurs_to_report); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13573,6 +14815,10 @@ namespace nirfmxspecan_grpc { auto number_of_spurs_to_report = const_cast(reinterpret_cast(request->number_of_spurs_to_report().data())); int32 number_of_elements = static_cast(request->number_of_spurs_to_report().size()); auto status = library_->SpurCfgRangeNumberOfSpursToReportArray(instrument, selector_string, number_of_spurs_to_report, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13595,6 +14841,10 @@ namespace nirfmxspecan_grpc { float64 threshold = request->threshold(); float64 excursion = request->excursion(); auto status = library_->SpurCfgRangePeakCriteria(instrument, selector_string, threshold, excursion); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13634,6 +14884,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangePeakCriteriaArray(instrument, selector_string, threshold, excursion, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13692,6 +14946,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangeRBWArray(instrument, selector_string, rbw_auto, rbw, rbw_filter_type, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13745,6 +15003,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->SpurCfgRangeRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13766,6 +15028,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 relative_attenuation = request->relative_attenuation(); auto status = library_->SpurCfgRangeRelativeAttenuation(instrument, selector_string, relative_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13788,6 +15054,10 @@ namespace nirfmxspecan_grpc { auto relative_attenuation = const_cast(request->relative_attenuation().data()); int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->SpurCfgRangeRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13825,6 +15095,10 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SpurCfgRangeSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13872,6 +15146,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangeSweepTimeArray(instrument, selector_string, sweep_time_auto, sweep_time_interval, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13910,6 +15188,10 @@ namespace nirfmxspecan_grpc { float64 vbw = request->vbw(); float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->SpurCfgRangeVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13960,6 +15242,10 @@ namespace nirfmxspecan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SpurCfgRangeVBWFilterArray(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -13981,6 +15267,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 trace_range_index = request->trace_range_index(); auto status = library_->SpurCfgTraceRangeIndex(instrument, selector_string, trace_range_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14004,10 +15294,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchAllSpurs(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spur_frequency()->Resize(actual_array_size, 0); float64* spur_frequency = response->mutable_spur_frequency()->mutable_data(); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); @@ -14024,15 +15314,17 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_spur_frequency()->Resize(actual_array_size, 0); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); response->mutable_spur_margin()->Resize(actual_array_size, 0); response->mutable_spur_absolute_limit()->Resize(actual_array_size, 0); response->mutable_spur_range_index()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -14055,11 +15347,13 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); int32 measurement_status {}; auto status = library_->SpurFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -14084,10 +15378,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchRangeAbsoluteLimitTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_absolute_limit()->Resize(actual_array_size, 0); float32* absolute_limit = response->mutable_absolute_limit()->mutable_data(); auto array_size = actual_array_size; @@ -14096,13 +15390,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_absolute_limit()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -14128,10 +15424,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchRangeSpectrumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_range_spectrum()->Resize(actual_array_size, 0); float32* range_spectrum = response->mutable_range_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -14140,13 +15436,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_range_spectrum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -14170,12 +15468,14 @@ namespace nirfmxspecan_grpc { int32 range_status {}; int32 detected_spurs {}; auto status = library_->SpurFetchRangeStatus(instrument, selector_string, timeout, &range_status, &detected_spurs); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_range_status(static_cast(range_status)); response->set_range_status_raw(range_status); response->set_detected_spurs(detected_spurs); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -14198,10 +15498,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchRangeStatusArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_range_status_raw()->Resize(actual_array_size, 0); int32* range_status = reinterpret_cast(response->mutable_range_status_raw()->mutable_data()); response->mutable_number_of_detected_spurs()->Resize(actual_array_size, 0); @@ -14212,8 +15512,11 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_range_status()->Clear(); response->mutable_range_status()->Reserve(actual_array_size); std::transform( @@ -14226,7 +15529,6 @@ namespace nirfmxspecan_grpc { response->mutable_range_status()->Resize(actual_array_size, 0); response->mutable_number_of_detected_spurs()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -14252,13 +15554,15 @@ namespace nirfmxspecan_grpc { float64 spur_margin {}; float64 spur_absolute_limit {}; auto status = library_->SpurFetchSpurMeasurement(instrument, selector_string, timeout, &spur_frequency, &spur_amplitude, &spur_margin, &spur_absolute_limit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_spur_frequency(spur_frequency); response->set_spur_amplitude(spur_amplitude); response->set_spur_margin(spur_margin); response->set_spur_absolute_limit(spur_absolute_limit); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -14281,10 +15585,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchSpurMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spur_frequency()->Resize(actual_array_size, 0); float64* spur_frequency = response->mutable_spur_frequency()->mutable_data(); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); @@ -14299,14 +15603,16 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_spur_frequency()->Resize(actual_array_size, 0); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); response->mutable_spur_absolute_limit()->Resize(actual_array_size, 0); response->mutable_spur_margin()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -14360,6 +15666,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14381,6 +15691,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->TXPCfgMeasurementInterval(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14419,6 +15733,10 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->TXPCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14472,6 +15790,10 @@ namespace nirfmxspecan_grpc { } auto status = library_->TXPCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14510,6 +15832,10 @@ namespace nirfmxspecan_grpc { float64 vbw = request->vbw(); float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->TXPCfgVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14535,13 +15861,15 @@ namespace nirfmxspecan_grpc { float64 maximum_power {}; float64 minimum_power {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_mean_power, &peak_to_average_ratio, &maximum_power, &minimum_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_mean_power(average_mean_power); response->set_peak_to_average_ratio(peak_to_average_ratio); response->set_maximum_power(maximum_power); response->set_minimum_power(minimum_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -14566,10 +15894,10 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -14578,13 +15906,15 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -14610,13 +15940,15 @@ namespace nirfmxspecan_grpc { float64 maximum_power {}; float64 minimum_power {}; auto status = library_->TXPRead(instrument, selector_string, timeout, &average_mean_power, &peak_to_average_ratio, &maximum_power, &minimum_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_mean_power(average_mean_power); response->set_peak_to_average_ratio(peak_to_average_ratio); response->set_maximum_power(maximum_power); response->set_minimum_power(minimum_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -14636,6 +15968,10 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -14657,6 +15993,10 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxspecan/nirfmxspecan_service.h b/generated/nirfmxspecan/nirfmxspecan_service.h index b1078a32b..07031debf 100644 --- a/generated/nirfmxspecan/nirfmxspecan_service.h +++ b/generated/nirfmxspecan/nirfmxspecan_service.h @@ -460,6 +460,7 @@ class NiRFmxSpecAnService final : public NiRFmxSpecAn::Service { NiRFmxSpecAnLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXIe_DStarB", 12},{"TimerEvent", 13}, }; std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; diff --git a/generated/nirfmxwlan/nirfmxwlan_service.cpp b/generated/nirfmxwlan/nirfmxwlan_service.cpp index e1356d47b..86491e74a 100644 --- a/generated/nirfmxwlan/nirfmxwlan_service.cpp +++ b/generated/nirfmxwlan/nirfmxwlan_service.cpp @@ -60,6 +60,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -87,6 +91,10 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -132,6 +140,10 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto status = library_->AnalyzeNWaveformsIQ(instrument, selector_string, result_name, x0, dx, iq.data(), iq_sizes, array_size, reset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -177,6 +189,10 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto status = library_->AnalyzeNWaveformsSpectrum(instrument, selector_string, result_name, x0, dx, spectrum, spectrum_sizes, array_size, reset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -204,6 +220,10 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -225,6 +245,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->AutoDetectSignal(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -246,6 +270,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 measurement_interval = request->measurement_interval(); auto status = library_->AutoLevel(instrument, selector_string, measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -267,10 +295,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildChainString(selector_string, chain_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -282,11 +310,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -308,10 +338,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildGateString(selector_string, gate_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -323,11 +353,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -349,10 +381,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -364,11 +396,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -390,10 +424,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildSegmentString(selector_string, segment_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -405,11 +439,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -431,10 +467,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_length = status; std::string selector_string; @@ -446,11 +482,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); - } return ::grpc::Status::OK; } } @@ -472,10 +510,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildStreamString(selector_string, stream_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -487,11 +525,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -513,10 +553,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildUserString(selector_string, user_number, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + int32 selector_string_out_length = status; std::string selector_string_out; @@ -528,11 +568,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } } @@ -554,6 +596,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 channel_bandwidth = request->channel_bandwidth(); auto status = library_->CfgChannelBandwidth(instrument, selector_string, channel_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -593,6 +639,10 @@ namespace nirfmxwlan_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -614,6 +664,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -635,6 +689,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -657,6 +715,10 @@ namespace nirfmxwlan_grpc { auto center_frequency = const_cast(request->center_frequency().data()); int32 number_of_elements = static_cast(request->center_frequency().size()); auto status = library_->CfgFrequencyArray(instrument, selector_string, center_frequency, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -698,6 +760,10 @@ namespace nirfmxwlan_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -771,6 +837,10 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -808,6 +878,10 @@ namespace nirfmxwlan_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -830,6 +904,10 @@ namespace nirfmxwlan_grpc { int32 number_of_frequency_segments = request->number_of_frequency_segments(); int32 number_of_receive_chains = request->number_of_receive_chains(); auto status = library_->CfgNumberOfFrequencySegmentsAndReceiveChains(instrument, selector_string, number_of_frequency_segments, number_of_receive_chains); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -867,6 +945,10 @@ namespace nirfmxwlan_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -888,6 +970,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -909,6 +995,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* selected_ports = (char*)request->selected_ports().c_str(); auto status = library_->CfgSelectedPortsMultiple(instrument, selector_string, selected_ports); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -931,6 +1021,10 @@ namespace nirfmxwlan_grpc { float64 trigger_delay = request->trigger_delay(); int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -967,6 +1061,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->CfgStandard(instrument, selector_string, standard); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -988,10 +1086,12 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1011,6 +1111,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1031,6 +1135,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1052,6 +1160,10 @@ namespace nirfmxwlan_grpc { char* old_signal_name = (char*)request->old_signal_name().c_str(); char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1073,6 +1185,10 @@ namespace nirfmxwlan_grpc { int32 force_destroy = request->force_destroy(); session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1093,6 +1209,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1113,6 +1233,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1150,6 +1274,10 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->DSSSModAccCfgAcquisitionLength(instrument, selector_string, acquisition_length_mode, acquisition_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1187,6 +1315,10 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->DSSSModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1223,6 +1355,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->DSSSModAccCfgEVMUnit(instrument, selector_string, evm_unit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1245,6 +1381,10 @@ namespace nirfmxwlan_grpc { int32 measurement_offset = request->measurement_offset(); int32 maximum_measurement_length = request->maximum_measurement_length(); auto status = library_->DSSSModAccCfgMeasurementLength(instrument, selector_string, measurement_offset, maximum_measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1284,6 +1424,10 @@ namespace nirfmxwlan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->DSSSModAccCfgPowerMeasurementCustomGateArray(instrument, selector_string, start_time, stop_time, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1320,6 +1464,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->DSSSModAccCfgPowerMeasurementEnabled(instrument, selector_string, power_measurement_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1341,6 +1489,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_custom_gates = request->number_of_custom_gates(); auto status = library_->DSSSModAccCfgPowerMeasurementNumberOfCustomGates(instrument, selector_string, number_of_custom_gates); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1366,13 +1518,15 @@ namespace nirfmxwlan_grpc { float64 data_average_power_mean {}; float64 ppdu_average_power_mean {}; auto status = library_->DSSSModAccFetchAveragePowers(instrument, selector_string, timeout, &preamble_average_power_mean, &header_average_power_mean, &data_average_power_mean, &ppdu_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_preamble_average_power_mean(preamble_average_power_mean); response->set_header_average_power_mean(header_average_power_mean); response->set_data_average_power_mean(data_average_power_mean); response->set_ppdu_average_power_mean(ppdu_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1395,10 +1549,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DSSSModAccFetchConstellationTrace(instrument, selector_string, timeout, constellation.data(), array_size, &actual_array_size); @@ -1406,8 +1560,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(constellation, response->mutable_constellation()); { auto shrunk_size = actual_array_size; @@ -1417,7 +1574,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1441,10 +1597,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchCustomGatePowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_average_power_mean()->Resize(actual_array_size, 0); float64* average_power_mean = response->mutable_average_power_mean()->mutable_data(); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); @@ -1455,12 +1611,14 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_average_power_mean()->Resize(actual_array_size, 0); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1484,10 +1642,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchDecodedHeaderBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); int32* decoded_header_bits = reinterpret_cast(response->mutable_decoded_header_bits()->mutable_data()); auto array_size = actual_array_size; @@ -1496,11 +1654,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1524,10 +1684,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchDecodedPSDUBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); int32* decoded_psdu_bits = reinterpret_cast(response->mutable_decoded_psdu_bits()->mutable_data()); auto array_size = actual_array_size; @@ -1536,11 +1696,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1569,8 +1731,11 @@ namespace nirfmxwlan_grpc { float64 chip_clock_error_mean {}; int32 number_of_chips_used {}; auto status = library_->DSSSModAccFetchEVM(instrument, selector_string, timeout, &rms_evm_mean, &peak_evm_80211_2016_maximum, &peak_evm_80211_2007_maximum, &peak_evm_80211_1999_maximum, &frequency_error_mean, &chip_clock_error_mean, &number_of_chips_used); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_rms_evm_mean(rms_evm_mean); response->set_peak_evm_80211_2016_maximum(peak_evm_80211_2016_maximum); response->set_peak_evm_80211_2007_maximum(peak_evm_80211_2007_maximum); @@ -1578,7 +1743,6 @@ namespace nirfmxwlan_grpc { response->set_frequency_error_mean(frequency_error_mean); response->set_chip_clock_error_mean(chip_clock_error_mean); response->set_number_of_chips_used(number_of_chips_used); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1603,10 +1767,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchEVMPerChipMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_evm_per_chip_mean()->Resize(actual_array_size, 0); float32* evm_per_chip_mean = response->mutable_evm_per_chip_mean()->mutable_data(); auto array_size = actual_array_size; @@ -1615,13 +1779,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_evm_per_chip_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1646,12 +1812,14 @@ namespace nirfmxwlan_grpc { float64 iq_gain_imbalance_mean {}; float64 iq_quadrature_error_mean {}; auto status = library_->DSSSModAccFetchIQImpairments(instrument, selector_string, timeout, &iq_origin_offset_mean, &iq_gain_imbalance_mean, &iq_quadrature_error_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_iq_origin_offset_mean(iq_origin_offset_mean); response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); response->set_iq_quadrature_error_mean(iq_quadrature_error_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1678,8 +1846,11 @@ namespace nirfmxwlan_grpc { int32 header_crc_status {}; int32 psdu_crc_status {}; auto status = library_->DSSSModAccFetchPPDUInformation(instrument, selector_string, timeout, &data_modulation_format, &payload_length, &preamble_type, &locked_clocks_bit, &header_crc_status, &psdu_crc_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_data_modulation_format(static_cast(data_modulation_format)); response->set_data_modulation_format_raw(data_modulation_format); response->set_payload_length(payload_length); @@ -1690,7 +1861,6 @@ namespace nirfmxwlan_grpc { response->set_header_crc_status_raw(header_crc_status); response->set_psdu_crc_status(static_cast(psdu_crc_status)); response->set_psdu_crc_status_raw(psdu_crc_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1715,13 +1885,15 @@ namespace nirfmxwlan_grpc { float64 data_peak_power_maximum {}; float64 ppdu_peak_power_maximum {}; auto status = library_->DSSSModAccFetchPeakPowers(instrument, selector_string, timeout, &preamble_peak_power_maximum, &header_peak_power_maximum, &data_peak_power_maximum, &ppdu_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_preamble_peak_power_maximum(preamble_peak_power_maximum); response->set_header_peak_power_maximum(header_peak_power_maximum); response->set_data_peak_power_maximum(data_peak_power_maximum); response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1741,6 +1913,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1761,6 +1937,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1784,10 +1964,10 @@ namespace nirfmxwlan_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -1798,13 +1978,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); response->set_actual_result_names_size(actual_result_names_size); response->set_default_result_exists(default_result_exists); - } return ::grpc::Status::OK; } } @@ -1827,10 +2009,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1853,10 +2037,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -1865,11 +2049,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1892,10 +2078,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1918,10 +2106,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -1930,11 +2118,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -1957,10 +2147,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1982,8 +2174,11 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -1991,7 +2186,6 @@ namespace nirfmxwlan_grpc { }; response->set_attr_val(checked_convert_attr_val(attr_val)); response->set_attr_val_raw(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2014,10 +2208,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -2026,8 +2220,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); auto valid_enum_value = raw_value_is_valid ? raw_value : 0; @@ -2044,7 +2241,6 @@ namespace nirfmxwlan_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2067,10 +2263,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2093,10 +2291,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2105,11 +2303,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2132,10 +2332,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2158,10 +2360,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2169,8 +2371,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -2182,7 +2387,6 @@ namespace nirfmxwlan_grpc { }); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2206,10 +2410,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2217,8 +2421,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -2228,7 +2435,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2252,10 +2458,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2263,8 +2469,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(attr_val, response->mutable_attr_val()); { auto shrunk_size = actual_array_size; @@ -2274,7 +2483,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2298,10 +2506,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 array_size = status; std::string attr_val; @@ -2313,11 +2521,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); - } return ::grpc::Status::OK; } } @@ -2340,10 +2550,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2365,10 +2577,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2391,10 +2605,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2403,11 +2617,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2431,10 +2647,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2443,11 +2659,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2470,10 +2688,12 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2496,10 +2716,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -2507,12 +2727,14 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -2534,10 +2756,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; int32 error_code {}; @@ -2550,12 +2772,14 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -2578,10 +2802,10 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + int32 error_description_buffer_size = status; std::string error_description; @@ -2593,11 +2817,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -2627,15 +2853,13 @@ namespace nirfmxwlan_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXWLAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2663,14 +2887,12 @@ namespace nirfmxwlan_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXWLAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_instrument()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2691,6 +2913,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2712,6 +2938,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->OFDMModAccAutoLevel(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2736,6 +2966,10 @@ namespace nirfmxwlan_grpc { auto reference_waveform = convert_from_grpc(request->reference_waveform()); int32 array_size = static_cast(request->reference_waveform().size()); auto status = library_->OFDMModAccCfg1ReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2773,6 +3007,10 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->OFDMModAccCfgAcquisitionLength(instrument, selector_string, acquisition_length_mode, acquisition_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2809,6 +3047,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgAmplitudeTrackingEnabled(instrument, selector_string, amplitude_tracking_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2846,6 +3088,10 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->OFDMModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2882,6 +3128,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgChannelEstimationType(instrument, selector_string, channel_estimation_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2918,6 +3168,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgCommonClockSourceEnabled(instrument, selector_string, common_clock_source_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2954,6 +3208,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgEVMUnit(instrument, selector_string, evm_unit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2990,6 +3248,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgFrequencyErrorEstimationMethod(instrument, selector_string, frequency_error_estimation_method); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3012,6 +3274,10 @@ namespace nirfmxwlan_grpc { int32 measurement_offset = request->measurement_offset(); int32 maximum_measurement_length = request->maximum_measurement_length(); auto status = library_->OFDMModAccCfgMeasurementLength(instrument, selector_string, measurement_offset, maximum_measurement_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3048,6 +3314,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgMeasurementMode(instrument, selector_string, measurement_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3091,6 +3361,10 @@ namespace nirfmxwlan_grpc { auto array_size = array_size_size_calculation.size; auto status = library_->OFDMModAccCfgNReferenceWaveforms(instrument, selector_string, x0, dx, reference_waveform.data(), reference_waveform_sizes, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3127,6 +3401,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3164,6 +3442,10 @@ namespace nirfmxwlan_grpc { double optimize_dynamic_range_for_evm_margin = request->optimize_dynamic_range_for_evm_margin(); auto status = library_->OFDMModAccCfgOptimizeDynamicRangeForEVM(instrument, selector_string, optimize_dynamic_range_for_evm_enabled, optimize_dynamic_range_for_evm_margin); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3200,6 +3482,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgPhaseTrackingEnabled(instrument, selector_string, phase_tracking_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3236,6 +3522,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->OFDMModAccCfgSymbolClockErrorCorrectionEnabled(instrument, selector_string, symbol_clock_error_correction_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3255,6 +3545,10 @@ namespace nirfmxwlan_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->OFDMModAccClearNoiseCalibrationDatabase(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3280,10 +3574,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_chain_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_data_rms_evm_per_symbol_mean = response->mutable_chain_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3292,13 +3586,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_chain_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3324,10 +3620,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_chain_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_pilot_rms_evm_per_symbol_mean = response->mutable_chain_pilot_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3336,13 +3632,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_chain_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3367,12 +3665,14 @@ namespace nirfmxwlan_grpc { float64 chain_data_rms_evm_mean {}; float64 chain_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchChainRMSEVM(instrument, selector_string, timeout, &chain_rms_evm_mean, &chain_data_rms_evm_mean, &chain_pilot_rms_evm_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_chain_rms_evm_mean(chain_rms_evm_mean); response->set_chain_data_rms_evm_mean(chain_data_rms_evm_mean); response->set_chain_pilot_rms_evm_mean(chain_pilot_rms_evm_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3397,10 +3697,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_chain_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* chain_rms_evm_per_subcarrier_mean = response->mutable_chain_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3409,13 +3709,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_chain_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3441,10 +3743,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_chain_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_rms_evm_per_symbol_mean = response->mutable_chain_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3453,13 +3755,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_chain_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3485,10 +3789,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChannelFrequencyResponseMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_channel_frequency_response_mean_magnitude()->Resize(actual_array_size, 0); float32* channel_frequency_response_mean_magnitude = response->mutable_channel_frequency_response_mean_magnitude()->mutable_data(); response->mutable_channel_frequency_response_mean_phase()->Resize(actual_array_size, 0); @@ -3499,14 +3803,16 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_channel_frequency_response_mean_magnitude()->Resize(actual_array_size, 0); response->mutable_channel_frequency_response_mean_phase()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3532,10 +3838,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchCommonPilotErrorTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_common_pilot_error_magnitude()->Resize(actual_array_size, 0); float32* common_pilot_error_magnitude = response->mutable_common_pilot_error_magnitude()->mutable_data(); response->mutable_common_pilot_error_phase()->Resize(actual_array_size, 0); @@ -3546,14 +3852,16 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_common_pilot_error_magnitude()->Resize(actual_array_size, 0); response->mutable_common_pilot_error_phase()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3578,12 +3886,14 @@ namespace nirfmxwlan_grpc { float64 composite_data_rms_evm_mean {}; float64 composite_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchCompositeRMSEVM(instrument, selector_string, timeout, &composite_rms_evm_mean, &composite_data_rms_evm_mean, &composite_pilot_rms_evm_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_composite_rms_evm_mean(composite_rms_evm_mean); response->set_composite_data_rms_evm_mean(composite_data_rms_evm_mean); response->set_composite_pilot_rms_evm_mean(composite_pilot_rms_evm_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3605,10 +3915,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 cross_power_mean {}; auto status = library_->OFDMModAccFetchCrossPower(instrument, selector_string, timeout, &cross_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_cross_power_mean(cross_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3631,10 +3943,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchCustomGatePowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_average_power_mean()->Resize(actual_array_size, 0); float64* average_power_mean = response->mutable_average_power_mean()->mutable_data(); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); @@ -3645,12 +3957,14 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_average_power_mean()->Resize(actual_array_size, 0); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3673,10 +3987,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 data_average_power_mean {}; auto status = library_->OFDMModAccFetchDataAveragePower(instrument, selector_string, timeout, &data_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_data_average_power_mean(data_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3699,10 +4015,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchDataConstellationTrace(instrument, selector_string, timeout, data_constellation.data(), array_size, &actual_array_size); @@ -3710,8 +4026,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data_constellation, response->mutable_data_constellation()); { auto shrunk_size = actual_array_size; @@ -3721,7 +4040,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3744,10 +4062,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 data_peak_power_maximum {}; auto status = library_->OFDMModAccFetchDataPeakPower(instrument, selector_string, timeout, &data_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_data_peak_power_maximum(data_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3770,10 +4090,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedEHTSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); int32* decoded_eht_sig_bits = reinterpret_cast(response->mutable_decoded_eht_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -3782,11 +4102,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3810,10 +4132,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedLSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); int32* decoded_l_sig_bits = reinterpret_cast(response->mutable_decoded_l_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -3822,11 +4144,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3850,10 +4174,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedPSDUBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); int32* decoded_psdu_bits = reinterpret_cast(response->mutable_decoded_psdu_bits()->mutable_data()); auto array_size = actual_array_size; @@ -3862,11 +4186,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3890,10 +4216,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedSIGBBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); int32* decoded_sig_b_bits = reinterpret_cast(response->mutable_decoded_sig_b_bits()->mutable_data()); auto array_size = actual_array_size; @@ -3902,11 +4228,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3930,10 +4258,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); int32* decoded_sig_bits = reinterpret_cast(response->mutable_decoded_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -3942,11 +4270,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -3970,10 +4300,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedServiceBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); int32* decoded_service_bits = reinterpret_cast(response->mutable_decoded_service_bits()->mutable_data()); auto array_size = actual_array_size; @@ -3982,11 +4312,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4010,10 +4342,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedUSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); int32* decoded_u_sig_bits = reinterpret_cast(response->mutable_decoded_u_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4022,11 +4354,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4050,10 +4384,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchEVMSubcarrierIndices(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); int32* subcarrier_indices = reinterpret_cast(response->mutable_subcarrier_indices()->mutable_data()); auto array_size = actual_array_size; @@ -4062,11 +4396,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4089,10 +4425,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 frequency_error_ccdf_10_percent {}; auto status = library_->OFDMModAccFetchFrequencyErrorCCDF10Percent(instrument, selector_string, timeout, &frequency_error_ccdf_10_percent); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency_error_ccdf_10_percent(frequency_error_ccdf_10_percent); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4114,10 +4452,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 frequency_error_mean {}; auto status = library_->OFDMModAccFetchFrequencyErrorMean(instrument, selector_string, timeout, &frequency_error_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_frequency_error_mean(frequency_error_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4142,10 +4482,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchGroupDelayMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_group_delay_mean()->Resize(actual_array_size, 0); float32* group_delay_mean = response->mutable_group_delay_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4154,13 +4494,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_group_delay_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4183,11 +4525,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 guard_interval_type {}; auto status = library_->OFDMModAccFetchGuardIntervalType(instrument, selector_string, timeout, &guard_interval_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_guard_interval_type(static_cast(guard_interval_type)); response->set_guard_interval_type_raw(guard_interval_type); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4212,10 +4556,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchIQGainImbalancePerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_gain_imbalance_per_subcarrier_mean = response->mutable_iq_gain_imbalance_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4224,13 +4568,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4257,14 +4603,16 @@ namespace nirfmxwlan_grpc { float64 absolute_iq_origin_offset_mean {}; float64 iq_timing_skew_mean {}; auto status = library_->OFDMModAccFetchIQImpairments(instrument, selector_string, timeout, &relative_iq_origin_offset_mean, &iq_gain_imbalance_mean, &iq_quadrature_error_mean, &absolute_iq_origin_offset_mean, &iq_timing_skew_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_relative_iq_origin_offset_mean(relative_iq_origin_offset_mean); response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); response->set_iq_quadrature_error_mean(iq_quadrature_error_mean); response->set_absolute_iq_origin_offset_mean(absolute_iq_origin_offset_mean); response->set_iq_timing_skew_mean(iq_timing_skew_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4289,10 +4637,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_quadrature_error_per_subcarrier_mean = response->mutable_iq_quadrature_error_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4301,13 +4649,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4330,11 +4680,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 l_sig_parity_check_status {}; auto status = library_->OFDMModAccFetchLSIGParityCheckStatus(instrument, selector_string, timeout, &l_sig_parity_check_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_l_sig_parity_check_status(static_cast(l_sig_parity_check_status)); response->set_l_sig_parity_check_status_raw(l_sig_parity_check_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4356,11 +4708,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 ltf_size {}; auto status = library_->OFDMModAccFetchLTFSize(instrument, selector_string, timeout, <f_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ltf_size(static_cast(ltf_size)); response->set_ltf_size_raw(ltf_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4382,10 +4736,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 mcs_index {}; auto status = library_->OFDMModAccFetchMCSIndex(instrument, selector_string, timeout, &mcs_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_mcs_index(mcs_index); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4407,10 +4763,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 number_of_he_sig_b_symbols {}; auto status = library_->OFDMModAccFetchNumberOfHESIGBSymbols(instrument, selector_string, timeout, &number_of_he_sig_b_symbols); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_he_sig_b_symbols(number_of_he_sig_b_symbols); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4432,10 +4790,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 number_of_space_time_streams {}; auto status = library_->OFDMModAccFetchNumberOfSpaceTimeStreams(instrument, selector_string, timeout, &number_of_space_time_streams); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_space_time_streams(number_of_space_time_streams); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4457,10 +4817,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 number_of_users {}; auto status = library_->OFDMModAccFetchNumberOfUsers(instrument, selector_string, timeout, &number_of_users); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_users(number_of_users); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4482,10 +4844,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 number_of_symbols_used {}; auto status = library_->OFDMModAccFetchNumberofSymbolsUsed(instrument, selector_string, timeout, &number_of_symbols_used); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_symbols_used(number_of_symbols_used); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4507,10 +4871,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 pe_average_power_mean {}; auto status = library_->OFDMModAccFetchPEAveragePower(instrument, selector_string, timeout, &pe_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pe_average_power_mean(pe_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4532,10 +4898,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 pe_duration {}; auto status = library_->OFDMModAccFetchPEDuration(instrument, selector_string, timeout, &pe_duration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pe_duration(pe_duration); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4557,10 +4925,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 pe_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPEPeakPower(instrument, selector_string, timeout, &pe_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_pe_peak_power_maximum(pe_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4582,10 +4952,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 ppdu_average_power_mean {}; auto status = library_->OFDMModAccFetchPPDUAveragePower(instrument, selector_string, timeout, &ppdu_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ppdu_average_power_mean(ppdu_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4607,10 +4979,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 ppdu_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPPDUPeakPower(instrument, selector_string, timeout, &ppdu_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4632,11 +5006,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 ppdu_type {}; auto status = library_->OFDMModAccFetchPPDUType(instrument, selector_string, timeout, &ppdu_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ppdu_type(static_cast(ppdu_type)); response->set_ppdu_type_raw(ppdu_type); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4658,11 +5034,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 psdu_crc_status {}; auto status = library_->OFDMModAccFetchPSDUCRCStatus(instrument, selector_string, timeout, &psdu_crc_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_psdu_crc_status(static_cast(psdu_crc_status)); response->set_psdu_crc_status_raw(psdu_crc_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4685,10 +5063,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchPilotConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector pilot_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchPilotConstellationTrace(instrument, selector_string, timeout, pilot_constellation.data(), array_size, &actual_array_size); @@ -4696,8 +5074,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(pilot_constellation, response->mutable_pilot_constellation()); { auto shrunk_size = actual_array_size; @@ -4707,7 +5088,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4733,13 +5113,15 @@ namespace nirfmxwlan_grpc { float64 vht_ltf_average_power_mean {}; float64 vht_sig_b_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211ac(instrument, selector_string, timeout, &vht_sig_a_average_power_mean, &vht_stf_average_power_mean, &vht_ltf_average_power_mean, &vht_sig_b_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_vht_sig_a_average_power_mean(vht_sig_a_average_power_mean); response->set_vht_stf_average_power_mean(vht_stf_average_power_mean); response->set_vht_ltf_average_power_mean(vht_ltf_average_power_mean); response->set_vht_sig_b_average_power_mean(vht_sig_b_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4765,14 +5147,16 @@ namespace nirfmxwlan_grpc { float64 he_stf_average_power_mean {}; float64 he_ltf_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211ax(instrument, selector_string, timeout, &rl_sig_average_power_mean, &he_sig_a_average_power_mean, &he_sig_b_average_power_mean, &he_stf_average_power_mean, &he_ltf_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_rl_sig_average_power_mean(rl_sig_average_power_mean); response->set_he_sig_a_average_power_mean(he_sig_a_average_power_mean); response->set_he_sig_b_average_power_mean(he_sig_b_average_power_mean); response->set_he_stf_average_power_mean(he_stf_average_power_mean); response->set_he_ltf_average_power_mean(he_ltf_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4797,13 +5181,15 @@ namespace nirfmxwlan_grpc { float64 ht_dltf_average_power_mean {}; float64 ht_eltf_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211n(instrument, selector_string, timeout, &ht_sig_average_power_mean, &ht_stf_average_power_mean, &ht_dltf_average_power_mean, &ht_eltf_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ht_sig_average_power_mean(ht_sig_average_power_mean); response->set_ht_stf_average_power_mean(ht_stf_average_power_mean); response->set_ht_dltf_average_power_mean(ht_dltf_average_power_mean); response->set_ht_eltf_average_power_mean(ht_eltf_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4827,12 +5213,14 @@ namespace nirfmxwlan_grpc { float64 l_ltf_average_power_mean {}; float64 l_sig_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowersCommon(instrument, selector_string, timeout, &l_stf_average_power_mean, &l_ltf_average_power_mean, &l_sig_average_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_l_stf_average_power_mean(l_stf_average_power_mean); response->set_l_ltf_average_power_mean(l_ltf_average_power_mean); response->set_l_sig_average_power_mean(l_sig_average_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4857,10 +5245,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchPreambleFrequencyErrorTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_preamble_frequency_error()->Resize(actual_array_size, 0); float32* preamble_frequency_error = response->mutable_preamble_frequency_error()->mutable_data(); auto array_size = actual_array_size; @@ -4869,13 +5257,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_preamble_frequency_error()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -4901,13 +5291,15 @@ namespace nirfmxwlan_grpc { float64 vht_ltf_peak_power_maximum {}; float64 vht_sig_b_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211ac(instrument, selector_string, timeout, &vht_sig_a_peak_power_maximum, &vht_stf_peak_power_maximum, &vht_ltf_peak_power_maximum, &vht_sig_b_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_vht_sig_a_peak_power_maximum(vht_sig_a_peak_power_maximum); response->set_vht_stf_peak_power_maximum(vht_stf_peak_power_maximum); response->set_vht_ltf_peak_power_maximum(vht_ltf_peak_power_maximum); response->set_vht_sig_b_peak_power_maximum(vht_sig_b_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4933,14 +5325,16 @@ namespace nirfmxwlan_grpc { float64 he_stf_peak_power_maximum {}; float64 he_ltf_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211ax(instrument, selector_string, timeout, &rl_sig_peak_power_maximum, &he_sig_a_peak_power_maximum, &he_sig_b_peak_power_maximum, &he_stf_peak_power_maximum, &he_ltf_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_rl_sig_peak_power_maximum(rl_sig_peak_power_maximum); response->set_he_sig_a_peak_power_maximum(he_sig_a_peak_power_maximum); response->set_he_sig_b_peak_power_maximum(he_sig_b_peak_power_maximum); response->set_he_stf_peak_power_maximum(he_stf_peak_power_maximum); response->set_he_ltf_peak_power_maximum(he_ltf_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4965,13 +5359,15 @@ namespace nirfmxwlan_grpc { float64 ht_dltf_peak_power_maximum {}; float64 ht_eltf_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211n(instrument, selector_string, timeout, &ht_sig_peak_power_maximum, &ht_stf_peak_power_maximum, &ht_dltf_peak_power_maximum, &ht_eltf_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ht_sig_peak_power_maximum(ht_sig_peak_power_maximum); response->set_ht_stf_peak_power_maximum(ht_stf_peak_power_maximum); response->set_ht_dltf_peak_power_maximum(ht_dltf_peak_power_maximum); response->set_ht_eltf_peak_power_maximum(ht_eltf_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4995,12 +5391,14 @@ namespace nirfmxwlan_grpc { float64 l_ltf_peak_power_maximum {}; float64 l_sig_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowersCommon(instrument, selector_string, timeout, &l_stf_peak_power_maximum, &l_ltf_peak_power_maximum, &l_sig_peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_l_stf_peak_power_maximum(l_stf_peak_power_maximum); response->set_l_ltf_peak_power_maximum(l_ltf_peak_power_maximum); response->set_l_sig_peak_power_maximum(l_sig_peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5023,11 +5421,13 @@ namespace nirfmxwlan_grpc { int32 ru_offset {}; int32 ru_size {}; auto status = library_->OFDMModAccFetchRUOffsetAndSize(instrument, selector_string, timeout, &ru_offset, &ru_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_ru_offset(ru_offset); response->set_ru_size(ru_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5049,11 +5449,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 sig_b_crc_status {}; auto status = library_->OFDMModAccFetchSIGBCRCStatus(instrument, selector_string, timeout, &sig_b_crc_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_sig_b_crc_status(static_cast(sig_b_crc_status)); response->set_sig_b_crc_status_raw(sig_b_crc_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5075,11 +5477,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 sig_crc_status {}; auto status = library_->OFDMModAccFetchSIGCRCStatus(instrument, selector_string, timeout, &sig_crc_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_sig_crc_status(static_cast(sig_crc_status)); response->set_sig_crc_status_raw(sig_crc_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5102,11 +5506,13 @@ namespace nirfmxwlan_grpc { float64 spectral_flatness_margin {}; int32 spectral_flatness_margin_subcarrier_index {}; auto status = library_->OFDMModAccFetchSpectralFlatness(instrument, selector_string, timeout, &spectral_flatness_margin, &spectral_flatness_margin_subcarrier_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_spectral_flatness_margin(spectral_flatness_margin); response->set_spectral_flatness_margin_subcarrier_index(spectral_flatness_margin_subcarrier_index); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5131,10 +5537,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSpectralFlatnessMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectral_flatness_mean()->Resize(actual_array_size, 0); float32* spectral_flatness_mean = response->mutable_spectral_flatness_mean()->mutable_data(); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); @@ -5147,15 +5553,17 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectral_flatness_mean()->Resize(actual_array_size, 0); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5181,10 +5589,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_data_rms_evm_per_symbol_mean = response->mutable_stream_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5193,13 +5601,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5225,10 +5635,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_pilot_rms_evm_per_symbol_mean = response->mutable_stream_pilot_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5237,13 +5647,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5268,12 +5680,14 @@ namespace nirfmxwlan_grpc { float64 stream_data_rms_evm_mean {}; float64 stream_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchStreamRMSEVM(instrument, selector_string, timeout, &stream_rms_evm_mean, &stream_data_rms_evm_mean, &stream_pilot_rms_evm_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_stream_rms_evm_mean(stream_rms_evm_mean); response->set_stream_data_rms_evm_mean(stream_data_rms_evm_mean); response->set_stream_pilot_rms_evm_mean(stream_pilot_rms_evm_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5298,10 +5712,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* stream_rms_evm_per_subcarrier_mean = response->mutable_stream_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5310,13 +5724,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5342,10 +5758,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_rms_evm_per_symbol_mean = response->mutable_stream_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5354,13 +5770,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5387,10 +5805,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSubcarrierChainEVMPerSymbolTrace(instrument, selector_string, timeout, subcarrier_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_subcarrier_chain_evm_per_symbol()->Resize(actual_array_size, 0); float32* subcarrier_chain_evm_per_symbol = response->mutable_subcarrier_chain_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5399,13 +5817,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_subcarrier_chain_evm_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5432,10 +5852,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSubcarrierStreamEVMPerSymbolTrace(instrument, selector_string, timeout, subcarrier_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_subcarrier_stream_evm_per_symbol()->Resize(actual_array_size, 0); float32* subcarrier_stream_evm_per_symbol = response->mutable_subcarrier_stream_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5444,13 +5864,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_subcarrier_stream_evm_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5477,10 +5899,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSymbolChainEVMPerSubcarrierTrace(instrument, selector_string, timeout, symbol_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_symbol_chain_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* symbol_chain_evm_per_subcarrier = response->mutable_symbol_chain_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5489,13 +5911,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_symbol_chain_evm_per_subcarrier()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5518,10 +5942,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 symbol_clock_error_mean {}; auto status = library_->OFDMModAccFetchSymbolClockErrorMean(instrument, selector_string, timeout, &symbol_clock_error_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_symbol_clock_error_mean(symbol_clock_error_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5547,10 +5973,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSymbolStreamEVMPerSubcarrierTrace(instrument, selector_string, timeout, symbol_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_symbol_stream_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* symbol_stream_evm_per_subcarrier = response->mutable_symbol_stream_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5559,13 +5985,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_symbol_stream_evm_per_subcarrier()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5589,11 +6017,13 @@ namespace nirfmxwlan_grpc { float64 unused_tone_error_margin {}; int32 unused_tone_error_margin_ru_index {}; auto status = library_->OFDMModAccFetchUnusedToneError(instrument, selector_string, timeout, &unused_tone_error_margin, &unused_tone_error_margin_ru_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_unused_tone_error_margin(unused_tone_error_margin); response->set_unused_tone_error_margin_ru_index(unused_tone_error_margin_ru_index); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5616,10 +6046,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUnusedToneErrorMarginPerRU(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); float64* unused_tone_error_margin_per_ru = response->mutable_unused_tone_error_margin_per_ru()->mutable_data(); auto array_size = actual_array_size; @@ -5628,11 +6058,13 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5658,10 +6090,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUnusedToneErrorMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_unused_tone_error()->Resize(actual_array_size, 0); float32* unused_tone_error = response->mutable_unused_tone_error()->mutable_data(); response->mutable_unused_tone_error_mask()->Resize(actual_array_size, 0); @@ -5672,14 +6104,16 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_unused_tone_error()->Resize(actual_array_size, 0); response->mutable_unused_tone_error_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5703,10 +6137,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector user_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchUserDataConstellationTrace(instrument, selector_string, timeout, user_data_constellation.data(), array_size, &actual_array_size); @@ -5714,8 +6148,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(user_data_constellation, response->mutable_user_data_constellation()); { auto shrunk_size = actual_array_size; @@ -5725,7 +6162,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5749,10 +6185,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserPilotConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + std::vector user_pilot_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchUserPilotConstellationTrace(instrument, selector_string, timeout, user_pilot_constellation.data(), array_size, &actual_array_size); @@ -5760,8 +6196,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(user_pilot_constellation, response->mutable_user_pilot_constellation()); { auto shrunk_size = actual_array_size; @@ -5771,7 +6210,6 @@ namespace nirfmxwlan_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5794,10 +6232,12 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); float64 user_power_mean {}; auto status = library_->OFDMModAccFetchUserPower(instrument, selector_string, timeout, &user_power_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_user_power_mean(user_power_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5822,10 +6262,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_user_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_data_rms_evm_per_symbol_mean = response->mutable_user_stream_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5834,13 +6274,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_user_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5866,10 +6308,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_pilot_rms_evm_per_symbol_mean = response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5878,13 +6320,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5909,12 +6353,14 @@ namespace nirfmxwlan_grpc { float64 user_stream_data_rms_evm_mean {}; float64 user_stream_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchUserStreamRMSEVM(instrument, selector_string, timeout, &user_stream_rms_evm_mean, &user_stream_data_rms_evm_mean, &user_stream_pilot_rms_evm_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_user_stream_rms_evm_mean(user_stream_rms_evm_mean); response->set_user_stream_data_rms_evm_mean(user_stream_data_rms_evm_mean); response->set_user_stream_pilot_rms_evm_mean(user_stream_pilot_rms_evm_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5939,10 +6385,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_user_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* user_stream_rms_evm_per_subcarrier_mean = response->mutable_user_stream_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5951,13 +6397,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_user_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -5983,10 +6431,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_user_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_rms_evm_per_symbol_mean = response->mutable_user_stream_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5995,13 +6443,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_user_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6023,11 +6473,13 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 calibration_data_valid {}; auto status = library_->OFDMModAccValidateCalibrationData(instrument, selector_string, &calibration_data_valid); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_calibration_data_valid(static_cast(calibration_data_valid)); response->set_calibration_data_valid_raw(calibration_data_valid); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6048,6 +6500,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 acquisition_length = request->acquisition_length(); auto status = library_->PowerRampCfgAcquisitionLength(instrument, selector_string, acquisition_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6085,6 +6541,10 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->PowerRampCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6110,10 +6570,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PowerRampFetchFallTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_raw_waveform()->Resize(actual_array_size, 0); float32* raw_waveform = response->mutable_raw_waveform()->mutable_data(); response->mutable_processed_waveform()->Resize(actual_array_size, 0); @@ -6128,8 +6588,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_raw_waveform()->Resize(actual_array_size, 0); @@ -6137,7 +6600,6 @@ namespace nirfmxwlan_grpc { response->mutable_threshold()->Resize(actual_array_size, 0); response->mutable_power_reference()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6161,11 +6623,13 @@ namespace nirfmxwlan_grpc { float64 rise_time_mean {}; float64 fall_time_mean {}; auto status = library_->PowerRampFetchMeasurement(instrument, selector_string, timeout, &rise_time_mean, &fall_time_mean); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_rise_time_mean(rise_time_mean); response->set_fall_time_mean(fall_time_mean); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6190,10 +6654,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PowerRampFetchRiseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_raw_waveform()->Resize(actual_array_size, 0); float32* raw_waveform = response->mutable_raw_waveform()->mutable_data(); response->mutable_processed_waveform()->Resize(actual_array_size, 0); @@ -6208,8 +6672,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_raw_waveform()->Resize(actual_array_size, 0); @@ -6217,7 +6684,6 @@ namespace nirfmxwlan_grpc { response->mutable_threshold()->Resize(actual_array_size, 0); response->mutable_power_reference()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6239,6 +6705,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6259,6 +6729,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6312,6 +6786,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6348,6 +6826,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->SEMCfgMaskType(instrument, selector_string, mask_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6369,6 +6851,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6419,6 +6905,10 @@ namespace nirfmxwlan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6458,6 +6948,10 @@ namespace nirfmxwlan_grpc { auto number_of_elements = number_of_elements_size_calculation.size; auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6495,6 +6989,10 @@ namespace nirfmxwlan_grpc { float64 span = request->span(); auto status = library_->SEMCfgSpan(instrument, selector_string, span_auto, span); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6532,6 +7030,10 @@ namespace nirfmxwlan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -6555,11 +7057,13 @@ namespace nirfmxwlan_grpc { float64 absolute_power {}; float64 relative_power {}; auto status = library_->SEMFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6585,15 +7089,17 @@ namespace nirfmxwlan_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6616,10 +7122,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -6636,8 +7142,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -6653,7 +7162,6 @@ namespace nirfmxwlan_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6680,14 +7188,16 @@ namespace nirfmxwlan_grpc { float64 peak_frequency {}; float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_peak_relative_power(peak_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6710,10 +7220,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -6730,15 +7240,17 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_peak_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6761,11 +7273,13 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6790,10 +7304,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); response->mutable_composite_mask()->Resize(actual_array_size, 0); @@ -6804,14 +7318,16 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_spectrum()->Resize(actual_array_size, 0); response->mutable_composite_mask()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6838,15 +7354,17 @@ namespace nirfmxwlan_grpc { float64 margin_absolute_power {}; float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); response->set_margin(margin); response->set_margin_frequency(margin_frequency); response->set_margin_absolute_power(margin_absolute_power); response->set_margin_relative_power(margin_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6869,10 +7387,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -6889,8 +7407,11 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); std::transform( @@ -6906,7 +7427,6 @@ namespace nirfmxwlan_grpc { response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); response->mutable_margin_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -6933,14 +7453,16 @@ namespace nirfmxwlan_grpc { float64 peak_frequency {}; float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); response->set_peak_absolute_power(peak_absolute_power); response->set_peak_frequency(peak_frequency); response->set_peak_relative_power(peak_relative_power); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6963,10 +7485,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -6983,15 +7505,17 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_frequency()->Resize(actual_array_size, 0); response->mutable_peak_relative_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7029,6 +7553,10 @@ namespace nirfmxwlan_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7048,6 +7576,10 @@ namespace nirfmxwlan_grpc { auto instrument_grpc_session = request->instrument(); niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7070,6 +7602,10 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7093,6 +7629,10 @@ namespace nirfmxwlan_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7115,6 +7655,10 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7138,6 +7682,10 @@ namespace nirfmxwlan_grpc { auto attr_val = const_cast(request->attr_val().data()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7169,6 +7717,10 @@ namespace nirfmxwlan_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7209,6 +7761,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7240,6 +7796,10 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7262,6 +7822,10 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7285,6 +7849,10 @@ namespace nirfmxwlan_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7316,6 +7884,10 @@ namespace nirfmxwlan_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7359,6 +7931,10 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7385,6 +7961,10 @@ namespace nirfmxwlan_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7408,6 +7988,10 @@ namespace nirfmxwlan_grpc { auto attr_val = convert_from_grpc(request->attr_val()); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7449,6 +8033,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7480,6 +8068,10 @@ namespace nirfmxwlan_grpc { auto attr_val = static_cast(attr_val_raw); auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7505,6 +8097,10 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7528,6 +8124,10 @@ namespace nirfmxwlan_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7551,6 +8151,10 @@ namespace nirfmxwlan_grpc { auto attr_val = const_cast(reinterpret_cast(request->attr_val().data())); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7573,6 +8177,10 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7596,6 +8204,10 @@ namespace nirfmxwlan_grpc { uInt8* attr_val = (uInt8*)request->attr_val().c_str(); int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7633,6 +8245,10 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7669,6 +8285,10 @@ namespace nirfmxwlan_grpc { } auto status = library_->TXPCfgBurstDetectionEnabled(instrument, selector_string, burst_detection_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7690,6 +8310,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 maximum_measurement_interval = request->maximum_measurement_interval(); auto status = library_->TXPCfgMaximumMeasurementInterval(instrument, selector_string, maximum_measurement_interval); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7713,11 +8337,13 @@ namespace nirfmxwlan_grpc { float64 average_power_mean {}; float64 peak_power_maximum {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_power_mean, &peak_power_maximum); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_average_power_mean(average_power_mean); response->set_peak_power_maximum(peak_power_maximum); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7742,10 +8368,10 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -7754,13 +8380,15 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); - if (status_ok(status)) { response->set_x0(x0); response->set_dx(dx); response->mutable_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } @@ -7781,6 +8409,10 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -7802,6 +8434,10 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxwlan/nirfmxwlan_service.h b/generated/nirfmxwlan/nirfmxwlan_service.h index b142543d3..8e2565a5d 100644 --- a/generated/nirfmxwlan/nirfmxwlan_service.h +++ b/generated/nirfmxwlan/nirfmxwlan_service.h @@ -277,6 +277,7 @@ class NiRFmxWLANService final : public NiRFmxWLAN::Service { NiRFmxWLANLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; std::map frequencyreferencesource_output_map_ { {"OnboardClock", 1},{"RefIn", 2},{"PXI_Clk", 3},{"ClkIn", 4}, }; std::map nirfmxwlanstringattributevaluesmapped_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; diff --git a/generated/nirfsa/nirfsa_service.cpp b/generated/nirfsa/nirfsa_service.cpp index c0aad35cd..e85194977 100644 --- a/generated/nirfsa/nirfsa_service.cpp +++ b/generated/nirfsa/nirfsa_service.cpp @@ -57,6 +57,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -77,10 +81,12 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean is_done {}; auto status = library_->CheckAcquisitionStatus(vi, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -99,6 +105,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -118,6 +128,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearSelfCalibrateRange(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -138,6 +152,10 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -157,6 +175,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -192,6 +214,10 @@ namespace nirfsa_grpc { } auto status = library_->ConfigureAcquisitionType(vi, acquisition_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -229,6 +255,10 @@ namespace nirfsa_grpc { } auto status = library_->ConfigureDeembeddingTableInterpolationLinear(vi, port, table_name, format); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -250,6 +280,10 @@ namespace nirfsa_grpc { auto port = request->port().c_str(); auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationNearest(vi, port, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -271,6 +305,10 @@ namespace nirfsa_grpc { auto port = request->port().c_str(); auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationSpline(vi, port, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -326,6 +364,10 @@ namespace nirfsa_grpc { } auto status = library_->ConfigureDigitalEdgeAdvanceTrigger(vi, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -382,6 +424,10 @@ namespace nirfsa_grpc { ViInt64 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureDigitalEdgeRefTrigger(vi, source, edge, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -437,6 +483,10 @@ namespace nirfsa_grpc { } auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -458,6 +508,10 @@ namespace nirfsa_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 carrier_frequency = request->carrier_frequency(); auto status = library_->ConfigureIQCarrierFrequency(vi, channel_list, carrier_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -496,6 +550,10 @@ namespace nirfsa_grpc { ViInt64 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureIQPowerEdgeRefTrigger(vi, source, level, slope, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -517,6 +575,10 @@ namespace nirfsa_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 iq_rate = request->iq_rate(); auto status = library_->ConfigureIQRate(vi, channel_list, iq_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -539,6 +601,10 @@ namespace nirfsa_grpc { ViBoolean number_of_records_is_finite = request->number_of_records_is_finite(); ViInt64 number_of_records = request->number_of_records(); auto status = library_->ConfigureNumberOfRecords(vi, channel_list, number_of_records_is_finite, number_of_records); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -561,6 +627,10 @@ namespace nirfsa_grpc { ViBoolean number_of_samples_is_finite = request->number_of_samples_is_finite(); ViInt64 samples_per_record = request->samples_per_record(); auto status = library_->ConfigureNumberOfSamples(vi, channel_list, number_of_samples_is_finite, samples_per_record); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -600,6 +670,10 @@ namespace nirfsa_grpc { } auto status = library_->ConfigurePXIChassisClk10(vi, pxi_clk10_source); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -640,6 +714,10 @@ namespace nirfsa_grpc { ViReal64 ref_clock_rate = request->ref_clock_rate(); auto status = library_->ConfigureRefClock(vi, clock_source, ref_clock_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -661,6 +739,10 @@ namespace nirfsa_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 reference_level = request->reference_level(); auto status = library_->ConfigureReferenceLevel(vi, channel_list, reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -682,6 +764,10 @@ namespace nirfsa_grpc { auto channel_list = request->channel_list().c_str(); ViReal64 resolution_bandwidth = request->resolution_bandwidth(); auto status = library_->ConfigureResolutionBandwidth(vi, channel_list, resolution_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -701,6 +787,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeAdvanceTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -721,6 +811,10 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt64 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureSoftwareEdgeRefTrigger(vi, pretrigger_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -740,6 +834,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -762,6 +860,10 @@ namespace nirfsa_grpc { ViReal64 center_frequency = request->center_frequency(); ViReal64 span = request->span(); auto status = library_->ConfigureSpectrumFrequencyCenterSpan(vi, channel_list, center_frequency, span); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -784,6 +886,10 @@ namespace nirfsa_grpc { ViReal64 start_frequency = request->start_frequency(); ViReal64 stop_frequency = request->stop_frequency(); auto status = library_->ConfigureSpectrumFrequencyStartStop(vi, channel_list, start_frequency, stop_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -807,6 +913,10 @@ namespace nirfsa_grpc { auto list_attribute_ids = const_cast(reinterpret_cast(request->list_attribute_ids().data())); ViBoolean set_as_active_list = request->set_as_active_list(); auto status = library_->CreateConfigurationList(vi, list_name, number_of_list_attributes, list_attribute_ids, set_as_active_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -827,6 +937,10 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateConfigurationListStep(vi, set_as_active_step); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -869,6 +983,10 @@ namespace nirfsa_grpc { } auto status = library_->CreateDeembeddingSparameterTableArray(vi, port, table_name, frequencies, frequencies_size, sparameter_table.data(), sparameter_table_size, number_of_ports, sparameter_orientation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -907,6 +1025,10 @@ namespace nirfsa_grpc { } auto status = library_->CreateDeembeddingSparameterTableS2PFile(vi, port, table_name, s2p_file_path, sparameter_orientation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -926,6 +1048,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DeleteAllDeembeddingTables(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -946,6 +1072,10 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto list_name = request->list_name().c_str(); auto status = library_->DeleteConfigurationList(vi, list_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -967,6 +1097,10 @@ namespace nirfsa_grpc { auto port = request->port().c_str(); auto table_name = request->table_name().c_str(); auto status = library_->DeleteDeembeddingTable(vi, port, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -986,6 +1120,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1005,6 +1143,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableAdvanceTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1024,6 +1166,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableRefTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1043,6 +1189,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1063,6 +1213,10 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean enable = request->enable(); auto status = library_->EnableSessionAccess(vi, enable); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1084,11 +1238,13 @@ namespace nirfsa_grpc { ViStatus status_code = request->status_code(); std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorMessage(vi, status_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1109,12 +1265,14 @@ namespace nirfsa_grpc { ViInt32 error_code {}; std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1170,6 +1328,10 @@ namespace nirfsa_grpc { } auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1196,11 +1358,13 @@ namespace nirfsa_grpc { std::vector data(number_of_samples * number_of_records, NIComplexNumberF32_struct()); std::vector wfm_info(number_of_records, niRFSA_wfmInfo_struct()); auto status = library_->FetchIQMultiRecordComplexF32(vi, channel_list, starting_record, number_of_records, number_of_samples, timeout, data.data(), wfm_info.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1226,11 +1390,13 @@ namespace nirfsa_grpc { std::vector data(number_of_samples * number_of_records, NIComplexNumber_struct()); std::vector wfm_info(number_of_records, niRFSA_wfmInfo_struct()); auto status = library_->FetchIQMultiRecordComplexF64(vi, channel_list, starting_record, number_of_records, number_of_samples, timeout, data.data(), wfm_info.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1256,11 +1422,13 @@ namespace nirfsa_grpc { std::vector data(number_of_samples * number_of_records, NIComplexI16_struct()); std::vector wfm_info(number_of_records, niRFSA_wfmInfo_struct()); auto status = library_->FetchIQMultiRecordComplexI16(vi, channel_list, starting_record, number_of_records, number_of_samples, timeout, data.data(), wfm_info.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1285,11 +1453,13 @@ namespace nirfsa_grpc { std::vector data(number_of_samples, NIComplexNumberF32_struct()); niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->FetchIQSingleRecordComplexF32(vi, channel_list, record_number, number_of_samples, timeout, data.data(), &wfm_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1314,11 +1484,13 @@ namespace nirfsa_grpc { std::vector data(number_of_samples, NIComplexNumber_struct()); niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->FetchIQSingleRecordComplexF64(vi, channel_list, record_number, number_of_samples, timeout, data.data(), &wfm_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1343,11 +1515,13 @@ namespace nirfsa_grpc { std::vector data(number_of_samples, NIComplexI16_struct()); niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->FetchIQSingleRecordComplexI16(vi, channel_list, record_number, number_of_samples, timeout, data.data(), &wfm_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1369,10 +1543,12 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1394,10 +1570,12 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1419,10 +1597,12 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1444,10 +1624,12 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1469,11 +1651,13 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1496,10 +1680,10 @@ namespace nirfsa_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buf_size = status; std::string value; @@ -1511,11 +1695,13 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -1536,11 +1722,13 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); std::string info(2048 - 1, '\0'); auto status = library_->GetCalUserDefinedInfo(vi, (ViChar*)info.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_info(info); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1560,10 +1748,12 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 info_size {}; auto status = library_->GetCalUserDefinedInfoMaxSize(vi, &info_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_info_size(info_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1585,10 +1775,10 @@ namespace nirfsa_grpc { ViInt32 number_of_ports {}; while (true) { auto status = library_->GetDeembeddingSparameters(vi, nullptr, 0, &number_of_sparameters, &number_of_ports); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::vector sparameters(number_of_sparameters, NIComplexNumber_struct()); auto sparameters_array_size = number_of_sparameters; status = library_->GetDeembeddingSparameters(vi, sparameters.data(), sparameters_array_size, &number_of_sparameters, &number_of_ports); @@ -1596,8 +1786,11 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(sparameters, response->mutable_sparameters()); { auto shrunk_size = number_of_sparameters; @@ -1608,7 +1801,6 @@ namespace nirfsa_grpc { } response->set_number_of_sparameters(number_of_sparameters); response->set_number_of_ports(number_of_ports); - } return ::grpc::Status::OK; } } @@ -1647,10 +1839,10 @@ namespace nirfsa_grpc { ViInt32 number_of_frequencies {}; while (true) { auto status = library_->GetDeviceResponse(vi, channel_list, response_type, 0, nullptr, nullptr, nullptr, &number_of_frequencies); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_frequencies()->Resize(number_of_frequencies, 0); ViReal64* frequencies = response->mutable_frequencies()->mutable_data(); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); @@ -1663,13 +1855,15 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_frequencies()->Resize(number_of_frequencies, 0); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); response->mutable_phase_response()->Resize(number_of_frequencies, 0); response->set_number_of_frequencies(number_of_frequencies); - } return ::grpc::Status::OK; } } @@ -1691,10 +1885,10 @@ namespace nirfsa_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -1707,12 +1901,14 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -1737,14 +1933,16 @@ namespace nirfsa_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1764,10 +1962,12 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->GetExtCalLastTemp(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1787,10 +1987,12 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_months(months); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1812,10 +2014,12 @@ namespace nirfsa_grpc { ViInt64 record_number = request->record_number(); ViInt64 backlog {}; auto status = library_->GetFetchBacklog(vi, channel_list, record_number, &backlog); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_backlog(backlog); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1837,10 +2041,10 @@ namespace nirfsa_grpc { ViInt32 number_of_frequencies {}; while (true) { auto status = library_->GetFrequencyResponse(vi, channel_list, 0, nullptr, nullptr, nullptr, &number_of_frequencies); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_frequencies()->Resize(number_of_frequencies, 0); ViReal64* frequencies = response->mutable_frequencies()->mutable_data(); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); @@ -1853,13 +2057,15 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_frequencies()->Resize(number_of_frequencies, 0); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); response->mutable_phase_response()->Resize(number_of_frequencies, 0); response->set_number_of_frequencies(number_of_frequencies); - } return ::grpc::Status::OK; } } @@ -1882,10 +2088,10 @@ namespace nirfsa_grpc { ViInt32 number_of_coefficient_sets {}; while (true) { auto status = library_->GetNormalizationCoefficients(vi, channel_list, 0, nullptr, &number_of_coefficient_sets); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::vector coefficient_info(number_of_coefficient_sets, niRFSA_coefficientInfo_struct()); auto array_size = number_of_coefficient_sets; status = library_->GetNormalizationCoefficients(vi, channel_list, array_size, coefficient_info.data(), &number_of_coefficient_sets); @@ -1893,8 +2099,11 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); { auto shrunk_size = number_of_coefficient_sets; @@ -1904,7 +2113,6 @@ namespace nirfsa_grpc { } } response->set_number_of_coefficient_sets(number_of_coefficient_sets); - } return ::grpc::Status::OK; } } @@ -1926,10 +2134,12 @@ namespace nirfsa_grpc { auto channel_list = request->channel_list().c_str(); ViInt32 number_of_spectral_lines {}; auto status = library_->GetNumberOfSpectralLines(vi, channel_list, &number_of_spectral_lines); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_spectral_lines(number_of_spectral_lines); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1952,10 +2162,10 @@ namespace nirfsa_grpc { ViInt32 buffer_size {}; while (true) { auto status = library_->GetRelayName(vi, channel_list, index, nullptr, &buffer_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::string name; if (buffer_size > 0) { name.resize(buffer_size /* Workaround: strlen-bug */); @@ -1965,12 +2175,14 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); response->set_buffer_size(buffer_size); - } return ::grpc::Status::OK; } } @@ -1993,10 +2205,10 @@ namespace nirfsa_grpc { ViInt32 buffer_size {}; while (true) { auto status = library_->GetRelayOperationsCount(vi, channel_list, nullptr, &buffer_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_operations_count()->Resize(buffer_size, 0); ViInt32* operations_count = reinterpret_cast(response->mutable_operations_count()->mutable_data()); status = library_->GetRelayOperationsCount(vi, channel_list, operations_count, &buffer_size); @@ -2004,11 +2216,13 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_operations_count()->Resize(buffer_size, 0); response->set_buffer_size(buffer_size); - } return ::grpc::Status::OK; } } @@ -2031,10 +2245,10 @@ namespace nirfsa_grpc { ViInt32 number_of_coefficient_sets {}; while (true) { auto status = library_->GetScalingCoefficients(vi, channel_list, 0, nullptr, &number_of_coefficient_sets); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::vector coefficient_info(number_of_coefficient_sets, niRFSA_coefficientInfo_struct()); auto array_size = number_of_coefficient_sets; status = library_->GetScalingCoefficients(vi, channel_list, array_size, coefficient_info.data(), &number_of_coefficient_sets); @@ -2042,8 +2256,11 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); { auto shrunk_size = number_of_coefficient_sets; @@ -2053,7 +2270,6 @@ namespace nirfsa_grpc { } } response->set_number_of_coefficient_sets(number_of_coefficient_sets); - } return ::grpc::Status::OK; } } @@ -2079,14 +2295,16 @@ namespace nirfsa_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(vi, self_calibration_step, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2107,10 +2325,12 @@ namespace nirfsa_grpc { ViInt64 self_calibration_step = request->self_calibration_step(); ViReal64 temp {}; auto status = library_->GetSelfCalLastTemp(vi, self_calibration_step, &temp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temp(temp); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2130,10 +2350,12 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); SmtSpectrumInfo_struct spectrum_info {}; auto status = library_->GetSpectralInfoForSMT(vi, &spectrum_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2154,10 +2376,12 @@ namespace nirfsa_grpc { auto stream_endpoint = request->stream_endpoint().c_str(); ViUInt32 writer_handle {}; auto status = library_->GetStreamEndpointHandle(vi, stream_endpoint, &writer_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_writer_handle(writer_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2198,11 +2422,13 @@ namespace nirfsa_grpc { terminal_name.resize(buffer_size - 1); } auto status = library_->GetTerminalName(vi, signal, signal_identifier, buffer_size, (ViChar*)terminal_name.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_terminal_name(terminal_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2224,10 +2450,10 @@ namespace nirfsa_grpc { ViInt32 actual_data_size {}; while (true) { auto status = library_->GetUserData(vi, identifier, 0, nullptr, &actual_data_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::string data(actual_data_size, '\0'); auto buffer_size = actual_data_size; status = library_->GetUserData(vi, identifier, buffer_size, (ViInt8*)data.data(), &actual_data_size); @@ -2235,12 +2461,14 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_data(data); response->mutable_data()->resize(actual_data_size); response->set_actual_data_size(actual_data_size); - } return ::grpc::Status::OK; } } @@ -2270,14 +2498,12 @@ namespace nirfsa_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2307,14 +2533,12 @@ namespace nirfsa_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2333,6 +2557,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2352,6 +2580,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2373,8 +2605,11 @@ namespace nirfsa_grpc { ViBoolean self_cal_valid {}; ViInt64 valid_steps {}; auto status = library_->IsSelfCalValid(vi, &self_cal_valid, &valid_steps); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_cal_valid(self_cal_valid); if (valid_steps & 0x1) response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_ALIGNMENT); @@ -2397,7 +2632,6 @@ namespace nirfsa_grpc { if (valid_steps & 0x200) response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_DC_OFFSET); response->set_valid_steps_raw(valid_steps); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2416,6 +2650,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PerformThermalCorrection(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2440,11 +2678,13 @@ namespace nirfsa_grpc { std::vector data(data_array_size, NIComplexNumber_struct()); niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->ReadIQSingleRecordComplexF64(vi, channel_list, timeout, data.data(), data_array_size, &wfm_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2469,10 +2709,12 @@ namespace nirfsa_grpc { ViReal32* power_spectrum_data = response->mutable_power_spectrum_data()->mutable_data(); niRFSA_spectrumInfo_struct spectrum_info {}; auto status = library_->ReadPowerSpectrumF32(vi, channel_list, timeout, power_spectrum_data, data_array_size, &spectrum_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2497,10 +2739,12 @@ namespace nirfsa_grpc { ViReal64* power_spectrum_data = response->mutable_power_spectrum_data()->mutable_data(); niRFSA_spectrumInfo_struct spectrum_info {}; auto status = library_->ReadPowerSpectrumF64(vi, channel_list, timeout, power_spectrum_data, data_array_size, &spectrum_info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2519,6 +2763,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2540,6 +2788,10 @@ namespace nirfsa_grpc { auto channel_name = request->channel_name().c_str(); ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2559,6 +2811,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2578,6 +2834,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2613,6 +2873,10 @@ namespace nirfsa_grpc { } auto status = library_->ResetWithOptions(vi, steps_to_omit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2634,13 +2898,15 @@ namespace nirfsa_grpc { std::string driver_rev(256 - 1, '\0'); std::string instr_rev(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)driver_rev.data(), (ViChar*)instr_rev.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_driver_rev(driver_rev); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_rev())); response->set_instr_rev(instr_rev); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instr_rev())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2659,6 +2925,10 @@ namespace nirfsa_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2694,6 +2964,10 @@ namespace nirfsa_grpc { } auto status = library_->SelfCalibrate(vi, steps_to_omit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2733,6 +3007,10 @@ namespace nirfsa_grpc { ViReal64 min_reference_level = request->min_reference_level(); ViReal64 max_reference_level = request->max_reference_level(); auto status = library_->SelfCalibrateRange(vi, steps_to_omit, min_frequency, max_frequency, min_reference_level, max_reference_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2754,12 +3032,14 @@ namespace nirfsa_grpc { ViInt16 test_result {}; std::string test_message(2048 - 1, '\0'); auto status = library_->SelfTest(vi, &test_result, (ViChar*)test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_test_result(test_result); response->set_test_message(test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2795,6 +3075,10 @@ namespace nirfsa_grpc { auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_identifier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2817,6 +3101,10 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2854,6 +3142,10 @@ namespace nirfsa_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2876,6 +3168,10 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 value = request->value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2898,6 +3194,10 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2921,6 +3221,10 @@ namespace nirfsa_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2962,6 +3266,10 @@ namespace nirfsa_grpc { } auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2982,6 +3290,10 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto info = request->info().c_str(); auto status = library_->SetCalUserDefinedInfo(vi, info); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3004,10 +3316,12 @@ namespace nirfsa_grpc { ViInt32 buffer_size = request->buffer_size(); std::string data(buffer_size, '\0'); auto status = library_->SetUserData(vi, identifier, buffer_size, (ViInt8*)data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_data(data); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nirfsa/nirfsa_service.h b/generated/nirfsa/nirfsa_service.h index 767299c21..a929df75c 100644 --- a/generated/nirfsa/nirfsa_service.h +++ b/generated/nirfsa/nirfsa_service.h @@ -147,6 +147,7 @@ class NiRFSAService final : public NiRFSA::Service { private: NiRFSALibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXI_Trig0"},{13, "PXI_Trig1"},{14, "PXI_Trig2"},{15, "PXI_Trig3"},{16, "PXI_Trig4"},{17, "PXI_Trig5"},{18, "PXI_Trig6"},{19, "PXI_Trig7"},{20, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXI_Trig0", 12},{"PXI_Trig1", 13},{"PXI_Trig2", 14},{"PXI_Trig3", 15},{"PXI_Trig4", 16},{"PXI_Trig5", 17},{"PXI_Trig6", 18},{"PXI_Trig7", 19},{"TimerEvent", 20}, }; std::map exportterminal_input_map_ { {1, ""},{2, "PFI0"},{3, "PFI1"},{4, "PXI_Trig0"},{5, "PXI_Trig1"},{6, "PXI_Trig2"},{7, "PXI_Trig3"},{8, "PXI_Trig4"},{9, "PXI_Trig5"},{10, "PXI_Trig6"},{11, "PXI_Trig7"},{12, "PXI_STAR"},{13, "PXIe_DStarC"},{14, "RefOut"},{15, "RefOut2"},{16, "ClkOut"}, }; diff --git a/generated/nirfsg/nirfsg_service.cpp b/generated/nirfsg/nirfsg_service.cpp index 2d32c6b24..1bfa92189 100644 --- a/generated/nirfsg/nirfsg_service.cpp +++ b/generated/nirfsg/nirfsg_service.cpp @@ -56,6 +56,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -77,6 +81,10 @@ namespace nirfsg_grpc { auto waveform_name = request->waveform_name().c_str(); ViInt32 size_in_samples = request->size_in_samples(); auto status = library_->AllocateArbWaveform(vi, waveform_name, size_in_samples); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -99,6 +107,10 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value = request->value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -136,6 +148,10 @@ namespace nirfsg_grpc { } auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -158,6 +174,10 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 value = request->value_raw(); auto status = library_->CheckAttributeViInt64(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -195,6 +215,10 @@ namespace nirfsg_grpc { } auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -218,6 +242,10 @@ namespace nirfsg_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -259,6 +287,10 @@ namespace nirfsg_grpc { } auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -279,10 +311,12 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean is_done {}; auto status = library_->CheckGenerationStatus(vi, &is_done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_done(is_done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -303,10 +337,12 @@ namespace nirfsg_grpc { auto list_name = request->list_name().c_str(); ViBoolean list_exists {}; auto status = library_->CheckIfConfigurationListExists(vi, list_name, &list_exists); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_list_exists(list_exists); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -327,10 +363,12 @@ namespace nirfsg_grpc { auto script_name = request->script_name().c_str(); ViBoolean script_exists {}; auto status = library_->CheckIfScriptExists(vi, script_name, &script_exists); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_script_exists(script_exists); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -351,10 +389,12 @@ namespace nirfsg_grpc { auto waveform_name = request->waveform_name().c_str(); ViBoolean waveform_exists {}; auto status = library_->CheckIfWaveformExists(vi, waveform_name, &waveform_exists); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_waveform_exists(waveform_exists); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -373,6 +413,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearAllArbWaveforms(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -393,6 +437,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto name = request->name().c_str(); auto status = library_->ClearArbWaveform(vi, name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -412,6 +460,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -431,6 +483,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearSelfCalibrateRange(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -451,6 +507,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -470,6 +530,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -507,6 +571,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureDeembeddingTableInterpolationLinear(vi, port, table_name, format); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -528,6 +596,10 @@ namespace nirfsg_grpc { auto port = request->port().c_str(); auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationNearest(vi, port, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -549,6 +621,10 @@ namespace nirfsg_grpc { auto port = request->port().c_str(); auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationSpline(vi, port, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -604,6 +680,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureDigitalEdgeConfigurationListStepTrigger(vi, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -679,6 +759,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureDigitalEdgeScriptTrigger(vi, trigger_id, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -734,6 +818,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -809,6 +897,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureDigitalLevelScriptTrigger(vi, trigger_id, source, level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -830,6 +922,10 @@ namespace nirfsg_grpc { ViInt32 number_of_samples = static_cast(request->user_defined_waveform().size()); ViInt8* user_defined_waveform = (ViInt8*)request->user_defined_waveform().c_str(); auto status = library_->ConfigureDigitalModulationUserDefinedWaveform(vi, number_of_samples, user_defined_waveform); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -865,6 +961,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureGenerationMode(vi, generation_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -885,6 +985,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean output_enabled = request->output_enabled(); auto status = library_->ConfigureOutputEnabled(vi, output_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -905,6 +1009,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt64 p2p_endpoint_fullness_level = request->p2p_endpoint_fullness_level(); auto status = library_->ConfigureP2PEndpointFullnessStartTrigger(vi, p2p_endpoint_fullness_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -944,6 +1052,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigurePXIChassisClk10(vi, pxi_clk10_source); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -979,6 +1091,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigurePowerLevelType(vi, power_level_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1000,6 +1116,10 @@ namespace nirfsg_grpc { ViReal64 frequency = request->frequency(); ViReal64 power_level = request->power_level(); auto status = library_->ConfigureRF(vi, frequency, power_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1040,6 +1160,10 @@ namespace nirfsg_grpc { ViReal64 ref_clock_rate = request->ref_clock_rate(); auto status = library_->ConfigureRefClock(vi, ref_clock_source, ref_clock_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1060,6 +1184,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 signal_bandwidth = request->signal_bandwidth(); auto status = library_->ConfigureSignalBandwidth(vi, signal_bandwidth); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1099,6 +1227,10 @@ namespace nirfsg_grpc { } auto status = library_->ConfigureSoftwareScriptTrigger(vi, trigger_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1118,6 +1250,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1140,6 +1276,10 @@ namespace nirfsg_grpc { ViBoolean ensure_pll_locked = request->ensure_pll_locked(); auto reserved_for_future_use = 0; auto status = library_->ConfigureUpconverterPLLSettlingTime(vi, pll_settling_time, ensure_pll_locked, reserved_for_future_use); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1163,6 +1303,10 @@ namespace nirfsg_grpc { auto configuration_list_attributes = const_cast(reinterpret_cast(request->configuration_list_attributes().data())); ViBoolean set_as_active_list = request->set_as_active_list(); auto status = library_->CreateConfigurationList(vi, list_name, number_of_attributes, configuration_list_attributes, set_as_active_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1183,6 +1327,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateConfigurationListStep(vi, set_as_active_step); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1225,6 +1373,10 @@ namespace nirfsg_grpc { } auto status = library_->CreateDeembeddingSparameterTableArray(vi, port, table_name, frequencies, frequencies_size, sparameter_table.data(), sparameter_table_size, number_of_ports, sparameter_orientation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1263,6 +1415,10 @@ namespace nirfsg_grpc { } auto status = library_->CreateDeembeddingSparameterTableS2PFile(vi, port, table_name, s2p_file_path, sparameter_orientation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1282,6 +1438,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DeleteAllDeembeddingTables(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1302,6 +1462,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto list_name = request->list_name().c_str(); auto status = library_->DeleteConfigurationList(vi, list_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1323,6 +1487,10 @@ namespace nirfsg_grpc { auto port = request->port().c_str(); auto table_name = request->table_name().c_str(); auto status = library_->DeleteDeembeddingTable(vi, port, table_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1343,6 +1511,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto script_name = request->script_name().c_str(); auto status = library_->DeleteScript(vi, script_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1362,6 +1534,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1381,6 +1557,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableAllModulation(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1400,6 +1580,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableConfigurationListStepTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1439,6 +1623,10 @@ namespace nirfsg_grpc { } auto status = library_->DisableScriptTrigger(vi, trigger_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1458,6 +1646,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1479,11 +1671,13 @@ namespace nirfsg_grpc { ViStatus error_code = request->error_code(); std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1504,12 +1698,14 @@ namespace nirfsg_grpc { ViInt32 error_code {}; std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1584,6 +1780,10 @@ namespace nirfsg_grpc { } auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1606,10 +1806,12 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1631,10 +1833,12 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1656,10 +1860,12 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1681,10 +1887,12 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1706,11 +1914,13 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1733,10 +1943,10 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buf_size = status; std::string value; @@ -1748,11 +1958,13 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -1775,10 +1987,10 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string name; @@ -1790,11 +2002,13 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - } return ::grpc::Status::OK; } } @@ -1817,10 +2031,10 @@ namespace nirfsg_grpc { ViInt32 number_of_ports {}; while (true) { auto status = library_->GetDeembeddingSparameters(vi, nullptr, 0, &number_of_sparameters, &number_of_ports); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::vector sparameters(number_of_sparameters, NIComplexNumber_struct()); auto sparameters_array_size = number_of_sparameters; status = library_->GetDeembeddingSparameters(vi, sparameters.data(), sparameters_array_size, &number_of_sparameters, &number_of_ports); @@ -1828,8 +2042,11 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(sparameters, response->mutable_sparameters()); { auto shrunk_size = number_of_sparameters; @@ -1840,7 +2057,6 @@ namespace nirfsg_grpc { } response->set_number_of_sparameters(number_of_sparameters); response->set_number_of_ports(number_of_ports); - } return ::grpc::Status::OK; } } @@ -1862,10 +2078,10 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -1878,12 +2094,14 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } } @@ -1909,15 +2127,17 @@ namespace nirfsg_grpc { ViInt32 minute {}; ViInt32 second {}; auto status = library_->GetExternalCalibrationLastDateAndTime(vi, &year, &month, &day, &hour, &minute, &second); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); response->set_second(second); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1958,15 +2178,17 @@ namespace nirfsg_grpc { ViInt32 minute {}; ViInt32 second {}; auto status = library_->GetSelfCalibrationDateAndTime(vi, module, &year, &month, &day, &hour, &minute, &second); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); response->set_second(second); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2002,10 +2224,12 @@ namespace nirfsg_grpc { ViReal64 temperature {}; auto status = library_->GetSelfCalibrationTemperature(vi, module, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2062,10 +2286,10 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetTerminalName(vi, signal, signal_identifier, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string terminal_name; @@ -2077,11 +2301,13 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_terminal_name(terminal_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); - } return ::grpc::Status::OK; } } @@ -2104,10 +2330,10 @@ namespace nirfsg_grpc { ViInt32 actual_data_size {}; while (true) { auto status = library_->GetUserData(vi, identifier, 0, nullptr, &actual_data_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + std::string data(actual_data_size, '\0'); auto buffer_size = actual_data_size; status = library_->GetUserData(vi, identifier, buffer_size, (ViInt8*)data.data(), &actual_data_size); @@ -2115,12 +2341,14 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_data(data); response->mutable_data()->resize(actual_data_size); response->set_actual_data_size(actual_data_size); - } return ::grpc::Status::OK; } } @@ -2143,10 +2371,10 @@ namespace nirfsg_grpc { ViInt32 required_size {}; while (true) { auto status = library_->GetWaveformBurstStartLocations(vi, channel_name, 0, nullptr, &required_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_locations()->Resize(required_size, 0); ViReal64* locations = response->mutable_locations()->mutable_data(); auto number_of_locations = required_size; @@ -2155,11 +2383,13 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_locations()->Resize(required_size, 0); response->set_required_size(required_size); - } return ::grpc::Status::OK; } } @@ -2182,10 +2412,10 @@ namespace nirfsg_grpc { ViInt32 required_size {}; while (true) { auto status = library_->GetWaveformBurstStopLocations(vi, channel_name, 0, nullptr, &required_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_locations()->Resize(required_size, 0); ViReal64* locations = response->mutable_locations()->mutable_data(); auto number_of_locations = required_size; @@ -2194,11 +2424,13 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_locations()->Resize(required_size, 0); response->set_required_size(required_size); - } return ::grpc::Status::OK; } } @@ -2221,10 +2453,10 @@ namespace nirfsg_grpc { ViInt32 required_size {}; while (true) { auto status = library_->GetWaveformMarkerEventLocations(vi, channel_name, 0, nullptr, &required_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->mutable_locations()->Resize(required_size, 0); ViReal64* locations = response->mutable_locations()->mutable_data(); auto number_of_locations = required_size; @@ -2233,11 +2465,13 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_locations()->Resize(required_size, 0); response->set_required_size(required_size); - } return ::grpc::Status::OK; } } @@ -2267,14 +2501,12 @@ namespace nirfsg_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_new_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2304,14 +2536,12 @@ namespace nirfsg_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2330,6 +2560,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2349,6 +2583,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2370,6 +2608,10 @@ namespace nirfsg_grpc { auto channel_name = request->channel_name().c_str(); auto file_path = request->file_path().c_str(); auto status = library_->LoadConfigurationsFromFile(vi, channel_name, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2389,6 +2631,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PerformPowerSearch(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2408,6 +2654,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PerformThermalCorrection(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2431,13 +2681,15 @@ namespace nirfsg_grpc { ViInt32 min_waveform_size {}; ViInt32 max_waveform_size {}; auto status = library_->QueryArbWaveformCapabilities(vi, &max_number_waveforms, &waveform_quantum, &min_waveform_size, &max_waveform_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_max_number_waveforms(max_number_waveforms); response->set_waveform_quantum(waveform_quantum); response->set_min_waveform_size(min_waveform_size); response->set_max_waveform_size(max_waveform_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2459,6 +2711,10 @@ namespace nirfsg_grpc { auto file_path = request->file_path().c_str(); ViUInt32 waveform_index = request->waveform_index(); auto status = library_->ReadAndDownloadWaveformFromFileTDMS(vi, waveform_name, file_path, waveform_index); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2478,6 +2734,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2499,6 +2759,10 @@ namespace nirfsg_grpc { auto channel_name = request->channel_name().c_str(); ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2518,6 +2782,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2537,6 +2805,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2572,6 +2844,10 @@ namespace nirfsg_grpc { } auto status = library_->ResetWithOptions(vi, steps_to_omit); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2593,13 +2869,15 @@ namespace nirfsg_grpc { std::string instrument_driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2620,6 +2898,10 @@ namespace nirfsg_grpc { auto channel_name = request->channel_name().c_str(); auto file_path = request->file_path().c_str(); auto status = library_->SaveConfigurationsToFile(vi, channel_name, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2640,6 +2922,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto name = request->name().c_str(); auto status = library_->SelectArbWaveform(vi, name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2659,6 +2945,10 @@ namespace nirfsg_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2698,6 +2988,10 @@ namespace nirfsg_grpc { ViReal64 min_power_level = request->min_power_level(); ViReal64 max_power_level = request->max_power_level(); auto status = library_->SelfCalibrateRange(vi, steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2719,12 +3013,14 @@ namespace nirfsg_grpc { ViInt16 self_test_result {}; std::string self_test_message(2048 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2779,6 +3075,10 @@ namespace nirfsg_grpc { } auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_identifier); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2816,6 +3116,10 @@ namespace nirfsg_grpc { ViInt32 offset = request->offset(); auto status = library_->SetArbWaveformNextWritePosition(vi, waveform_name, relative_to, offset); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2838,6 +3142,10 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2875,6 +3183,10 @@ namespace nirfsg_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2897,6 +3209,10 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 value = request->value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2934,6 +3250,10 @@ namespace nirfsg_grpc { } auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2957,6 +3277,10 @@ namespace nirfsg_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2998,6 +3322,10 @@ namespace nirfsg_grpc { } auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3020,6 +3348,10 @@ namespace nirfsg_grpc { ViInt32 buffer_size = static_cast(request->data().size()); ViInt8* data = (ViInt8*)request->data().c_str(); auto status = library_->SetUserData(vi, identifier, buffer_size, data); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3042,6 +3374,10 @@ namespace nirfsg_grpc { ViInt32 number_of_locations = static_cast(request->locations().size()); auto locations = const_cast(request->locations().data()); auto status = library_->SetWaveformBurstStartLocations(vi, channel_name, number_of_locations, locations); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3064,6 +3400,10 @@ namespace nirfsg_grpc { ViInt32 number_of_locations = static_cast(request->locations().size()); auto locations = const_cast(request->locations().data()); auto status = library_->SetWaveformBurstStopLocations(vi, channel_name, number_of_locations, locations); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3086,6 +3426,10 @@ namespace nirfsg_grpc { ViInt32 number_of_locations = static_cast(request->locations().size()); auto locations = const_cast(request->locations().data()); auto status = library_->SetWaveformMarkerEventLocations(vi, channel_name, number_of_locations, locations); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3106,6 +3450,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 max_time_milliseconds = request->max_time_milliseconds(); auto status = library_->WaitUntilSettled(vi, max_time_milliseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3141,6 +3489,10 @@ namespace nirfsg_grpc { auto q_data = const_cast(request->q_data().data()); ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveform(vi, waveform_name, number_of_samples, i_data, q_data, more_data_pending); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3164,6 +3516,10 @@ namespace nirfsg_grpc { auto wfm_data = convert_from_grpc(request->wfm_data()); ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveformComplexF32(vi, waveform_name, number_of_samples, wfm_data.data(), more_data_pending); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3187,6 +3543,10 @@ namespace nirfsg_grpc { auto wfm_data = convert_from_grpc(request->wfm_data()); ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveformComplexF64(vi, waveform_name, number_of_samples, wfm_data.data(), more_data_pending); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3209,6 +3569,10 @@ namespace nirfsg_grpc { ViInt32 number_of_samples = static_cast(request->wfm_data().size()); auto wfm_data = convert_from_grpc(request->wfm_data()); auto status = library_->WriteArbWaveformComplexI16(vi, waveform_name, number_of_samples, wfm_data.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3244,6 +3608,10 @@ namespace nirfsg_grpc { auto q_data = const_cast(request->q_data().data()); ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveformF32(vi, waveform_name, number_of_samples, i_data, q_data, more_data_pending); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -3264,6 +3632,10 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto script = request->script().c_str(); auto status = library_->WriteScript(vi, script); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfsg/nirfsg_service.h b/generated/nirfsg/nirfsg_service.h index 8934b44b8..b0bd3d785 100644 --- a/generated/nirfsg/nirfsg_service.h +++ b/generated/nirfsg/nirfsg_service.h @@ -153,6 +153,7 @@ class NiRFSGService final : public NiRFSG::Service { private: NiRFSGLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); std::map digitaledgeconfigurationliststeptriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PFI2"},{4, "PFI3"},{5, "PXI_Trig0"},{6, "PXI_Trig1"},{7, "PXI_Trig2"},{8, "PXI_Trig3"},{9, "PXI_Trig4"},{10, "PXI_Trig5"},{11, "PXI_Trig6"},{12, "PXI_Trig7"},{13, "PXI_STAR"},{14, "Marker0Event"},{15, "Marker1Event"},{16, "Marker2Event"},{17, "Marker3Event"},{18, "TimerEvent"},{19, "TrigIn"}, }; std::map digitaledgeconfigurationliststeptriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PFI2", 3},{"PFI3", 4},{"PXI_Trig0", 5},{"PXI_Trig1", 6},{"PXI_Trig2", 7},{"PXI_Trig3", 8},{"PXI_Trig4", 9},{"PXI_Trig5", 10},{"PXI_Trig6", 11},{"PXI_Trig7", 12},{"PXI_STAR", 13},{"Marker0Event", 14},{"Marker1Event", 15},{"Marker2Event", 16},{"Marker3Event", 17},{"TimerEvent", 18},{"TrigIn", 19}, }; std::map digitaledgescripttriggeridentifier_input_map_ { {1, "scriptTrigger0"},{2, "scriptTrigger1"},{3, "scriptTrigger2"},{4, "scriptTrigger3"}, }; diff --git a/generated/niscope/niscope_service.cpp b/generated/niscope/niscope_service.cpp index 1285b5443..c380bf6ba 100644 --- a/generated/niscope/niscope_service.cpp +++ b/generated/niscope/niscope_service.cpp @@ -56,6 +56,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -76,11 +80,13 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 acquisition_status {}; auto status = library_->AcquisitionStatus(vi, &acquisition_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_acquisition_status(static_cast(acquisition_status)); response->set_acquisition_status_raw(acquisition_status); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -116,10 +122,12 @@ namespace niscope_grpc { ViInt32 meas_waveform_size {}; auto status = library_->ActualMeasWfmSize(vi, array_meas_function, &meas_waveform_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_meas_waveform_size(meas_waveform_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -140,10 +148,12 @@ namespace niscope_grpc { auto channel_list = request->channel_list().c_str(); ViInt32 num_wfms {}; auto status = library_->ActualNumWfms(vi, channel_list, &num_wfms); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_num_wfms(num_wfms); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -163,10 +173,12 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 record_length {}; auto status = library_->ActualRecordLength(vi, &record_length); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_record_length(record_length); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -202,6 +214,10 @@ namespace niscope_grpc { } auto status = library_->AddWaveformProcessing(vi, channel_list, meas_function); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -222,6 +238,10 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 delay = request->delay(); auto status = library_->AdjustSampleClockRelativeDelay(vi, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -241,6 +261,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AutoSetup(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -260,6 +284,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->CableSenseSignalStart(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -279,6 +307,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->CableSenseSignalStop(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -315,6 +347,10 @@ namespace niscope_grpc { } auto status = library_->CalSelfCalibrate(vi, channel_list, option); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -337,6 +373,10 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value = request->value(); auto status = library_->CheckAttributeViBoolean(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -374,6 +414,10 @@ namespace niscope_grpc { } auto status = library_->CheckAttributeViInt32(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -411,6 +455,10 @@ namespace niscope_grpc { } auto status = library_->CheckAttributeViInt64(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -456,6 +504,10 @@ namespace niscope_grpc { } auto status = library_->CheckAttributeViReal64(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -479,6 +531,10 @@ namespace niscope_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -520,6 +576,10 @@ namespace niscope_grpc { } auto status = library_->CheckAttributeViString(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -556,6 +616,10 @@ namespace niscope_grpc { } auto status = library_->ClearWaveformMeasurementStats(vi, channel_list, clearable_measurement_function); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -576,6 +640,10 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto channel_list = request->channel_list().c_str(); auto status = library_->ClearWaveformProcessing(vi, channel_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -596,6 +664,10 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -615,6 +687,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -635,6 +711,10 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 acquisition_type = request->acquisition_type(); auto status = library_->ConfigureAcquisition(vi, acquisition_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -657,6 +737,10 @@ namespace niscope_grpc { ViReal64 input_impedance = request->input_impedance(); ViReal64 max_input_frequency = request->max_input_frequency(); auto status = library_->ConfigureChanCharacteristics(vi, channel_list, input_impedance, max_input_frequency); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -737,6 +821,10 @@ namespace niscope_grpc { ViBoolean master_enabled = request->master_enabled(); auto status = library_->ConfigureClock(vi, input_clock_source, output_clock_source, clock_sync_pulse_source, master_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -759,6 +847,10 @@ namespace niscope_grpc { ViInt32 number_of_coefficients = static_cast(request->coefficients().size()); auto coefficients = const_cast(request->coefficients().data()); auto status = library_->ConfigureEqualizationFilterCoefficients(vi, channel_list, number_of_coefficients, coefficients); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -783,6 +875,10 @@ namespace niscope_grpc { ViInt32 num_records = request->num_records(); ViBoolean enforce_realtime = request->enforce_realtime(); auto status = library_->ConfigureHorizontalTiming(vi, min_sample_rate, min_num_pts, ref_position, num_records, enforce_realtime); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -821,6 +917,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerDigital(vi, trigger_source, slope, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -876,6 +976,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerEdge(vi, trigger_source, level, slope, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -948,6 +1052,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerGlitch(vi, trigger_source, level, width, polarity, glitch_condition, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1004,6 +1112,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerHysteresis(vi, trigger_source, level, hysteresis, slope, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1023,6 +1135,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureTriggerImmediate(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1079,6 +1195,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerRunt(vi, trigger_source, low_threshold, high_threshold, polarity, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1100,6 +1220,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerSoftware(vi, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1188,6 +1312,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerVideo(vi, trigger_source, enable_dc_restore, signal_format, event_parameter, line_number, polarity, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1261,6 +1389,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerWidth(vi, trigger_source, level, low_threshold, high_threshold, polarity, condition, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1317,6 +1449,10 @@ namespace niscope_grpc { ViReal64 holdoff = request->holdoff(); ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerWindow(vi, trigger_source, low_level, high_level, window_mode, trigger_coupling, holdoff, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1357,6 +1493,10 @@ namespace niscope_grpc { ViReal64 probe_attenuation = request->probe_attenuation(); ViBoolean enabled = request->enabled(); auto status = library_->ConfigureVertical(vi, channel_list, range, offset, coupling, probe_attenuation, enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1376,6 +1516,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1398,11 +1542,13 @@ namespace niscope_grpc { ViChar* error_source = (ViChar*)request->error_source().c_str(); std::string error_description(642 - 1, '\0'); auto status = library_->ErrorHandler(vi, error_code, error_source, (ViChar*)error_description.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1423,10 +1569,10 @@ namespace niscope_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 size_in_bytes = status; std::string configuration(size_in_bytes, '\0'); @@ -1435,10 +1581,12 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_configuration(configuration); - } return ::grpc::Status::OK; } } @@ -1459,6 +1607,10 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1515,6 +1667,10 @@ namespace niscope_grpc { } auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1537,10 +1693,12 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_list, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1562,10 +1720,12 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_list, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1587,10 +1747,12 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_list, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1612,10 +1774,12 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_list, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1637,11 +1801,13 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_list, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1664,10 +1830,10 @@ namespace niscope_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_list, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buf_size = status; std::string value; @@ -1679,11 +1845,13 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -1706,10 +1874,10 @@ namespace niscope_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string channel_string; @@ -1721,11 +1889,13 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_channel_string(channel_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); - } return ::grpc::Status::OK; } } @@ -1748,10 +1918,10 @@ namespace niscope_grpc { while (true) { auto status = library_->GetChannelNameFromString(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string name; @@ -1763,11 +1933,13 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - } return ::grpc::Status::OK; } } @@ -1791,9 +1963,11 @@ namespace niscope_grpc { response->mutable_coefficients()->Resize(number_of_coefficients, 0); ViReal64* coefficients = response->mutable_coefficients()->mutable_data(); auto status = library_->GetEqualizationFilterCoefficients(vi, channel, number_of_coefficients, coefficients); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1814,10 +1988,10 @@ namespace niscope_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; ViStatus error_code {}; @@ -1825,17 +1999,19 @@ namespace niscope_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &error_code, buffer_size, (ViChar*)description.data()); + status = library_->GetError(vi, &error_code, buffer_size, description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_description(description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); - } return ::grpc::Status::OK; } } @@ -1858,10 +2034,10 @@ namespace niscope_grpc { while (true) { auto status = library_->GetErrorMessage(vi, error_code, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string error_message; @@ -1873,11 +2049,13 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } } @@ -1906,10 +2084,12 @@ namespace niscope_grpc { ViReal64* phases = response->mutable_phases()->mutable_data(); ViInt32 number_of_frequencies {}; auto status = library_->GetFrequencyResponse(vi, channel, buffer_size, frequencies, amplitudes, phases, &number_of_frequencies); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_number_of_frequencies(number_of_frequencies); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1930,10 +2110,12 @@ namespace niscope_grpc { auto stream_name = request->stream_name().c_str(); ViUInt32 writer_handle {}; auto status = library_->GetStreamEndpointHandle(vi, stream_name, &writer_handle); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_writer_handle(writer_handle); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1954,6 +2136,10 @@ namespace niscope_grpc { ViInt32 size_in_bytes = static_cast(request->configuration().size()); ViInt8* configuration = (ViInt8*)request->configuration().c_str(); auto status = library_->ImportAttributeConfigurationBuffer(vi, size_in_bytes, configuration); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1974,6 +2160,10 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2003,14 +2193,12 @@ namespace niscope_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2040,14 +2228,12 @@ namespace niscope_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2066,6 +2252,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InitiateAcquisition(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2085,6 +2275,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ProbeCompensationSignalStart(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2104,6 +2298,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ProbeCompensationSignalStop(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2123,6 +2321,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2142,6 +2344,10 @@ namespace niscope_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2163,13 +2369,15 @@ namespace niscope_grpc { std::string driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_driver_revision(driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2189,10 +2397,12 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 sample_mode {}; auto status = library_->SampleMode(vi, &sample_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_sample_mode(sample_mode); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2212,10 +2422,12 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 sample_rate {}; auto status = library_->SampleRate(vi, &sample_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_sample_rate(sample_rate); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2236,12 +2448,14 @@ namespace niscope_grpc { ViInt16 self_test_result {}; std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2276,6 +2490,10 @@ namespace niscope_grpc { } auto status = library_->SendSoftwareTriggerEdge(vi, which_trigger); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2298,6 +2516,10 @@ namespace niscope_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2335,6 +2557,10 @@ namespace niscope_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2372,6 +2598,10 @@ namespace niscope_grpc { } auto status = library_->SetAttributeViInt64(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2417,6 +2647,10 @@ namespace niscope_grpc { } auto status = library_->SetAttributeViReal64(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2440,6 +2674,10 @@ namespace niscope_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -2481,6 +2719,10 @@ namespace niscope_grpc { } auto status = library_->SetAttributeViString(vi, channel_list, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/niscope/niscope_service.h b/generated/niscope/niscope_service.h index 80538b0b4..d69861b63 100644 --- a/generated/niscope/niscope_service.h +++ b/generated/niscope/niscope_service.h @@ -132,6 +132,7 @@ class NiScopeService final : public NiScope::Service { private: NiScopeLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); std::map clockingterminalvalues_input_map_ { {1, "VAL_NO_SOURCE"},{2, "VAL_RTSI_CLOCK"},{3, "VAL_EXTERNAL"},{4, "VAL_PFI_0"},{5, "VAL_PFI_1"},{6, "VAL_PFI_2"},{7, "VAL_CLK_IN"},{8, "VAL_CLK_OUT"},{9, "VAL_INTERNAL10MHZ_OSC"},{10, "VAL_PXI_CLK"},{11, "VAL_PXI_CLK10"},{12, "VAL_PXI_CLK100"},{13, "VAL_PXIE_DSTAR_A"},{14, "VAL_AUX_0_CLK_IN"},{15, "VAL_AUX_0_CLK_OUT"},{16, "VAL_ONBOARD_CONFIGURABLE_RATE_CLK"}, }; std::map clockingterminalvalues_output_map_ { {"VAL_NO_SOURCE", 1},{"VAL_RTSI_CLOCK", 2},{"VAL_EXTERNAL", 3},{"VAL_PFI_0", 4},{"VAL_PFI_1", 5},{"VAL_PFI_2", 6},{"VAL_CLK_IN", 7},{"VAL_CLK_OUT", 8},{"VAL_INTERNAL10MHZ_OSC", 9},{"VAL_PXI_CLK", 10},{"VAL_PXI_CLK10", 11},{"VAL_PXI_CLK100", 12},{"VAL_PXIE_DSTAR_A", 13},{"VAL_AUX_0_CLK_IN", 14},{"VAL_AUX_0_CLK_OUT", 15},{"VAL_ONBOARD_CONFIGURABLE_RATE_CLK", 16}, }; std::map niscopereal64attributevaluesmapped_input_map_ { {1, 50.0f},{2, 75.0f},{3, 1000000.0f},{4, 0.0f},{5, -1.0f},{6, 20000000.0f},{7, 100000000.0f},{8, 20000000.0f},{9, 100000000.0f}, }; diff --git a/generated/niswitch/niswitch_service.cpp b/generated/niswitch/niswitch_service.cpp index 6f442730e..6ae4da806 100644 --- a/generated/niswitch/niswitch_service.cpp +++ b/generated/niswitch/niswitch_service.cpp @@ -56,6 +56,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AbortScan(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -78,11 +82,13 @@ namespace niswitch_grpc { auto channel2 = request->channel2().c_str(); ViInt32 path_capability {}; auto status = library_->CanConnect(vi, channel1, channel2, &path_capability); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_path_capability(static_cast(path_capability)); response->set_path_capability_raw(path_capability); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -104,6 +110,10 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -141,6 +151,10 @@ namespace niswitch_grpc { } auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -163,6 +177,10 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value = request->attribute_value_raw(); auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -185,6 +203,10 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -208,6 +230,10 @@ namespace niswitch_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -227,6 +253,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -246,6 +276,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -266,6 +300,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -285,6 +323,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -321,6 +363,10 @@ namespace niswitch_grpc { } auto status = library_->ConfigureScanList(vi, scanlist, scan_mode); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -373,6 +419,10 @@ namespace niswitch_grpc { } auto status = library_->ConfigureScanTrigger(vi, scan_delay, trigger_input, scan_advanced_output); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -394,6 +444,10 @@ namespace niswitch_grpc { auto channel1 = request->channel1().c_str(); auto channel2 = request->channel2().c_str(); auto status = library_->Connect(vi, channel1, channel2); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -414,6 +468,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto connection_list = request->connection_list().c_str(); auto status = library_->ConnectMultiple(vi, connection_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -433,6 +491,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -454,6 +516,10 @@ namespace niswitch_grpc { auto channel1 = request->channel1().c_str(); auto channel2 = request->channel2().c_str(); auto status = library_->Disconnect(vi, channel1, channel2); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -473,6 +539,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisconnectAll(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -493,6 +563,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto disconnection_list = request->disconnection_list().c_str(); auto status = library_->DisconnectMultiple(vi, disconnection_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -514,11 +588,13 @@ namespace niswitch_grpc { ViStatus error_code = request->error_code(); std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -539,12 +615,14 @@ namespace niswitch_grpc { ViInt32 error_code {}; std::string error_message(256 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_code(error_code); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -566,10 +644,12 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -591,10 +671,12 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -616,10 +698,12 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -642,10 +726,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 array_size = status; std::string attribute_value; @@ -657,11 +741,13 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); - } return ::grpc::Status::OK; } } @@ -684,11 +770,13 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -710,10 +798,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string channel_name_buffer; @@ -725,11 +813,13 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_channel_name_buffer(channel_name_buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name_buffer())); - } return ::grpc::Status::OK; } } @@ -751,10 +841,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; ViStatus code {}; @@ -762,17 +852,19 @@ namespace niswitch_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &code, buffer_size, (ViChar*)description.data()); + status = library_->GetError(vi, &code, buffer_size, description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_code(code); response->set_description(description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); - } return ::grpc::Status::OK; } } @@ -794,10 +886,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string coercion_record; @@ -809,11 +901,13 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); - } return ::grpc::Status::OK; } } @@ -835,10 +929,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string interchange_warning; @@ -850,11 +944,13 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); - } return ::grpc::Status::OK; } } @@ -878,10 +974,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetPath(vi, channel1, channel2, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string path; @@ -893,11 +989,13 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_path(path); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_path())); - } return ::grpc::Status::OK; } } @@ -919,10 +1017,12 @@ namespace niswitch_grpc { auto relay_name = request->relay_name().c_str(); ViInt32 relay_count {}; auto status = library_->GetRelayCount(vi, relay_name, &relay_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_relay_count(relay_count); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -944,10 +1044,10 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetRelayName(vi, index, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 relay_name_buffer_size = status; std::string relay_name_buffer; @@ -959,11 +1059,13 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_relay_name_buffer(relay_name_buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_relay_name_buffer())); - } return ::grpc::Status::OK; } } @@ -985,11 +1087,13 @@ namespace niswitch_grpc { auto relay_name = request->relay_name().c_str(); ViInt32 relay_position {}; auto status = library_->GetRelayPosition(vi, relay_name, &relay_position); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_relay_position(static_cast(relay_position)); response->set_relay_position_raw(relay_position); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1018,14 +1122,12 @@ namespace niswitch_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1055,14 +1157,12 @@ namespace niswitch_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1092,14 +1192,12 @@ namespace niswitch_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1118,6 +1216,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InitiateScan(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1137,6 +1239,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1157,10 +1263,12 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean is_debounced {}; auto status = library_->IsDebounced(vi, &is_debounced); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_debounced(is_debounced); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1180,10 +1288,12 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean is_scanning {}; auto status = library_->IsScanning(vi, &is_scanning); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_scanning(is_scanning); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1219,6 +1329,10 @@ namespace niswitch_grpc { } auto status = library_->RelayControl(vi, relay_name, relay_action); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1238,6 +1352,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1257,6 +1375,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1276,6 +1398,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1297,13 +1423,15 @@ namespace niswitch_grpc { std::string instrument_driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1355,6 +1483,10 @@ namespace niswitch_grpc { ViBoolean invert = request->invert(); auto status = library_->RouteScanAdvancedOutput(vi, scan_advanced_output_connector, scan_advanced_output_bus_line, invert); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1407,6 +1539,10 @@ namespace niswitch_grpc { ViBoolean invert = request->invert(); auto status = library_->RouteTriggerInput(vi, trigger_input_connector, trigger_input_bus_line, invert); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1443,6 +1579,10 @@ namespace niswitch_grpc { } auto status = library_->Scan(vi, scanlist, initiation); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1464,12 +1604,14 @@ namespace niswitch_grpc { ViInt16 self_test_result {}; std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1488,6 +1630,10 @@ namespace niswitch_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SendSoftwareTrigger(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1510,6 +1656,10 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1547,6 +1697,10 @@ namespace niswitch_grpc { } auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1569,6 +1723,10 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 attribute_value = request->attribute_value_raw(); auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1591,6 +1749,10 @@ namespace niswitch_grpc { ViAttr attribute_id = request->attribute_id(); ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1614,6 +1776,10 @@ namespace niswitch_grpc { auto attribute_value_grpc_session = request->attribute_value(); ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1634,6 +1800,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViBoolean continuous_scan = request->continuous_scan(); auto status = library_->SetContinuousScan(vi, continuous_scan); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1654,6 +1824,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto path_list = request->path_list().c_str(); auto status = library_->SetPath(vi, path_list); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1674,6 +1848,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 maximum_time_ms = request->maximum_time_ms(); auto status = library_->WaitForDebounce(vi, maximum_time_ms); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1694,6 +1872,10 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 maximum_time_ms = request->maximum_time_ms(); auto status = library_->WaitForScanComplete(vi, maximum_time_ms); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/niswitch/niswitch_service.h b/generated/niswitch/niswitch_service.h index 52c3ecbc3..868cde239 100644 --- a/generated/niswitch/niswitch_service.h +++ b/generated/niswitch/niswitch_service.h @@ -104,6 +104,7 @@ class NiSwitchService final : public NiSwitch::Service { private: NiSwitchLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); NiSwitchFeatureToggles feature_toggles_; }; diff --git a/generated/nisync/nisync_service.cpp b/generated/nisync/nisync_service.cpp index 9d10d3998..0dc91c8d4 100644 --- a/generated/nisync/nisync_service.cpp +++ b/generated/nisync/nisync_service.cpp @@ -65,10 +65,12 @@ namespace nisync_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -88,6 +90,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -109,11 +115,13 @@ namespace nisync_grpc { ViStatus error_code = request->error_code(); std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -132,6 +140,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -151,6 +163,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PersistConfig(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -172,12 +188,14 @@ namespace nisync_grpc { ViInt16 self_test_result {}; std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -198,13 +216,15 @@ namespace nisync_grpc { std::string driver_revision(256 - 1, '\0'); std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)driver_revision.data(), (ViChar*)firmware_revision.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_driver_revision(driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); response->set_firmware_revision(firmware_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -228,6 +248,10 @@ namespace nisync_grpc { ViInt32 invert = request->invert(); ViInt32 update_edge = request->update_edge(); auto status = library_->ConnectTrigTerminals(vi, src_terminal, dest_terminal, sync_clock, invert, update_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -249,6 +273,10 @@ namespace nisync_grpc { auto src_terminal = request->src_terminal().c_str(); auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->DisconnectTrigTerminals(vi, src_terminal, dest_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -274,6 +302,10 @@ namespace nisync_grpc { ViInt32 update_edge = request->update_edge(); ViReal64 delay = request->delay(); auto status = library_->ConnectSWTrigToTerminal(vi, src_terminal, dest_terminal, sync_clock, invert, update_edge, delay); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -295,6 +327,10 @@ namespace nisync_grpc { auto src_terminal = request->src_terminal().c_str(); auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->DisconnectSWTrigFromTerminal(vi, src_terminal, dest_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -315,6 +351,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto src_terminal = request->src_terminal().c_str(); auto status = library_->SendSoftwareTrigger(vi, src_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -336,6 +376,10 @@ namespace nisync_grpc { auto src_terminal = request->src_terminal().c_str(); auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->ConnectClkTerminals(vi, src_terminal, dest_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -357,6 +401,10 @@ namespace nisync_grpc { auto src_terminal = request->src_terminal().c_str(); auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->DisconnectClkTerminals(vi, src_terminal, dest_terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -381,12 +429,14 @@ namespace nisync_grpc { ViReal64 frequency {}; ViReal64 error {}; auto status = library_->MeasureFrequency(vi, src_terminal, duration, &actual_duration, &frequency, &error); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_duration(actual_duration); response->set_frequency(frequency); response->set_error(error); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -411,12 +461,14 @@ namespace nisync_grpc { ViReal64 frequency {}; ViReal64 frequency_error {}; auto status = library_->MeasureFrequencyEx(vi, src_terminal, duration, decimation_count, &actual_duration, &frequency, &frequency_error); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_actual_duration(actual_duration); response->set_frequency(frequency); response->set_frequency_error(frequency_error); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -435,6 +487,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Start1588(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -454,6 +510,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Stop1588(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -473,6 +533,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Start8021AS(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -492,6 +556,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Stop8021AS(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -515,6 +583,10 @@ namespace nisync_grpc { ViUInt32 time_nanoseconds = request->time_nanoseconds(); ViUInt16 time_fractional_nanoseconds = request->time_fractional_nanoseconds(); auto status = library_->SetTime(vi, time_source, time_seconds, time_nanoseconds, time_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -537,12 +609,14 @@ namespace nisync_grpc { ViUInt32 time_nanoseconds {}; ViUInt16 time_fractional_nanoseconds {}; auto status = library_->GetTime(vi, &time_seconds, &time_nanoseconds, &time_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_time_seconds(time_seconds); response->set_time_nanoseconds(time_nanoseconds); response->set_time_fractional_nanoseconds(time_fractional_nanoseconds); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -561,6 +635,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetFrequency(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -585,6 +663,10 @@ namespace nisync_grpc { ViUInt32 time_nanoseconds = request->time_nanoseconds(); ViUInt16 time_fractional_nanoseconds = request->time_fractional_nanoseconds(); auto status = library_->CreateFutureTimeEvent(vi, terminal, output_level, time_seconds, time_nanoseconds, time_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -605,6 +687,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto terminal = request->terminal().c_str(); auto status = library_->ClearFutureTimeEvents(vi, terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -626,6 +712,10 @@ namespace nisync_grpc { auto terminal = request->terminal().c_str(); ViInt32 active_edge = request->active_edge(); auto status = library_->EnableTimeStampTrigger(vi, terminal, active_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -648,6 +738,10 @@ namespace nisync_grpc { ViInt32 active_edge = request->active_edge(); ViUInt32 decimation_count = request->decimation_count(); auto status = library_->EnableTimeStampTriggerWithDecimation(vi, terminal, active_edge, decimation_count); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -673,13 +767,15 @@ namespace nisync_grpc { ViUInt16 time_fractional_nanoseconds {}; ViInt32 detected_edge {}; auto status = library_->ReadTriggerTimeStamp(vi, terminal, timeout, &time_seconds, &time_nanoseconds, &time_fractional_nanoseconds, &detected_edge); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_time_seconds(time_seconds); response->set_time_nanoseconds(time_nanoseconds); response->set_time_fractional_nanoseconds(time_fractional_nanoseconds); response->set_detected_edge(detected_edge); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -699,6 +795,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto terminal = request->terminal().c_str(); auto status = library_->DisableTimeStampTrigger(vi, terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -727,6 +827,10 @@ namespace nisync_grpc { ViUInt32 stop_time_nanoseconds = request->stop_time_nanoseconds(); ViUInt16 stop_time_fractional_nanoseconds = request->stop_time_fractional_nanoseconds(); auto status = library_->CreateClock(vi, terminal, high_ticks, low_ticks, start_time_seconds, start_time_nanoseconds, start_time_fractional_nanoseconds, stop_time_seconds, stop_time_nanoseconds, stop_time_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -747,6 +851,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto terminal = request->terminal().c_str(); auto status = library_->ClearClock(vi, terminal); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -766,6 +874,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReferenceFreeRunning(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -785,6 +897,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReferenceGPS(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -806,6 +922,10 @@ namespace nisync_grpc { ViInt32 irig_type = request->irig_type(); auto terminal_name = request->terminal_name().c_str(); auto status = library_->SetTimeReferenceIRIG(vi, irig_type, terminal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -830,6 +950,10 @@ namespace nisync_grpc { ViUInt32 initial_time_nanoseconds = request->initial_time_nanoseconds(); ViUInt16 initial_time_fractional_nanoseconds = request->initial_time_fractional_nanoseconds(); auto status = library_->SetTimeReferencePPS(vi, terminal_name, use_manual_time, initial_time_seconds, initial_time_nanoseconds, initial_time_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -849,6 +973,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReference1588OrdinaryClock(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -868,6 +996,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReference8021AS(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -887,6 +1019,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->EnableGPSTimestamping(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -908,6 +1044,10 @@ namespace nisync_grpc { ViInt32 irig_type = request->irig_type(); auto terminal_name = request->terminal_name().c_str(); auto status = library_->EnableIRIGTimestamping(vi, irig_type, terminal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -933,15 +1073,17 @@ namespace nisync_grpc { ViUInt32 gps_nanoseconds {}; ViUInt16 gps_fractional_nanoseconds {}; auto status = library_->ReadLastGPSTimestamp(vi, ×tamp_seconds, ×tamp_nanoseconds, ×tamp_fractional_nanoseconds, &gps_seconds, &gps_nanoseconds, &gps_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_timestamp_seconds(timestamp_seconds); response->set_timestamp_nanoseconds(timestamp_nanoseconds); response->set_timestamp_fractional_nanoseconds(timestamp_fractional_nanoseconds); response->set_gps_seconds(gps_seconds); response->set_gps_nanoseconds(gps_nanoseconds); response->set_gps_fractional_nanoseconds(gps_fractional_nanoseconds); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -967,15 +1109,17 @@ namespace nisync_grpc { ViUInt32 irigb_nanoseconds {}; ViUInt16 irigb_fractional_nanoseconds {}; auto status = library_->ReadLastIRIGTimestamp(vi, terminal, ×tamp_seconds, ×tamp_nanoseconds, ×tamp_fractional_nanoseconds, &irigb_seconds, &irigb_nanoseconds, &irigb_fractional_nanoseconds); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_timestamp_seconds(timestamp_seconds); response->set_timestamp_nanoseconds(timestamp_nanoseconds); response->set_timestamp_fractional_nanoseconds(timestamp_fractional_nanoseconds); response->set_irigb_seconds(irigb_seconds); response->set_irigb_nanoseconds(irigb_nanoseconds); response->set_irigb_fractional_nanoseconds(irigb_fractional_nanoseconds); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -994,6 +1138,10 @@ namespace nisync_grpc { auto vi_grpc_session = request->vi(); ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableGPSTimestamping(vi); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1014,6 +1162,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto terminal_name = request->terminal_name().c_str(); auto status = library_->DisableIRIGTimestamping(vi, terminal_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1036,12 +1188,14 @@ namespace nisync_grpc { ViReal64 north_velocity {}; ViReal64 up_velocity {}; auto status = library_->GetVelocity(vi, &east_velocity, &north_velocity, &up_velocity); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_east_velocity(east_velocity); response->set_north_velocity(north_velocity); response->set_up_velocity(up_velocity); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1063,12 +1217,14 @@ namespace nisync_grpc { ViReal64 longitude {}; ViReal64 altitude {}; auto status = library_->GetLocation(vi, &latitude, &longitude, &altitude); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_latitude(latitude); response->set_longitude(longitude); response->set_altitude(altitude); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1089,10 +1245,10 @@ namespace nisync_grpc { while (true) { auto status = library_->GetTimeReferenceNames(vi, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViUInt32 buffer_size = status; std::string time_reference_names; @@ -1104,11 +1260,13 @@ namespace nisync_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_time_reference_names(time_reference_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_time_reference_names())); - } return ::grpc::Status::OK; } } @@ -1131,10 +1289,12 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, active_item, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1156,10 +1316,12 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, active_item, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1181,10 +1343,12 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, active_item, attribute, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1207,10 +1371,10 @@ namespace nisync_grpc { while (true) { auto status = library_->GetAttributeViString(vi, active_item, attribute, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + ViInt32 buffer_size = status; std::string value; @@ -1222,11 +1386,13 @@ namespace nisync_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); - } return ::grpc::Status::OK; } } @@ -1249,6 +1415,10 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); ViInt32 value = request->value_raw(); auto status = library_->SetAttributeViInt32(vi, active_item, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1271,6 +1441,10 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(vi, active_item, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1293,6 +1467,10 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, active_item, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1315,6 +1493,10 @@ namespace nisync_grpc { ViAttr attribute = request->attribute(); auto value = request->value_raw().c_str(); auto status = library_->SetAttributeViString(vi, active_item, attribute, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1339,14 +1521,16 @@ namespace nisync_grpc { ViInt32 hour {}; ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_year(year); response->set_month(month); response->set_day(day); response->set_hour(hour); response->set_minute(minute); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1366,10 +1550,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temp {}; auto status = library_->GetExtCalLastTemp(vi, &temp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temp(temp); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1389,10 +1575,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_months(months); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1413,6 +1601,10 @@ namespace nisync_grpc { auto old_password = request->old_password().c_str(); auto new_password = request->new_password().c_str(); auto status = library_->ChangeExtCalPassword(vi, old_password, new_password); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1433,10 +1625,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 temperature {}; auto status = library_->ReadCurrentTemperature(vi, &temperature); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_temperature(temperature); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1456,10 +1650,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 voltage {}; auto status = library_->CalGetOscillatorVoltage(vi, &voltage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_voltage(voltage); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1479,10 +1675,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 voltage {}; auto status = library_->CalGetClk10PhaseVoltage(vi, &voltage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_voltage(voltage); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1502,10 +1700,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 voltage {}; auto status = library_->CalGetDDSStartPulsePhaseVoltage(vi, &voltage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_voltage(voltage); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1525,10 +1725,12 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViReal64 phase {}; auto status = library_->CalGetDDSInitialPhase(vi, &phase); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_phase(phase); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1556,10 +1758,12 @@ namespace nisync_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_vi()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1579,6 +1783,10 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViInt32 action = request->action(); auto status = library_->CloseExtCal(vi, action); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1600,10 +1808,12 @@ namespace nisync_grpc { ViReal64 measured_voltage = request->measured_voltage(); ViReal64 old_voltage {}; auto status = library_->CalAdjustOscillatorVoltage(vi, measured_voltage, &old_voltage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_old_voltage(old_voltage); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1624,10 +1834,12 @@ namespace nisync_grpc { ViReal64 measured_voltage = request->measured_voltage(); ViReal64 old_voltage {}; auto status = library_->CalAdjustClk10PhaseVoltage(vi, measured_voltage, &old_voltage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_old_voltage(old_voltage); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1648,10 +1860,12 @@ namespace nisync_grpc { ViReal64 measured_voltage = request->measured_voltage(); ViReal64 old_voltage {}; auto status = library_->CalAdjustDDSStartPulsePhaseVoltage(vi, measured_voltage, &old_voltage); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_old_voltage(old_voltage); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1672,10 +1886,12 @@ namespace nisync_grpc { ViReal64 measured_phase = request->measured_phase(); ViReal64 old_phase {}; auto status = library_->CalAdjustDDSInitialPhase(vi, measured_phase, &old_phase); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } + response->set_status(status); - if (status_ok(status)) { response->set_old_phase(old_phase); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nisync/nisync_service.h b/generated/nisync/nisync_service.h index 6d1e215f3..2a55015fa 100644 --- a/generated/nisync/nisync_service.h +++ b/generated/nisync/nisync_service.h @@ -114,6 +114,7 @@ class NiSyncService final : public NiSync::Service { private: NiSyncLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi); NiSyncFeatureToggles feature_toggles_; }; diff --git a/generated/nitclk/nitclk_service.cpp b/generated/nitclk/nitclk_service.cpp index dca3088ed..13d94a999 100644 --- a/generated/nitclk/nitclk_service.cpp +++ b/generated/nitclk/nitclk_service.cpp @@ -61,6 +61,10 @@ namespace nitclk_grpc { std::back_inserter(sessions), [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); auto status = library_->ConfigureForHomogeneousTriggers(session_count, sessions.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -87,6 +91,10 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); ViReal64 min_time = request->min_time(); auto status = library_->FinishSyncPulseSenderSynchronize(session_count, sessions.data(), min_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -109,10 +117,12 @@ namespace nitclk_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 value {}; auto status = library_->GetAttributeViReal64(session, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, session); + } + response->set_status(status); - if (status_ok(status)) { response->set_value(value); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -134,11 +144,13 @@ namespace nitclk_grpc { ViAttr attribute_id = request->attribute_id(); ViSession value {}; auto status = library_->GetAttributeViSession(session, channel_name, attribute_id, &value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, session); + } + response->set_status(status); - if (status_ok(status)) { auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -157,10 +169,10 @@ namespace nitclk_grpc { while (true) { auto status = library_->GetExtendedErrorInfo(nullptr, 0); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + ViUInt32 error_string_size = status; std::string error_string; @@ -172,11 +184,13 @@ namespace nitclk_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_error_string(error_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); - } return ::grpc::Status::OK; } } @@ -202,6 +216,10 @@ namespace nitclk_grpc { std::back_inserter(sessions), [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); auto status = library_->Initiate(session_count, sessions.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -228,10 +246,12 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); ViBoolean done {}; auto status = library_->IsDone(session_count, sessions.data(), &done); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_done(done); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -253,6 +273,10 @@ namespace nitclk_grpc { ViAttr attribute_id = request->attribute_id(); ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(session, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -276,6 +300,10 @@ namespace nitclk_grpc { auto value_grpc_session = request->value(); ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(session, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -298,6 +326,10 @@ namespace nitclk_grpc { ViAttr attribute_id = request->attribute_id(); auto value = request->value_raw().c_str(); auto status = library_->SetAttributeViString(session, channel_name, attribute_id, value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -324,6 +356,10 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); ViReal64 min_time = request->min_time(); auto status = library_->SetupForSyncPulseSenderSynchronize(session_count, sessions.data(), min_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -350,6 +386,10 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); ViReal64 min_tclk_period = request->min_tclk_period(); auto status = library_->Synchronize(session_count, sessions.data(), min_tclk_period); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -376,6 +416,10 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); ViReal64 min_time = request->min_time(); auto status = library_->SynchronizeToSyncPulseSender(session_count, sessions.data(), min_time); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -402,6 +446,10 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); ViReal64 timeout = request->timeout(); auto status = library_->WaitUntilDone(session_count, sessions.data(), timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nitclk/nitclk_service.h b/generated/nitclk/nitclk_service.h index 26617699e..d77e5a5ec 100644 --- a/generated/nitclk/nitclk_service.h +++ b/generated/nitclk/nitclk_service.h @@ -59,6 +59,7 @@ class NiTClkService final : public NiTClk::Service { private: NiTClkLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession session_number); NiTClkFeatureToggles feature_toggles_; }; diff --git a/generated/nixnet/nixnet_service.cpp b/generated/nixnet/nixnet_service.cpp index d9dfd775f..80ee9b7c1 100644 --- a/generated/nixnet/nixnet_service.cpp +++ b/generated/nixnet/nixnet_service.cpp @@ -71,6 +71,10 @@ namespace nixnet_grpc { } auto status = library_->Blink(interface_ref, modifier); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, interface_ref); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -91,6 +95,10 @@ namespace nixnet_grpc { nxSessionRef_t session = session_repository_->access_session(session_grpc_session.id(), session_grpc_session.name()); session_repository_->remove_session(session_grpc_session.id(), session_grpc_session.name()); auto status = library_->Clear(session); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -150,6 +158,10 @@ namespace nixnet_grpc { } auto status = library_->ConnectTerminals(session, source, destination); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -192,10 +204,12 @@ namespace nixnet_grpc { std::vector buffer(size_of_buffer, u8()); u32 number_of_bytes_returned {}; auto status = library_->ConvertByteArrayToFramesSinglePoint(session, value_buffer, size_of_value_buffer, buffer.data(), size_of_buffer, &number_of_bytes_returned); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -218,10 +232,12 @@ namespace nixnet_grpc { u32 size_of_value_buffer = request->size_of_value_buffer(); std::string value_buffer(size_of_value_buffer, '\0'); auto status = library_->ConvertFramesToByteArraySinglePoint(session, frame_buffer, number_of_bytes_for_frames, (u8*)value_buffer.data(), size_of_value_buffer); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { response->set_value_buffer(value_buffer); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -249,9 +265,11 @@ namespace nixnet_grpc { response->mutable_timestamp_buffer()->Resize(number_of_signals, 0); nxTimestamp100ns_t* timestamp_buffer = reinterpret_cast(response->mutable_timestamp_buffer()->mutable_data()); auto status = library_->ConvertFramesToSignalsSinglePoint(session, frame_buffer, number_of_bytes_for_frames, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -293,10 +311,12 @@ namespace nixnet_grpc { std::vector buffer(size_of_buffer, u8()); u32 number_of_bytes_returned {}; auto status = library_->ConvertSignalsToFramesSinglePoint(session, value_buffer, size_of_value_buffer, buffer.data(), size_of_buffer, &number_of_bytes_returned); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -315,10 +335,12 @@ namespace nixnet_grpc { nxTimestamp100ns_t from_timestamp_100ns = request->from_timestamp_100ns(); nxTimestamp1ns_t to_timestamp_1ns {}; auto status = library_->ConvertTimestamp100nsTo1ns(from_timestamp_100ns, &to_timestamp_1ns); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_to_timestamp_1ns(to_timestamp_1ns); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -337,10 +359,12 @@ namespace nixnet_grpc { nxTimestamp1ns_t from_timestamp_1ns = request->from_timestamp_1ns(); nxTimestamp100ns_t to_timestamp_100ns {}; auto status = library_->ConvertTimestamp1nsTo100ns(from_timestamp_1ns, &to_timestamp_100ns); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_to_timestamp_100ns(to_timestamp_100ns); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -386,10 +410,12 @@ namespace nixnet_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->Clear(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_session()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -440,10 +466,12 @@ namespace nixnet_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->Clear(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_session()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -463,6 +491,10 @@ namespace nixnet_grpc { auto database_filepath = request->database_filepath().c_str(); u32 default_baud_rate = request->default_baud_rate(); auto status = library_->DbAddAlias(database_alias, database_filepath, default_baud_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -483,6 +515,10 @@ namespace nixnet_grpc { auto database_filepath = request->database_filepath().c_str(); u64 default_baud_rate = request->default_baud_rate(); auto status = library_->DbAddAlias64(database_alias, database_filepath, default_baud_rate); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -504,6 +540,10 @@ namespace nixnet_grpc { u32 close_all_refs = request->close_all_refs(); nx_database_ref_t_resource_repository_->remove_session(database_grpc_session.id(), database_grpc_session.name()); auto status = library_->DbCloseDatabase(database, close_all_refs); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -557,6 +597,10 @@ namespace nixnet_grpc { nxDatabaseRef_t db_object = nx_database_ref_t_resource_repository_->access_session(db_object_grpc_session.id(), db_object_grpc_session.name()); nx_database_ref_t_resource_repository_->remove_session(db_object_grpc_session.id(), db_object_grpc_session.name()); auto status = library_->DbDeleteObject(db_object); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -578,10 +622,12 @@ namespace nixnet_grpc { u32 wait_for_complete = request->wait_for_complete(); u32 percent_complete {}; auto status = library_->DbDeploy(ip_address, database_alias, wait_for_complete, &percent_complete); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_percent_complete(percent_complete); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -651,10 +697,12 @@ namespace nixnet_grpc { auto attribute_name = request->attribute_name().c_str(); u32 attribute_text_size {}; auto status = library_->DbGetDBCAttributeSize(db_object, mode, attribute_name, &attribute_text_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + } + response->set_status(status); - if (status_ok(status)) { response->set_attribute_text_size(attribute_text_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -674,11 +722,13 @@ namespace nixnet_grpc { u32 sizeof_alias_buffer {}; u32 sizeof_filepath_buffer {}; auto status = library_->DbGetDatabaseListSizes(ip_address, &sizeof_alias_buffer, &sizeof_filepath_buffer); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_sizeof_alias_buffer(sizeof_alias_buffer); response->set_sizeof_filepath_buffer(sizeof_filepath_buffer); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -714,10 +764,12 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->DbGetPropertySize(db_object, property_id, &property_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + } + response->set_status(status); - if (status_ok(status)) { response->set_property_size(property_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -757,10 +809,12 @@ namespace nixnet_grpc { u32 wait_for_complete = request->wait_for_complete(); u32 percent_complete {}; auto status = library_->DbMerge(target_cluster, source_obj, copy_mode, prefix, wait_for_complete, &percent_complete); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxDatabaseRef_t(status, target_cluster); + } + response->set_status(status); - if (status_ok(status)) { response->set_percent_complete(percent_complete); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -787,10 +841,12 @@ namespace nixnet_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxDatabaseRef_t id) { library_->DbCloseDatabase(id, false); }; int status = nx_database_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_database()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -808,6 +864,10 @@ namespace nixnet_grpc { try { auto database_alias = request->database_alias().c_str(); auto status = library_->DbRemoveAlias(database_alias); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -828,6 +888,10 @@ namespace nixnet_grpc { nxDatabaseRef_t database = nx_database_ref_t_resource_repository_->access_session(database_grpc_session.id(), database_grpc_session.name()); auto db_filepath = request->db_filepath().c_str(); auto status = library_->DbSaveDatabase(database, db_filepath); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -847,6 +911,10 @@ namespace nixnet_grpc { auto ip_address = request->ip_address().c_str(); auto database_alias = request->database_alias().c_str(); auto status = library_->DbUndeploy(ip_address, database_alias); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -906,6 +974,10 @@ namespace nixnet_grpc { } auto status = library_->DisconnectTerminals(session, source, destination); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -925,6 +997,10 @@ namespace nixnet_grpc { auto session_grpc_session = request->session(); nxSessionRef_t session = session_repository_->access_session(session_grpc_session.id(), session_grpc_session.name()); auto status = library_->Flush(session); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -961,6 +1037,10 @@ namespace nixnet_grpc { } auto status = library_->FutureTimeTrigger(session, when, timescale); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -997,10 +1077,12 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->GetPropertySize(session, property_id, &property_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { response->set_property_size(property_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1037,10 +1119,12 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->GetSubPropertySize(session, active_index, property_id, &property_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { response->set_property_size(property_size); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1096,10 +1180,12 @@ namespace nixnet_grpc { std::vector buffer(size_of_buffer, u8()); u32 number_of_bytes_returned {}; auto status = library_->ReadFrame(session, buffer.data(), size_of_buffer, timeout, &number_of_bytes_returned); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1125,9 +1211,11 @@ namespace nixnet_grpc { response->mutable_timestamp_buffer()->Resize(number_of_signals, 0); nxTimestamp100ns_t* timestamp_buffer = reinterpret_cast(response->mutable_timestamp_buffer()->mutable_data()); auto status = library_->ReadSignalSinglePoint(session, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1169,12 +1257,14 @@ namespace nixnet_grpc { std::vector value_buffer(samples_per_signal * number_of_signals, f64()); u32 number_of_values_returned {}; auto status = library_->ReadSignalWaveform(session, timeout, &start_time, &delta_time, value_buffer.data(), size_of_value_buffer, &number_of_values_returned); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { response->set_start_time(start_time); response->set_delta_time(delta_time); convert_to_grpc(value_buffer, response->mutable_value_buffer(), number_of_values_returned, number_of_signals); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1205,9 +1295,11 @@ namespace nixnet_grpc { response->mutable_num_pairs_buffer()->Resize(number_of_signals, 0); u32* num_pairs_buffer = response->mutable_num_pairs_buffer()->mutable_data(); auto status = library_->ReadSignalXY(session, &time_limit, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer, num_pairs_buffer, size_of_num_pairs_buffer); - response->set_status(status); - if (status_ok(status)) { + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1244,10 +1336,12 @@ namespace nixnet_grpc { auto state_size = sizeof(nxTimeLocalNetwork_t); _nxTimeLocalNetwork_t state_value {}; auto status = library_->ReadStateTimeTrigger(session, timeout, state_size, &state_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(state_value, response->mutable_state_value()); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1282,6 +1376,10 @@ namespace nixnet_grpc { } auto status = library_->Start(session, scope); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1303,11 +1401,13 @@ namespace nixnet_grpc { std::string status_description(2048 - 1, '\0'); library_->StatusToString(status_id, sizeof_string, (char*)status_description.data()); auto status = 0; + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_status_description(status_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_status_description())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1342,6 +1442,10 @@ namespace nixnet_grpc { } auto status = library_->Stop(session, scope); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1362,6 +1466,10 @@ namespace nixnet_grpc { nxSessionRef_t system = session_repository_->access_session(system_grpc_session.id(), system_grpc_session.name()); session_repository_->remove_session(system_grpc_session.id(), system_grpc_session.name()); auto status = library_->SystemClose(system); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, system); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1388,10 +1496,12 @@ namespace nixnet_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->SystemClose(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_system()->set_id(session_id); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1429,10 +1539,12 @@ namespace nixnet_grpc { f64 timeout = request->timeout(); u32 param_out {}; auto status = library_->Wait(session, condition, param_in, timeout, ¶m_out); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); - if (status_ok(status)) { response->set_param_out(param_out); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1469,6 +1581,10 @@ namespace nixnet_grpc { } auto status = library_->WriteFrame(session, buffer, number_of_bytes_for_frames, timeout); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1490,6 +1606,10 @@ namespace nixnet_grpc { auto value_buffer = const_cast(request->value_buffer().data()); u32 size_of_value_buffer = static_cast(request->value_buffer().size() * sizeof(f64)); auto status = library_->WriteSignalSinglePoint(session, value_buffer, size_of_value_buffer); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1527,6 +1647,10 @@ namespace nixnet_grpc { auto value_buffer = const_cast(request->value_buffer().data()); u32 size_of_value_buffer = static_cast(request->value_buffer().size() * sizeof(f64)); auto status = library_->WriteSignalWaveform(session, timeout, value_buffer, size_of_value_buffer); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } @@ -1568,6 +1692,10 @@ namespace nixnet_grpc { auto num_pairs_buffer = const_cast(request->num_pairs_buffer().data()); u32 size_of_num_pairs_buffer = static_cast(request->num_pairs_buffer().size() * sizeof(u32)); auto status = library_->WriteSignalXY(session, timeout, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer, num_pairs_buffer, size_of_num_pairs_buffer); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSessionRef_t(status, session); + } + response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nixnet/nixnet_service.h b/generated/nixnet/nixnet_service.h index 8b4dbfc75..d0eb23dfd 100644 --- a/generated/nixnet/nixnet_service.h +++ b/generated/nixnet/nixnet_service.h @@ -105,6 +105,8 @@ class NiXnetService final : public NiXnet::Service { NiXnetLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; nxDatabaseRef_tResourceRepositorySharedPtr nx_database_ref_t_resource_repository_; + ::grpc::Status ConvertApiErrorStatusFornxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session); + ::grpc::Status ConvertApiErrorStatusFornxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session); std::map dbpropertyvalue_input_map_ { {0, 0},{1, 0},{2, 1},{3, 2},{4, 4294967294},{5, 0},{6, 1},{7, 2},{8, 3},{9, 0},{10, 1},{11, 1},{12, 2},{13, 3},{14, 4},{15, 0},{16, 1},{17, 2},{18, 0},{19, 1},{20, 0},{21, 1},{22, 2},{23, 3},{24, 2},{25, 3},{26, 4},{27, 5},{28, 6},{29, 0},{30, 1},{31, 2},{32, 0},{33, 1},{34, 2},{35, 3}, }; std::map dbpropertyvalue_output_map_ { {0, 0},{0, 1},{1, 2},{2, 3},{4294967294, 4},{0, 5},{1, 6},{2, 7},{3, 8},{0, 9},{1, 10},{1, 11},{2, 12},{3, 13},{4, 14},{0, 15},{1, 16},{2, 17},{0, 18},{1, 19},{0, 20},{1, 21},{2, 22},{3, 23},{2, 24},{3, 25},{4, 26},{5, 27},{6, 28},{0, 29},{1, 30},{2, 31},{0, 32},{1, 33},{2, 34},{3, 35}, }; std::map enetflags_input_map_ { {0, 0},{1, 2147483648},{2, 1073741824},{3, 8388608},{4, 65536}, }; diff --git a/generated/nixnetsocket/nixnetsocket_service.cpp b/generated/nixnetsocket/nixnetsocket_service.cpp index 8dc15bba9..62be90fff 100644 --- a/generated/nixnetsocket/nixnetsocket_service.cpp +++ b/generated/nixnetsocket/nixnetsocket_service.cpp @@ -67,17 +67,13 @@ namespace nixnetsocket_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxSOCKET id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(addr, response->mutable_addr()); response->mutable_socket()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -98,15 +94,11 @@ namespace nixnetsocket_grpc { auto name = convert_from_grpc(request->name()); auto namelen = name.size(); auto status = library_->Bind(socket, name, namelen); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -126,15 +118,11 @@ namespace nixnetsocket_grpc { nxSOCKET socket = session_repository_->access_session(socket_grpc_session.id(), socket_grpc_session.name()); session_repository_->remove_session(socket_grpc_session.id(), socket_grpc_session.name()); auto status = library_->Close(socket); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -155,15 +143,11 @@ namespace nixnetsocket_grpc { auto name = convert_from_grpc(request->name()); auto namelen = name.size(); auto status = library_->Connect(socket, name, namelen); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -184,16 +168,12 @@ namespace nixnetsocket_grpc { auto set = convert_from_grpc(request->set(), session_repository_); auto is_set = library_->FdIsSet(fd, set); auto status = 0; + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, fd); + } + response->set_status(status); - if (status_ok(status)) { response->set_is_set(is_set); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -218,16 +198,12 @@ namespace nixnetsocket_grpc { auto hints = convert_from_grpc(request->hints()); auto res = allocate_output_storage>(library_); auto status = library_->GetAddrInfo(stack_ref, node_api, service_api, hints, &res); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(res, response->mutable_res()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -262,19 +238,15 @@ namespace nixnetsocket_grpc { serv.resize(servlen - 1); } auto status = library_->GetNameInfo(stack_ref, addr, addrlen, (char*)host.data(), hostlen, (char*)serv.data(), servlen, flags); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { response->set_host(host); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_host())); response->set_serv(serv); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_serv())); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -295,16 +267,12 @@ namespace nixnetsocket_grpc { auto addr = allocate_output_storage(); auto addrlen = static_cast(sizeof(addr.storage)); auto status = library_->GetPeerName(socket, &addr, &addrlen); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(addr, response->mutable_addr()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -325,16 +293,12 @@ namespace nixnetsocket_grpc { auto addr = allocate_output_storage(); auto addrlen = static_cast(sizeof(addr.storage)); auto status = library_->GetSockName(socket, &addr, &addrlen); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(addr, response->mutable_addr()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -387,16 +351,12 @@ namespace nixnetsocket_grpc { auto optval = allocate_output_storage(library_, optname); auto optlen = optval.size(socket, level); auto status = library_->GetSockOpt(socket, level, optname, optval.data(), &optlen); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(optval, response->mutable_optval()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -417,16 +377,12 @@ namespace nixnetsocket_grpc { auto cp = request->cp().c_str(); auto addr = library_->InetAddr(stack_ref, cp); auto status = addr == -1 ? -1 : 0; + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { response->set_addr(addr); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -447,16 +403,12 @@ namespace nixnetsocket_grpc { auto cp = request->cp().c_str(); auto name = allocate_output_storage(); auto status = library_->InetAToN(stack_ref, cp, &name); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(name, response->mutable_name()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -477,17 +429,13 @@ namespace nixnetsocket_grpc { auto in_addr = convert_from_grpc(request->in_addr()); auto address = library_->InetNToA(stack_ref, in_addr); auto status = address ? 0 : -1; + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { response->set_address(address); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -511,17 +459,13 @@ namespace nixnetsocket_grpc { std::string dst(nxINET6_ADDRSTRLEN - 1, '\0'); auto address = library_->InetNToP(stack_ref, af, addr, (char*)dst.data(), size); auto status = address ? 0 : -1; + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { response->set_address(address); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -558,16 +502,12 @@ namespace nixnetsocket_grpc { auto address = request->address().c_str(); auto addr = allocate_output_storage(af); auto status = library_->InetPToN(stack_ref, af, address, &addr); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(addr, response->mutable_addr()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -587,15 +527,11 @@ namespace nixnetsocket_grpc { nxIpStackRef_t stack_ref = nx_ip_stack_ref_t_resource_repository_->access_session(stack_ref_grpc_session.id(), stack_ref_grpc_session.name()); nx_ip_stack_ref_t_resource_repository_->remove_session(stack_ref_grpc_session.id(), stack_ref_grpc_session.name()); auto status = library_->IpStackClear(stack_ref); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -623,16 +559,12 @@ namespace nixnetsocket_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxIpStackRef_t id) { library_->IpStackClear(id); }; int status = nx_ip_stack_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_stack_ref()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -666,17 +598,13 @@ namespace nixnetsocket_grpc { auto info = allocate_output_storage(library_); auto status = library_->IpStackGetAllStacksInfoStr(format, (nixnetsocket_grpc::IpStackInfoString*)info.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, 0); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(info, response->mutable_info()); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -697,16 +625,12 @@ namespace nixnetsocket_grpc { auto info_id = nxIPSTACK_INFO_ID; auto virtual_interfaces = allocate_output_storage>(library_); auto status = library_->IpStackGetInfo(stack_ref, info_id, &virtual_interfaces); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { convert_to_grpc(virtual_interfaces, response->mutable_virtual_interfaces()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -733,16 +657,12 @@ namespace nixnetsocket_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxIpStackRef_t id) { library_->IpStackClear(id); }; int status = nx_ip_stack_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_stack_ref()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -763,15 +683,11 @@ namespace nixnetsocket_grpc { auto local_interface = request->local_interface().c_str(); int32_t timeout_ms = request->timeout_ms(); auto status = library_->IpStackWaitForInterface(stack_ref, local_interface, timeout_ms); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -791,15 +707,11 @@ namespace nixnetsocket_grpc { nxSOCKET socket = session_repository_->access_session(socket_grpc_session.id(), socket_grpc_session.name()); int32_t backlog = request->backlog(); auto status = library_->Listen(socket, backlog); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -824,16 +736,12 @@ namespace nixnetsocket_grpc { std::string data(size, '\0'); auto status = library_->Recv(socket, (char*)data.data(), size, flags); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); + } + response->set_status(status); - if (status_ok(status)) { response->set_data(data); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -860,17 +768,13 @@ namespace nixnetsocket_grpc { auto from_addr = allocate_output_storage(); nxsocklen_t fromlen {}; auto status = library_->RecvFrom(socket, (char*)data.data(), size, flags, &from_addr, &fromlen); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); + } + response->set_status(status); - if (status_ok(status)) { response->set_data(data); convert_to_grpc(from_addr, response->mutable_from_addr()); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -892,15 +796,11 @@ namespace nixnetsocket_grpc { auto exceptfds = convert_from_grpc(request->exceptfds(), session_repository_); auto timeout = convert_from_grpc(request->timeout()); auto status = library_->Select(nfds, readfds, writefds, exceptfds, timeout); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, 0); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -922,15 +822,11 @@ namespace nixnetsocket_grpc { int32_t size = static_cast(request->data().size()); int32_t flags_raw = request->flags_raw(); auto status = library_->Send(socket, data, size, flags_raw); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -954,15 +850,11 @@ namespace nixnetsocket_grpc { auto to = convert_from_grpc(request->to()); auto tolen = to.size(); auto status = library_->SendTo(socket, data, size, flags_raw, to, tolen); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1016,15 +908,11 @@ namespace nixnetsocket_grpc { auto optval = opt_data.data(); auto optlen = opt_data.size(); auto status = library_->SetSockOpt(socket, level, optname, optval, optlen); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1059,15 +947,11 @@ namespace nixnetsocket_grpc { } auto status = library_->Shutdown(socket, how); - response->set_status(status); - if (status_ok(status)) { - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, socket); } + + response->set_status(status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1143,16 +1027,12 @@ namespace nixnetsocket_grpc { const std::string& grpc_device_session_name = request->session_name(); auto cleanup_lambda = [&] (nxSOCKET id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + } + response->set_status(status); - if (status_ok(status)) { response->mutable_socket()->set_id(session_id); - } - else { - const auto error_message = get_last_error_message(library_); - response->set_error_message(error_message); - const auto error_num = get_last_error_num(library_); - response->set_error_num(error_num); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1176,11 +1056,13 @@ namespace nixnetsocket_grpc { } auto error = library_->StrErrR(errnum, (char*)buf.data(), buf_len); auto status = error ? 0 : -1; + if (!status_ok(status)) { + return ConvertApiErrorStatusFornxSOCKET(status, 0); + } + response->set_status(status); - if (status_ok(status)) { response->set_error(error); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nixnetsocket/nixnetsocket_service.h b/generated/nixnetsocket/nixnetsocket_service.h index 657796efa..1e4c8ee32 100644 --- a/generated/nixnetsocket/nixnetsocket_service.h +++ b/generated/nixnetsocket/nixnetsocket_service.h @@ -78,6 +78,8 @@ class NiXnetSocketService final : public NiXnetSocket::Service { NiXnetSocketLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; nxIpStackRef_tResourceRepositorySharedPtr nx_ip_stack_ref_t_resource_repository_; + ::grpc::Status ConvertApiErrorStatusFornxSOCKET(google::protobuf::int32 status, nxSOCKET socket); + ::grpc::Status ConvertApiErrorStatusFornxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket); NiXnetSocketFeatureToggles feature_toggles_; }; diff --git a/source/codegen/metadata/nirfmxinstr/config.py b/source/codegen/metadata/nirfmxinstr/config.py index b0ff421b5..e1efb431c 100644 --- a/source/codegen/metadata/nirfmxinstr/config.py +++ b/source/codegen/metadata/nirfmxinstr/config.py @@ -60,5 +60,6 @@ 'metadata_version': '0.1', 'module_name': 'nirfmxinstr', 'session_class_description': 'An NI-RFmxInstr instrument handle', + 'session_handle_parameter_name': 'instrumentHandle', 'duplicate_resource_handles_allowed': True } diff --git a/source/codegen/metadata/nirfmxnr/config.py b/source/codegen/metadata/nirfmxnr/config.py index c0a64da3c..b8bcb0f0a 100644 --- a/source/codegen/metadata/nirfmxnr/config.py +++ b/source/codegen/metadata/nirfmxnr/config.py @@ -59,6 +59,7 @@ 'metadata_version': '0.1', 'module_name': 'nirfmxnr', 'session_class_description': 'An NI-RFmxNR instrument handle', + 'session_handle_parameter_name': 'instrumentHandle', 'duplicate_resource_handles_allowed': True } diff --git a/source/codegen/metadata/nirfmxspecan/config.py b/source/codegen/metadata/nirfmxspecan/config.py index 0f0ac2469..2ef9b49d7 100644 --- a/source/codegen/metadata/nirfmxspecan/config.py +++ b/source/codegen/metadata/nirfmxspecan/config.py @@ -59,5 +59,6 @@ 'metadata_version': '0.1', 'module_name': 'nirfmxspecan', 'session_class_description': 'An NI-RFmxSpecAn instrument handle', + 'session_handle_parameter_name': 'instrumentHandle', 'duplicate_resource_handles_allowed': True } diff --git a/source/codegen/templates/service.h.mako b/source/codegen/templates/service.h.mako index 4596c54e8..022c5ce52 100644 --- a/source/codegen/templates/service.h.mako +++ b/source/codegen/templates/service.h.mako @@ -16,6 +16,7 @@ namespace_prefix = config["namespace_component"] + "_grpc::" custom_types = common_helpers.get_custom_types(config) (input_custom_types, output_custom_types) = common_helpers.get_input_and_output_custom_types(functions) resource_repository_deps = service_helpers.get_driver_shared_resource_repository_ptr_deps(config, functions) +resource_handle_types = service_helpers.get_resource_handle_types(config) async_functions = service_helpers.get_async_functions(functions) has_async_functions = any(async_functions) @@ -95,6 +96,9 @@ private: % for resource_handle_type in resource_repository_deps: ${resource_repository_deps[resource_handle_type].resource_repository_alias} ${resource_repository_deps[resource_handle_type].field_name}; % endfor +% for resource_handle_type in resource_handle_types: + ::grpc::Status ConvertApiErrorStatusFor${resource_handle_type}(google::protobuf::int32 status, ${resource_handle_type} ${config["session_handle_parameter_name"]}); +% endfor % if common_helpers.has_viboolean_array_param(functions): void Copy(const std::vector& input, google::protobuf::RepeatedField* output); % endif diff --git a/source/codegen/templates/service_helpers.mako b/source/codegen/templates/service_helpers.mako index c2977f8fc..3b56617cc 100644 --- a/source/codegen/templates/service_helpers.mako +++ b/source/codegen/templates/service_helpers.mako @@ -37,7 +37,7 @@ ${call_library_method( const std::string& grpc_device_session_name = request->${session_field_name}(); auto cleanup_lambda = [&] (${resource_handle_type} id) { library_->${close_function_call}; }; int status = ${service_helpers.session_repository_field_name(session_output_param, config)}->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); -${populate_response(function_data=function_data, output_parameters=output_parameters, init_method=True)}\ +${populate_response(function_data=function_data, parameters=parameters, init_method=True)}\ return ::grpc::Status::OK;\ @@ -87,10 +87,7 @@ ${call_library_method( arg_string=service_helpers.create_args_for_ivi_dance(parameters), indent_level=1) }\ - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } +${populate_error_check(function_data, parameters)} ${size_param['type']} ${common_helpers.get_cpp_local_name(size_param)} = status; <%block filter="common_helpers.indent(1)">\ @@ -109,7 +106,7 @@ ${call_library_method( // buffer is now too small, try again continue; } -${populate_response(function_data=function_data, output_parameters=output_parameters, indent_level=1)}\ +${populate_response(function_data=function_data, parameters=parameters, indent_level=1)}\ return ::grpc::Status::OK; }\ @@ -132,10 +129,7 @@ ${call_library_method( arg_string=service_helpers.create_args_for_ivi_dance_with_a_twist(parameters), indent_level=1) }\ - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; - } +${populate_error_check(function_data, parameters)} <%block filter="common_helpers.indent(1)">\ ${initialize_output_params(array_output_parameters)}\ \ @@ -155,7 +149,7 @@ ${call_library_method( // buffer is now too small, try again continue; } -${populate_response(function_data=function_data, output_parameters=output_parameters, indent_level=1)}\ +${populate_response(function_data=function_data, parameters=parameters, indent_level=1)}\ return ::grpc::Status::OK; }\ @@ -244,7 +238,7 @@ ${call_library_method( arg_string=service_helpers.create_args(parameters), library_lval=service_helpers.get_library_lval_for_potentially_umockable_function(config, parameters)) }\ -${populate_response(function_data=function_data, output_parameters=output_parameters)}\ +${populate_response(function_data=function_data, parameters=parameters)}\ return ::grpc::Status::OK;\ @@ -268,7 +262,7 @@ ${call_library_method( function_data=function_data, arg_string=service_helpers.create_args(parameters)) }\ -${populate_response(function_data=function_data, output_parameters=output_parameters)}\ +${populate_response(function_data=function_data, parameters=parameters)}\ return ::grpc::Status::OK;\ @@ -719,30 +713,41 @@ ${initialize_hardcoded_parameter(parameter)} ## Handles populating the response message after calling the driver API. -<%def name="populate_response(function_data, output_parameters, indent_level=0, init_method=False)">\ +<%def name="populate_response(function_data, parameters, indent_level=0, init_method=False)">\ <% + output_parameters = [p for p in parameters if common_helpers.is_output_parameter(p)] get_last_error_outputs = service_helpers.get_last_error_output_params(output_parameters) normal_outputs = [p for p in output_parameters if not p in get_last_error_outputs] %>\ <%block filter="common_helpers.indent(indent_level)">\ +${populate_error_check(function_data, parameters, indent_level)} response->set_status(status); %if output_parameters: - if (status_ok(status)) { ${set_response_values(normal_outputs, init_method)}\ - } -% if any(get_last_error_outputs): - else { -% for get_last_error_output in get_last_error_outputs: +%endif +\ + + +## Handles populating the response message after calling the driver API. +<%def name="populate_error_check(function_data, parameters, indent_level=0)">\ +<% + config = data['config'] + input_parameters = [p for p in parameters if common_helpers.is_input_parameter(p)] + resource_handle_types = service_helpers.get_resource_handle_types(config) +%>\ +<%block filter="common_helpers.indent(indent_level)">\ <% - get_last_error_output_name = common_helpers.get_grpc_field_name(get_last_error_output) - get_last_error_method_name = get_last_error_output["get_last_error"] + session = 0 + handle_type = resource_handle_types[0] + for parameter in input_parameters: + if parameter['type'] in resource_handle_types: + session = common_helpers.get_cpp_local_name(parameter) + handle_type = parameter['type'] + break %>\ - const auto ${get_last_error_output_name} = ${get_last_error_method_name}(library_); - response->set_${get_last_error_output_name}(${get_last_error_output_name}); -% endfor + if (!status_ok(status)) { + return ConvertApiErrorStatusFor${handle_type}(status, ${session}); } -% endif -%endif \ diff --git a/source/custom/nidaqmx_service.custom.cpp b/source/custom/nidaqmx_service.custom.cpp index ec0677fe7..22b83ef7f 100644 --- a/source/custom/nidaqmx_service.custom.cpp +++ b/source/custom/nidaqmx_service.custom.cpp @@ -1,4 +1,12 @@ #include namespace nidaqmx_grpc { + +::grpc::Status NiDAQmxService::ConvertApiErrorStatusForTaskHandle(google::protobuf::int32 status, TaskHandle task) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetErrorString(status, description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nidaqmx_grpc diff --git a/source/custom/nidcpower_service.custom.cpp b/source/custom/nidcpower_service.custom.cpp index ed7b952d3..43dbd28a6 100644 --- a/source/custom/nidcpower_service.custom.cpp +++ b/source/custom/nidcpower_service.custom.cpp @@ -55,4 +55,18 @@ ::grpc::Status NiDCPowerService::MeasureMultiple(::grpc::ServerContext* context, } } +::grpc::Status NiDCPowerService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->ErrorMessage(vi, status, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nidcpower_grpc diff --git a/source/custom/nidigitalpattern_service.custom.cpp b/source/custom/nidigitalpattern_service.custom.cpp index 9dc2c2233..56c4c99fa 100644 --- a/source/custom/nidigitalpattern_service.custom.cpp +++ b/source/custom/nidigitalpattern_service.custom.cpp @@ -1,5 +1,18 @@ #include -namespace nidigital_grpc { +namespace nidigitalpattern_grpc { -} // namespace nidigital_grpc +::grpc::Status NiDigitalService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + ViStatus error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->ErrorMessage(vi, status, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + +} // namespace nidigitalpattern_grpc diff --git a/source/custom/nidmm_service.custom.cpp b/source/custom/nidmm_service.custom.cpp index a8924d357..ea5171273 100644 --- a/source/custom/nidmm_service.custom.cpp +++ b/source/custom/nidmm_service.custom.cpp @@ -2,4 +2,18 @@ namespace nidmm_grpc { +::grpc::Status NiDmmService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorMessage(vi, status, buffer_size, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nidmm_grpc diff --git a/source/custom/nifake_extension_service.custom.cpp b/source/custom/nifake_extension_service.custom.cpp index d1f59b7dd..c093a67ce 100644 --- a/source/custom/nifake_extension_service.custom.cpp +++ b/source/custom/nifake_extension_service.custom.cpp @@ -2,4 +2,10 @@ namespace nifake_extension_grpc { +::grpc::Status NiFakeExtensionService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + std::string description = "In a real service, you'd look up the error message here."; + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nifake_extension_grpc diff --git a/source/custom/nifake_non_ivi_service.custom.cpp b/source/custom/nifake_non_ivi_service.custom.cpp index 228352d81..b1768962a 100644 --- a/source/custom/nifake_non_ivi_service.custom.cpp +++ b/source/custom/nifake_non_ivi_service.custom.cpp @@ -50,4 +50,17 @@ ::grpc::ServerWriteReactor* NiFakeNonIviService::ReadStream( request->start(), request->stop()); } + +::grpc::Status NiFakeNonIviService::ConvertApiErrorStatusForFakeHandle(google::protobuf::int32 status, FakeHandle handle) +{ + std::string description = "In a real service, you'd look up the error message here."; + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + +::grpc::Status NiFakeNonIviService::ConvertApiErrorStatusForSecondarySessionHandle(google::protobuf::int32 status, SecondarySessionHandle handle) +{ + std::string description = "In a real service, you'd look up the error message here."; + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nifake_non_ivi_grpc diff --git a/source/custom/nifake_service.custom.cpp b/source/custom/nifake_service.custom.cpp index d8b313fac..2aee9f0c4 100644 --- a/source/custom/nifake_service.custom.cpp +++ b/source/custom/nifake_service.custom.cpp @@ -2,4 +2,10 @@ namespace nifake_grpc { +::grpc::Status NiFakeService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + std::string description = "In a real service, you'd look up the error message here."; + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nifake_grpc diff --git a/source/custom/nifgen_service.custom.cpp b/source/custom/nifgen_service.custom.cpp index 7771b7bcd..befd11a34 100644 --- a/source/custom/nifgen_service.custom.cpp +++ b/source/custom/nifgen_service.custom.cpp @@ -37,4 +37,17 @@ ::grpc::Status NiFgenService::CreateAdvancedArbSequence(::grpc::ServerContext* c } } +::grpc::Status NiFgenService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + ViStatus error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->ErrorHandler(vi, status, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nifgen_grpc diff --git a/source/custom/nirfmxbluetooth_service.custom.cpp b/source/custom/nirfmxbluetooth_service.custom.cpp index d5f6c709f..327b06b36 100644 --- a/source/custom/nirfmxbluetooth_service.custom.cpp +++ b/source/custom/nirfmxbluetooth_service.custom.cpp @@ -1,2 +1,19 @@ +#include + namespace nirfmxbluetooth_grpc { -} // namespace nirfmxbluetooth_grpc \ No newline at end of file + +::grpc::Status NiRFmxBluetoothService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + +} // namespace nirfmxbluetooth_grpc diff --git a/source/custom/nirfmxinstr_service.custom.cpp b/source/custom/nirfmxinstr_service.custom.cpp index 0ecfb9912..969c1090e 100644 --- a/source/custom/nirfmxinstr_service.custom.cpp +++ b/source/custom/nirfmxinstr_service.custom.cpp @@ -108,4 +108,18 @@ ::grpc::Status NiRFmxInstrService::BuildPortString(::grpc::ServerContext* contex return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } } + +::grpc::Status NiRFmxInstrService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + int32 error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfmxinstr_grpc diff --git a/source/custom/nirfmxlte_service.custom.cpp b/source/custom/nirfmxlte_service.custom.cpp index 06d2ba7f0..19ec513be 100644 --- a/source/custom/nirfmxlte_service.custom.cpp +++ b/source/custom/nirfmxlte_service.custom.cpp @@ -1,2 +1,19 @@ +#include + namespace nirfmxlte_grpc { + +::grpc::Status NiRFmxLTEService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfmxlte_grpc diff --git a/source/custom/nirfmxnr_service.custom.cpp b/source/custom/nirfmxnr_service.custom.cpp index 05eae9736..895a8bff5 100644 --- a/source/custom/nirfmxnr_service.custom.cpp +++ b/source/custom/nirfmxnr_service.custom.cpp @@ -1,2 +1,18 @@ +#include + namespace nirfmxnr_grpc { + +::grpc::Status NiRFmxNRService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + int32 error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfmxnr_grpc diff --git a/source/custom/nirfmxspecan_service.custom.cpp b/source/custom/nirfmxspecan_service.custom.cpp index 45d68b38a..6e4cdd70f 100644 --- a/source/custom/nirfmxspecan_service.custom.cpp +++ b/source/custom/nirfmxspecan_service.custom.cpp @@ -1,2 +1,19 @@ +#include + namespace nirfmxspecan_grpc { + +::grpc::Status NiRFmxSpecAnService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfmxspecan_grpc diff --git a/source/custom/nirfmxwlan_service.custom.cpp b/source/custom/nirfmxwlan_service.custom.cpp index da4d15cdc..c84b10bf8 100644 --- a/source/custom/nirfmxwlan_service.custom.cpp +++ b/source/custom/nirfmxwlan_service.custom.cpp @@ -1,2 +1,18 @@ +#include + namespace nirfmxwlan_grpc { + +::grpc::Status NiRFmxWLANService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + int32 error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfmxwlan_grpc diff --git a/source/custom/nirfsa_service.custom.cpp b/source/custom/nirfsa_service.custom.cpp index 6b0d5090a..5b552451e 100644 --- a/source/custom/nirfsa_service.custom.cpp +++ b/source/custom/nirfsa_service.custom.cpp @@ -1,2 +1,19 @@ +#include + namespace nirfsa_grpc { + +::grpc::Status NiRFSAService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->ErrorMessage(vi, status, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfsa_grpc diff --git a/source/custom/nirfsg_service.custom.cpp b/source/custom/nirfsg_service.custom.cpp index 9ff5822bb..8796dc6da 100644 --- a/source/custom/nirfsg_service.custom.cpp +++ b/source/custom/nirfsg_service.custom.cpp @@ -2,4 +2,17 @@ namespace nirfsg_grpc { +::grpc::Status NiRFSGService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + ViStatus error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->ErrorMessage(vi, status, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfsg_grpc diff --git a/source/custom/niscope_service.custom.cpp b/source/custom/niscope_service.custom.cpp index 715d4d40b..d445fe175 100644 --- a/source/custom/niscope_service.custom.cpp +++ b/source/custom/niscope_service.custom.cpp @@ -564,4 +564,18 @@ ::grpc::Status NiScopeService::ReadMeasurement(::grpc::ServerContext* context, c } } +::grpc::Status NiScopeService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorMessage(vi, status, buffer_size, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace niscope_grpc diff --git a/source/custom/niswitch_service.custom.cpp b/source/custom/niswitch_service.custom.cpp index 72b56812a..0f39426de 100644 --- a/source/custom/niswitch_service.custom.cpp +++ b/source/custom/niswitch_service.custom.cpp @@ -2,4 +2,17 @@ namespace niswitch_grpc { +::grpc::Status NiSwitchService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + ViStatus error_code {}; + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->ErrorMessage(vi, status, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace niswitch_grpc diff --git a/source/custom/nisync_service.custom.cpp b/source/custom/nisync_service.custom.cpp index c5acef404..3c56a242c 100644 --- a/source/custom/nisync_service.custom.cpp +++ b/source/custom/nisync_service.custom.cpp @@ -36,4 +36,12 @@ ::grpc::Status NiSyncService::ReadMultipleTriggerTimeStamp(::grpc::ServerContext } } +::grpc::Status NiSyncService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) +{ + const ViInt32 buffer_size = 4096; + std::string description(buffer_size, '\0'); + library_->ErrorMessage(vi, status, description.data()); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nisync_grpc diff --git a/source/custom/nitclk_service.custom.cpp b/source/custom/nitclk_service.custom.cpp index 766c162e4..0aba3e0a8 100644 --- a/source/custom/nitclk_service.custom.cpp +++ b/source/custom/nitclk_service.custom.cpp @@ -44,4 +44,11 @@ ::grpc::Status NiTClkService::GetAttributeViString(::grpc::ServerContext* contex } } +::grpc::Status NiTClkService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession session_number) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetExtendedErrorInfo(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nitclk_grpc diff --git a/source/custom/nixnet_service.custom.cpp b/source/custom/nixnet_service.custom.cpp index bae95f22c..dea24d5fd 100644 --- a/source/custom/nixnet_service.custom.cpp +++ b/source/custom/nixnet_service.custom.cpp @@ -1147,6 +1147,20 @@ ::grpc::Status NiXnetService::DbGetDBCAttribute(::grpc::ServerContext* context, } } +::grpc::Status NiXnetService::ConvertApiErrorStatusFornxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + +::grpc::Status NiXnetService::ConvertApiErrorStatusFornxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + void convert_to_grpc(std::vector& input, google::protobuf::RepeatedPtrField* output, u32 number_of_bytes, u32 protocol, std::map enetflags_output_map) { auto buffer_ptr = (void*)input.data(); diff --git a/source/custom/nixnetsocket_service.custom.cpp b/source/custom/nixnetsocket_service.custom.cpp index 180a55c16..b264c2255 100644 --- a/source/custom/nixnetsocket_service.custom.cpp +++ b/source/custom/nixnetsocket_service.custom.cpp @@ -1,2 +1,19 @@ +#include + namespace nixnetsocket_grpc { + +::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxSOCKET(google::protobuf::int32 status, nxSOCKET socket) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetLastErrorStr(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + +::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetLastErrorStr(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nixnetsocket_grpc diff --git a/source/server/converters.h b/source/server/converters.h index c51c90671..ad14d5b78 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -3,6 +3,7 @@ #include #include +#include #include // For common grpc types. #include // For common C types. #include @@ -317,6 +318,19 @@ typename TypeToStorageType::StorageType allocate_output_ } } // namespace converters + +const int kMaxGrpcErrorDescriptionSize = 4096; + +inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 status, std::string& description) +{ + converters::trim_trailing_nulls(description); + // TODO: May need full-fledged json escape logic. + for (size_t index = 0; (index = description.find('"', index)) != std::string::npos; ++index) { + description.replace(index, 1, "\\\""); + } + std::string errorMessage = "{ \"code\":\"" + std::to_string(status) + "\", \"" + description + "\" }"; + return ::grpc::Status(grpc::StatusCode::UNKNOWN, errorMessage); +} } // namespace nidevice_grpc #endif /* NIDEVICE_GRPC_DEVICE_CONVERTERS_H */ From 799323221625e11d37f84a72844a6d5eb8fd0e08 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Fri, 5 Aug 2022 13:05:43 -0500 Subject: [PATCH 02/11] review feedback --- CMakeLists.txt | 2 +- generated/nidaqmx/nidaqmx_service.cpp | 1473 +++++------- generated/nidcpower/nidcpower_service.cpp | 461 ++-- .../nidigitalpattern_service.cpp | 561 ++--- generated/nidmm/nidmm_service.cpp | 329 +-- generated/nifake/nifake_service.cpp | 327 +-- .../nifake_extension_service.cpp | 3 +- .../nifake_non_ivi/nifake_non_ivi_service.cpp | 105 +- generated/nifgen/nifgen_service.cpp | 453 ++-- .../nirfmxbluetooth_service.cpp | 708 +++--- generated/nirfmxinstr/nirfmxinstr_service.cpp | 452 ++-- generated/nirfmxlte/nirfmxlte_service.cpp | 1674 ++++++-------- generated/nirfmxnr/nirfmxnr_service.cpp | 1425 +++++------- .../nirfmxspecan/nirfmxspecan_service.cpp | 2004 +++++++---------- .../nirfmxspecan_restricted_service.cpp | 15 +- .../nirfmxspecan_restricted_service.h | 1 + generated/nirfmxwlan/nirfmxwlan_service.cpp | 1338 +++++------ generated/nirfsa/nirfsa_service.cpp | 399 ++-- generated/nirfsg/nirfsg_service.cpp | 408 ++-- generated/niscope/niscope_service.cpp | 281 +-- generated/niswitch/niswitch_service.cpp | 245 +- generated/nisync/nisync_service.cpp | 225 +- generated/nitclk/nitclk_service.cpp | 51 +- generated/nixnet/nixnet_service.cpp | 132 +- .../nixnetsocket/nixnetsocket_service.cpp | 93 +- .../nirfmxspecan_restricted/config.py | 1 + source/codegen/templates/service_helpers.mako | 8 +- source/custom/nidaqmx_service.custom.cpp | 3 +- source/custom/nidcpower_service.custom.cpp | 7 +- .../nidigitalpattern_service.custom.cpp | 2 + source/custom/nidmm_service.custom.cpp | 8 +- source/custom/nifgen_service.custom.cpp | 4 +- .../custom/nirfmxbluetooth_service.custom.cpp | 8 +- source/custom/nirfmxinstr_service.custom.cpp | 1 + source/custom/nirfmxlte_service.custom.cpp | 8 +- source/custom/nirfmxnr_service.custom.cpp | 1 + ...nirfmxspecan_restricted_service.custom.cpp | 17 + source/custom/nirfmxwlan_service.custom.cpp | 1 + source/custom/nirfsa_service.custom.cpp | 7 +- source/custom/nirfsg_service.custom.cpp | 2 + source/custom/niscope_service.custom.cpp | 8 +- source/custom/niswitch_service.custom.cpp | 2 + source/custom/nisync_service.custom.cpp | 4 +- source/custom/nixnet_service.custom.cpp | 2 + source/custom/nixnetsocket_service.custom.cpp | 2 + source/server/converters.h | 6 +- 46 files changed, 4979 insertions(+), 8288 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 373f78bd2..1b5311589 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,8 +358,8 @@ add_executable(IntegrationTestsRunner "${service_output_dir}/nifake/nifake_service.cpp" "${service_output_dir}/nifake_non_ivi/nifake_non_ivi_client.cpp" "${service_output_dir}/nifake_non_ivi/nifake_non_ivi_service.cpp" - "${custom_dir}/nifake_service.custom.cpp" "${custom_dir}/nifake_non_ivi_service.custom.cpp" + "${custom_dir}/nifake_service.custom.cpp" ) set(CMAKE_THREAD_PREFER_PTHREAD TRUE) diff --git a/generated/nidaqmx/nidaqmx_service.cpp b/generated/nidaqmx/nidaqmx_service.cpp index 029164c19..e93a55b76 100644 --- a/generated/nidaqmx/nidaqmx_service.cpp +++ b/generated/nidaqmx/nidaqmx_service.cpp @@ -58,9 +58,8 @@ namespace nidaqmx_grpc { auto port_list = request->port_list().c_str(); auto status = library_->AddCDAQSyncConnection(port_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -82,9 +81,8 @@ namespace nidaqmx_grpc { auto channel_names = request->channel_names().c_str(); auto status = library_->AddGlobalChansToTask(task, channel_names); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -108,10 +106,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->AddNetworkDevice(ip_address, device_name, attempt_reservation, timeout, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 device_name_out_buffer_size = status; std::string device_name_out; @@ -123,10 +120,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_device_name_out(device_name_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_device_name_out())); @@ -151,9 +147,8 @@ namespace nidaqmx_grpc { bool32 disconnected_ports_exist {}; auto status = library_->AreConfiguredCDAQSyncPortsDisconnected(chassis_devices_ports, timeout, &disconnected_ports_exist); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_disconnected_ports_exist(disconnected_ports_exist); return ::grpc::Status::OK; @@ -175,9 +170,8 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); auto status = library_->AutoConfigureCDAQSyncConnections(chassis_devices_ports, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -204,9 +198,8 @@ namespace nidaqmx_grpc { float64* reverse_coeffs = response->mutable_reverse_coeffs()->mutable_data(); auto status = library_->CalculateReversePolyCoeff(forward_coeffs, num_forward_coeffs_in, min_val_x, max_val_x, num_points_to_compute, reverse_poly_order, reverse_coeffs); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -246,9 +239,8 @@ namespace nidaqmx_grpc { uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgAnlgEdgeRefTrig(task, trigger_source, trigger_slope, trigger_level, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -287,9 +279,8 @@ namespace nidaqmx_grpc { float64 trigger_level = request->trigger_level(); auto status = library_->CfgAnlgEdgeStartTrig(task, trigger_source, trigger_slope, trigger_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -326,9 +317,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgAnlgMultiEdgeRefTrig(task, trigger_sources, trigger_slope_array, trigger_level_array, pretrigger_samples, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -364,9 +354,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgAnlgMultiEdgeStartTrig(task, trigger_sources, trigger_slope_array, trigger_level_array, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -407,9 +396,8 @@ namespace nidaqmx_grpc { uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgAnlgWindowRefTrig(task, trigger_source, trigger_when, window_top, window_bottom, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -449,9 +437,8 @@ namespace nidaqmx_grpc { float64 window_bottom = request->window_bottom(); auto status = library_->CfgAnlgWindowStartTrig(task, trigger_source, trigger_when, window_top, window_bottom); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -539,9 +526,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgBurstHandshakingTimingExportClock(task, sample_mode, samps_per_chan, sample_clk_rate, sample_clk_outp_term, sample_clk_pulse_polarity, pause_when, ready_event_active_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -629,9 +615,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgBurstHandshakingTimingImportClock(task, sample_mode, samps_per_chan, sample_clk_rate, sample_clk_src, sample_clk_active_edge, pause_when, ready_event_active_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -671,9 +656,8 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgChangeDetectionTiming(task, rising_edge_chan, falling_edge_chan, sample_mode, samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -712,9 +696,8 @@ namespace nidaqmx_grpc { uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgDigEdgeRefTrig(task, trigger_source, trigger_edge, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -752,9 +735,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgDigEdgeStartTrig(task, trigger_source, trigger_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -794,9 +776,8 @@ namespace nidaqmx_grpc { uInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->CfgDigPatternRefTrig(task, trigger_source, trigger_pattern, trigger_when, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -835,9 +816,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgDigPatternStartTrig(task, trigger_source, trigger_pattern, trigger_when); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -875,9 +855,8 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgHandshakingTiming(task, sample_mode, samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -915,9 +894,8 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgImplicitTiming(task, sample_mode, samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -939,9 +917,8 @@ namespace nidaqmx_grpc { uInt32 num_samps_per_chan = request->num_samps_per_chan(); auto status = library_->CfgInputBuffer(task, num_samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -963,9 +940,8 @@ namespace nidaqmx_grpc { uInt32 num_samps_per_chan = request->num_samps_per_chan(); auto status = library_->CfgOutputBuffer(task, num_samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1021,9 +997,8 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgPipelinedSampClkTiming(task, source, rate, active_edge, sample_mode, samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1079,9 +1054,8 @@ namespace nidaqmx_grpc { uInt64 samps_per_chan = request->samps_per_chan(); auto status = library_->CfgSampClkTiming(task, source, rate, active_edge, sample_mode, samps_per_chan); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1119,9 +1093,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgTimeStartTrig(task, when, timescale); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1165,9 +1138,8 @@ namespace nidaqmx_grpc { auto status = library_->CfgWatchdogAOExpirStates(task, channel_names, expir_state_array, output_type_array, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1199,9 +1171,8 @@ namespace nidaqmx_grpc { uInt32 array_size = static_cast(request->expir_state_array().size()); auto status = library_->CfgWatchdogCOExpirStates(task, channel_names, expir_state_array, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1233,9 +1204,8 @@ namespace nidaqmx_grpc { uInt32 array_size = static_cast(request->expir_state_array().size()); auto status = library_->CfgWatchdogDOExpirStates(task, channel_names, expir_state_array, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1255,9 +1225,8 @@ namespace nidaqmx_grpc { auto physical_channel = request->physical_channel().c_str(); auto status = library_->ClearTEDS(physical_channel); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1279,9 +1248,8 @@ namespace nidaqmx_grpc { session_repository_->remove_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->ClearTask(task); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1336,9 +1304,8 @@ namespace nidaqmx_grpc { auto status = library_->ConfigureLogging(task, file_path, logging_mode, group_name, operation); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1359,9 +1326,8 @@ namespace nidaqmx_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ConfigureTEDS(physical_channel, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1398,9 +1364,8 @@ namespace nidaqmx_grpc { auto status = library_->ConnectTerms(source_terminal, destination_terminal, signal_modifiers); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1437,9 +1402,8 @@ namespace nidaqmx_grpc { auto status = library_->ControlWatchdogTask(task, action); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1532,9 +1496,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIAccel4WireDCVoltageChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1626,9 +1589,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIAccelChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1703,9 +1665,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIAccelChargeChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1781,9 +1742,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1841,9 +1801,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIChargeChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1918,9 +1877,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAICurrentChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1995,9 +1953,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAICurrentRMSChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2109,9 +2066,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceBridgePolynomialChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, num_forward_coeffs, reverse_coeffs, num_reverse_coeffs, electrical_units, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2223,9 +2179,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceBridgeTableChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, num_electrical_vals, electrical_units, physical_vals, num_physical_vals, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2337,9 +2292,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceBridgeTwoPointLinChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2431,9 +2385,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIForceIEPEChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2477,9 +2430,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIFreqVoltageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, threshold_level, hysteresis, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2554,9 +2506,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIMicrophoneChan(task, physical_channel, name_to_assign_to_channel, terminal_config, units, mic_sensitivity, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2615,9 +2566,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPosEddyCurrProxProbeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2710,9 +2660,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPosLVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2805,9 +2754,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPosRVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, sensitivity, sensitivity_units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2919,9 +2867,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPressureBridgePolynomialChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, num_forward_coeffs, reverse_coeffs, num_reverse_coeffs, electrical_units, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3033,9 +2980,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPressureBridgeTableChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, num_electrical_vals, electrical_units, physical_vals, num_physical_vals, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3147,9 +3093,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIPressureBridgeTwoPointLinChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3240,9 +3185,8 @@ namespace nidaqmx_grpc { float64 r0 = request->r0(); auto status = library_->CreateAIRTDChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, rtd_type, resistance_config, current_excit_source, current_excit_val, r0); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3317,9 +3261,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIResistanceChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3400,9 +3343,8 @@ namespace nidaqmx_grpc { float64 lead_wire_resistance = request->lead_wire_resistance(); auto status = library_->CreateAIRosetteStrainGageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, rosette_type, gage_orientation, rosette_meas_types, num_rosette_meas_types, strain_config, voltage_excit_source, voltage_excit_val, gage_factor, nominal_gage_resistance, poisson_ratio, lead_wire_resistance); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3482,9 +3424,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIStrainGageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, strain_config, voltage_excit_source, voltage_excit_val, gage_factor, initial_bridge_voltage, nominal_gage_resistance, poisson_ratio, lead_wire_resistance, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3523,9 +3464,8 @@ namespace nidaqmx_grpc { auto status = library_->CreateAITempBuiltInSensorChan(task, physical_channel, name_to_assign_to_channel, units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3600,9 +3540,8 @@ namespace nidaqmx_grpc { auto cjc_channel = request->cjc_channel().c_str(); auto status = library_->CreateAIThrmcplChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, thermocouple_type, cjc_source, cjc_val, cjc_channel); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3679,9 +3618,8 @@ namespace nidaqmx_grpc { float64 c = request->c(); auto status = library_->CreateAIThrmstrChanIex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, a, b, c); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3759,9 +3697,8 @@ namespace nidaqmx_grpc { float64 r1 = request->r1(); auto status = library_->CreateAIThrmstrChanVex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, a, b, c, r1); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3873,9 +3810,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAITorqueBridgePolynomialChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, forward_coeffs, num_forward_coeffs, reverse_coeffs, num_reverse_coeffs, electrical_units, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3987,9 +3923,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAITorqueBridgeTableChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, electrical_vals, num_electrical_vals, electrical_units, physical_vals, num_physical_vals, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4101,9 +4036,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAITorqueBridgeTwoPointLinChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, nominal_bridge_resistance, first_electrical_val, second_electrical_val, electrical_units, first_physical_val, second_physical_val, physical_units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4195,9 +4129,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVelocityIEPEChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, sensitivity, sensitivity_units, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4255,9 +4188,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVoltageChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4349,9 +4281,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVoltageChanWithExcit(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, bridge_config, voltage_excit_source, voltage_excit_val, use_excit_for_scaling, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4409,9 +4340,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAIVoltageRMSChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4453,9 +4383,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAOCurrentChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4497,9 +4426,8 @@ namespace nidaqmx_grpc { float64 offset = request->offset(); auto status = library_->CreateAOFuncGenChan(task, physical_channel, name_to_assign_to_channel, type, freq, amplitude, offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4541,9 +4469,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateAOVoltageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4619,9 +4546,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIAngEncoderChan(task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, pulses_per_rev, initial_angle, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4680,9 +4606,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIAngVelocityChan(task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, pulses_per_rev, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4738,9 +4663,8 @@ namespace nidaqmx_grpc { auto status = library_->CreateCICountEdgesChan(task, counter, name_to_assign_to_channel, edge, initial_count, count_direction); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4782,9 +4706,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIDutyCycleChan(task, counter, name_to_assign_to_channel, min_freq, max_freq, edge, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4860,9 +4783,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIFreqChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4918,9 +4840,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIGPSTimestampChan(task, counter, name_to_assign_to_channel, units, sync_method, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4996,9 +4917,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCILinEncoderChan(task, counter, name_to_assign_to_channel, decoding_type, zidx_enable, zidx_val, zidx_phase, units, dist_per_pulse, initial_pos, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5057,9 +4977,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCILinVelocityChan(task, counter, name_to_assign_to_channel, min_val, max_val, decoding_type, units, dist_per_pulse, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5135,9 +5054,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIPeriodChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, edge, meas_method, meas_time, divisor, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5178,9 +5096,8 @@ namespace nidaqmx_grpc { auto status = library_->CreateCIPulseChanFreq(task, counter, name_to_assign_to_channel, min_val, max_val, units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5206,9 +5123,8 @@ namespace nidaqmx_grpc { float64 max_val = request->max_val(); auto status = library_->CreateCIPulseChanTicks(task, counter, name_to_assign_to_channel, source_terminal, min_val, max_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5249,9 +5165,8 @@ namespace nidaqmx_grpc { auto status = library_->CreateCIPulseChanTime(task, counter, name_to_assign_to_channel, min_val, max_val, units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5309,9 +5224,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCIPulseWidthChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, starting_edge, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5353,9 +5267,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCISemiPeriodChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5429,9 +5342,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateCITwoEdgeSepChan(task, counter, name_to_assign_to_channel, min_val, max_val, units, first_edge, second_edge, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5489,9 +5401,8 @@ namespace nidaqmx_grpc { float64 duty_cycle = request->duty_cycle(); auto status = library_->CreateCOPulseChanFreq(task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, freq, duty_cycle); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5534,9 +5445,8 @@ namespace nidaqmx_grpc { int32 high_ticks = request->high_ticks(); auto status = library_->CreateCOPulseChanTicks(task, counter, name_to_assign_to_channel, source_terminal, idle_state, initial_delay, low_ticks, high_ticks); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5594,9 +5504,8 @@ namespace nidaqmx_grpc { float64 high_time = request->high_time(); auto status = library_->CreateCOPulseChanTime(task, counter, name_to_assign_to_channel, units, idle_state, initial_delay, low_time, high_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5635,9 +5544,8 @@ namespace nidaqmx_grpc { auto status = library_->CreateDIChan(task, lines, name_to_assign_to_lines, line_grouping); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5676,9 +5584,8 @@ namespace nidaqmx_grpc { auto status = library_->CreateDOChan(task, lines, name_to_assign_to_lines, line_grouping); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5717,9 +5624,8 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreateLinScale(name, slope, y_intercept, pre_scaled_units, scaled_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5760,9 +5666,8 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreateMapScale(name, prescaled_min, prescaled_max, scaled_min, scaled_max, pre_scaled_units, scaled_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5803,9 +5708,8 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreatePolynomialScale(name, forward_coeffs, num_forward_coeffs_in, reverse_coeffs, num_reverse_coeffs_in, pre_scaled_units, scaled_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5880,9 +5784,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIAccelChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5941,9 +5844,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6018,9 +5920,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAICurrentChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, shunt_resistor_loc, ext_shunt_resistor_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6079,9 +5980,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIForceBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6156,9 +6056,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIForceIEPEChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6232,9 +6131,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIMicrophoneChan(task, physical_channel, name_to_assign_to_channel, terminal_config, units, max_snd_press_level, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6310,9 +6208,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIPosLVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6388,9 +6285,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIPosRVDTChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, voltage_excit_freq, ac_excit_wire_mode, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6449,9 +6345,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIPressureBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6525,9 +6420,8 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto status = library_->CreateTEDSAIRTDChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6602,9 +6496,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIResistanceChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6665,9 +6558,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIStrainGageChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, initial_bridge_voltage, lead_wire_resistance, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6726,9 +6618,8 @@ namespace nidaqmx_grpc { auto cjc_channel = request->cjc_channel().c_str(); auto status = library_->CreateTEDSAIThrmcplChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, cjc_source, cjc_val, cjc_channel); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6802,9 +6693,8 @@ namespace nidaqmx_grpc { float64 current_excit_val = request->current_excit_val(); auto status = library_->CreateTEDSAIThrmstrChanIex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, current_excit_source, current_excit_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6879,9 +6769,8 @@ namespace nidaqmx_grpc { float64 r1 = request->r1(); auto status = library_->CreateTEDSAIThrmstrChanVex(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, resistance_config, voltage_excit_source, voltage_excit_val, r1); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6940,9 +6829,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAITorqueBridgeChan(task, physical_channel, name_to_assign_to_channel, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7000,9 +6888,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIVoltageChan(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7077,9 +6964,8 @@ namespace nidaqmx_grpc { auto custom_scale_name = request->custom_scale_name().c_str(); auto status = library_->CreateTEDSAIVoltageChanWithExcit(task, physical_channel, name_to_assign_to_channel, terminal_config, min_val, max_val, units, voltage_excit_source, voltage_excit_val, custom_scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7120,9 +7006,8 @@ namespace nidaqmx_grpc { auto scaled_units = request->scaled_units().c_str(); auto status = library_->CreateTableScale(name, prescaled_vals, num_prescaled_vals_in, scaled_vals, num_scaled_vals_in, pre_scaled_units, scaled_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7151,9 +7036,8 @@ namespace nidaqmx_grpc { auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; @@ -7208,9 +7092,8 @@ namespace nidaqmx_grpc { auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; @@ -7245,9 +7128,8 @@ namespace nidaqmx_grpc { auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; @@ -7271,9 +7153,8 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); auto status = library_->DeleteNetworkDevice(device_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7293,9 +7174,8 @@ namespace nidaqmx_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DeleteSavedGlobalChan(channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7315,9 +7195,8 @@ namespace nidaqmx_grpc { auto scale_name = request->scale_name().c_str(); auto status = library_->DeleteSavedScale(scale_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7337,9 +7216,8 @@ namespace nidaqmx_grpc { auto task_name = request->task_name().c_str(); auto status = library_->DeleteSavedTask(task_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7360,9 +7238,8 @@ namespace nidaqmx_grpc { bool32 cal_supported {}; auto status = library_->DeviceSupportsCal(device_name, &cal_supported); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_cal_supported(cal_supported); return ::grpc::Status::OK; @@ -7384,9 +7261,8 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->DisableRefTrig(task); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7407,9 +7283,8 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->DisableStartTrig(task); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7430,9 +7305,8 @@ namespace nidaqmx_grpc { auto destination_terminal = request->destination_terminal().c_str(); auto status = library_->DisconnectTerms(source_terminal, destination_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7470,9 +7344,8 @@ namespace nidaqmx_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(task, signal_id, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7499,9 +7372,8 @@ namespace nidaqmx_grpc { uInt32 minute {}; auto status = library_->GetAIChanCalCalDate(task, channel_name, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -7533,9 +7405,8 @@ namespace nidaqmx_grpc { uInt32 minute {}; auto status = library_->GetAIChanCalExpDate(task, channel_name, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -7588,9 +7459,8 @@ namespace nidaqmx_grpc { stateVector.resize(channels.size()); auto status = ((NiDAQmxLibrary*)library_)->GetAnalogPowerUpStates(device_name, get_channelName_if(channels, 0), get_state_if(stateVector, 0), get_channelType_if(channels, 0), get_channelName_if(channels, 1), get_state_if(stateVector, 1), get_channelType_if(channels, 1), get_channelName_if(channels, 2), get_state_if(stateVector, 2), get_channelType_if(channels, 2), get_channelName_if(channels, 3), get_state_if(stateVector, 3), get_channelType_if(channels, 3), get_channelName_if(channels, 4), get_state_if(stateVector, 4), get_channelType_if(channels, 4), get_channelName_if(channels, 5), get_state_if(stateVector, 5), get_channelType_if(channels, 5), get_channelName_if(channels, 6), get_state_if(stateVector, 6), get_channelType_if(channels, 6), get_channelName_if(channels, 7), get_state_if(stateVector, 7), get_channelType_if(channels, 7), get_channelName_if(channels, 8), get_state_if(stateVector, 8), get_channelType_if(channels, 8), get_channelName_if(channels, 9), get_state_if(stateVector, 9), get_channelType_if(channels, 9), get_channelName_if(channels, 10), get_state_if(stateVector, 10), get_channelType_if(channels, 10), get_channelName_if(channels, 11), get_state_if(stateVector, 11), get_channelType_if(channels, 11), get_channelName_if(channels, 12), get_state_if(stateVector, 12), get_channelType_if(channels, 12), get_channelName_if(channels, 13), get_state_if(stateVector, 13), get_channelType_if(channels, 13), get_channelName_if(channels, 14), get_state_if(stateVector, 14), get_channelType_if(channels, 14), get_channelName_if(channels, 15), get_state_if(stateVector, 15), get_channelType_if(channels, 15), get_channelName_if(channels, 16), get_state_if(stateVector, 16), get_channelType_if(channels, 16), get_channelName_if(channels, 17), get_state_if(stateVector, 17), get_channelType_if(channels, 17), get_channelName_if(channels, 18), get_state_if(stateVector, 18), get_channelType_if(channels, 18), get_channelName_if(channels, 19), get_state_if(stateVector, 19), get_channelType_if(channels, 19), get_channelName_if(channels, 20), get_state_if(stateVector, 20), get_channelType_if(channels, 20), get_channelName_if(channels, 21), get_state_if(stateVector, 21), get_channelType_if(channels, 21), get_channelName_if(channels, 22), get_state_if(stateVector, 22), get_channelType_if(channels, 22), get_channelName_if(channels, 23), get_state_if(stateVector, 23), get_channelType_if(channels, 23), get_channelName_if(channels, 24), get_state_if(stateVector, 24), get_channelType_if(channels, 24), get_channelName_if(channels, 25), get_state_if(stateVector, 25), get_channelType_if(channels, 25), get_channelName_if(channels, 26), get_state_if(stateVector, 26), get_channelType_if(channels, 26), get_channelName_if(channels, 27), get_state_if(stateVector, 27), get_channelType_if(channels, 27), get_channelName_if(channels, 28), get_state_if(stateVector, 28), get_channelType_if(channels, 28), get_channelName_if(channels, 29), get_state_if(stateVector, 29), get_channelType_if(channels, 29), get_channelName_if(channels, 30), get_state_if(stateVector, 30), get_channelType_if(channels, 30), get_channelName_if(channels, 31), get_state_if(stateVector, 31), get_channelType_if(channels, 31), get_channelName_if(channels, 32), get_state_if(stateVector, 32), get_channelType_if(channels, 32), get_channelName_if(channels, 33), get_state_if(stateVector, 33), get_channelType_if(channels, 33), get_channelName_if(channels, 34), get_state_if(stateVector, 34), get_channelType_if(channels, 34), get_channelName_if(channels, 35), get_state_if(stateVector, 35), get_channelType_if(channels, 35), get_channelName_if(channels, 36), get_state_if(stateVector, 36), get_channelType_if(channels, 36), get_channelName_if(channels, 37), get_state_if(stateVector, 37), get_channelType_if(channels, 37), get_channelName_if(channels, 38), get_state_if(stateVector, 38), get_channelType_if(channels, 38), get_channelName_if(channels, 39), get_state_if(stateVector, 39), get_channelType_if(channels, 39), get_channelName_if(channels, 40), get_state_if(stateVector, 40), get_channelType_if(channels, 40), get_channelName_if(channels, 41), get_state_if(stateVector, 41), get_channelType_if(channels, 41), get_channelName_if(channels, 42), get_state_if(stateVector, 42), get_channelType_if(channels, 42), get_channelName_if(channels, 43), get_state_if(stateVector, 43), get_channelType_if(channels, 43), get_channelName_if(channels, 44), get_state_if(stateVector, 44), get_channelType_if(channels, 44), get_channelName_if(channels, 45), get_state_if(stateVector, 45), get_channelType_if(channels, 45), get_channelName_if(channels, 46), get_state_if(stateVector, 46), get_channelType_if(channels, 46), get_channelName_if(channels, 47), get_state_if(stateVector, 47), get_channelType_if(channels, 47), get_channelName_if(channels, 48), get_state_if(stateVector, 48), get_channelType_if(channels, 48), get_channelName_if(channels, 49), get_state_if(stateVector, 49), get_channelType_if(channels, 49), get_channelName_if(channels, 50), get_state_if(stateVector, 50), get_channelType_if(channels, 50), get_channelName_if(channels, 51), get_state_if(stateVector, 51), get_channelType_if(channels, 51), get_channelName_if(channels, 52), get_state_if(stateVector, 52), get_channelType_if(channels, 52), get_channelName_if(channels, 53), get_state_if(stateVector, 53), get_channelType_if(channels, 53), get_channelName_if(channels, 54), get_state_if(stateVector, 54), get_channelType_if(channels, 54), get_channelName_if(channels, 55), get_state_if(stateVector, 55), get_channelType_if(channels, 55), get_channelName_if(channels, 56), get_state_if(stateVector, 56), get_channelType_if(channels, 56), get_channelName_if(channels, 57), get_state_if(stateVector, 57), get_channelType_if(channels, 57), get_channelName_if(channels, 58), get_state_if(stateVector, 58), get_channelType_if(channels, 58), get_channelName_if(channels, 59), get_state_if(stateVector, 59), get_channelType_if(channels, 59), get_channelName_if(channels, 60), get_state_if(stateVector, 60), get_channelType_if(channels, 60), get_channelName_if(channels, 61), get_state_if(stateVector, 61), get_channelType_if(channels, 61), get_channelName_if(channels, 62), get_state_if(stateVector, 62), get_channelType_if(channels, 62), get_channelName_if(channels, 63), get_state_if(stateVector, 63), get_channelType_if(channels, 63), get_channelName_if(channels, 64), get_state_if(stateVector, 64), get_channelType_if(channels, 64), get_channelName_if(channels, 65), get_state_if(stateVector, 65), get_channelType_if(channels, 65), get_channelName_if(channels, 66), get_state_if(stateVector, 66), get_channelType_if(channels, 66), get_channelName_if(channels, 67), get_state_if(stateVector, 67), get_channelType_if(channels, 67), get_channelName_if(channels, 68), get_state_if(stateVector, 68), get_channelType_if(channels, 68), get_channelName_if(channels, 69), get_state_if(stateVector, 69), get_channelType_if(channels, 69), get_channelName_if(channels, 70), get_state_if(stateVector, 70), get_channelType_if(channels, 70), get_channelName_if(channels, 71), get_state_if(stateVector, 71), get_channelType_if(channels, 71), get_channelName_if(channels, 72), get_state_if(stateVector, 72), get_channelType_if(channels, 72), get_channelName_if(channels, 73), get_state_if(stateVector, 73), get_channelType_if(channels, 73), get_channelName_if(channels, 74), get_state_if(stateVector, 74), get_channelType_if(channels, 74), get_channelName_if(channels, 75), get_state_if(stateVector, 75), get_channelType_if(channels, 75), get_channelName_if(channels, 76), get_state_if(stateVector, 76), get_channelType_if(channels, 76), get_channelName_if(channels, 77), get_state_if(stateVector, 77), get_channelType_if(channels, 77), get_channelName_if(channels, 78), get_state_if(stateVector, 78), get_channelType_if(channels, 78), get_channelName_if(channels, 79), get_state_if(stateVector, 79), get_channelType_if(channels, 79), get_channelName_if(channels, 80), get_state_if(stateVector, 80), get_channelType_if(channels, 80), get_channelName_if(channels, 81), get_state_if(stateVector, 81), get_channelType_if(channels, 81), get_channelName_if(channels, 82), get_state_if(stateVector, 82), get_channelType_if(channels, 82), get_channelName_if(channels, 83), get_state_if(stateVector, 83), get_channelType_if(channels, 83), get_channelName_if(channels, 84), get_state_if(stateVector, 84), get_channelType_if(channels, 84), get_channelName_if(channels, 85), get_state_if(stateVector, 85), get_channelType_if(channels, 85), get_channelName_if(channels, 86), get_state_if(stateVector, 86), get_channelType_if(channels, 86), get_channelName_if(channels, 87), get_state_if(stateVector, 87), get_channelType_if(channels, 87), get_channelName_if(channels, 88), get_state_if(stateVector, 88), get_channelType_if(channels, 88), get_channelName_if(channels, 89), get_state_if(stateVector, 89), get_channelType_if(channels, 89), get_channelName_if(channels, 90), get_state_if(stateVector, 90), get_channelType_if(channels, 90), get_channelName_if(channels, 91), get_state_if(stateVector, 91), get_channelType_if(channels, 91), get_channelName_if(channels, 92), get_state_if(stateVector, 92), get_channelType_if(channels, 92), get_channelName_if(channels, 93), get_state_if(stateVector, 93), get_channelType_if(channels, 93), get_channelName_if(channels, 94), get_state_if(stateVector, 94), get_channelType_if(channels, 94), get_channelName_if(channels, 95), get_state_if(stateVector, 95), get_channelType_if(channels, 95), get_channelName_if(channels, 96), get_state_if(stateVector, 96), get_channelType_if(channels, 96)); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); for (int i = 0; i < stateVector.size(); ++i) { response->add_power_up_states(stateVector[i]); @@ -7618,9 +7488,8 @@ namespace nidaqmx_grpc { int32* channel_type_array = reinterpret_cast(response->mutable_channel_type_array_raw()->mutable_data()); auto status = library_->GetAnalogPowerUpStatesWithOutputType(channel_names, state_array, channel_type_array, &array_size_copy); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->mutable_state_array()->Resize(array_size_copy, 0); response->mutable_channel_type_array()->Clear(); @@ -7652,9 +7521,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetArmStartTrigTimestampVal(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -7677,9 +7545,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetArmStartTrigTrigWhen(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -7700,10 +7567,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetAutoConfiguredCDAQSyncConnections(nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 port_list_size = status; std::string port_list; @@ -7715,10 +7581,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_port_list(port_list); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); @@ -7762,9 +7627,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetBufferAttributeUInt32(task, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -7806,9 +7670,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetCalInfoAttributeBool(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -7850,9 +7713,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetCalInfoAttributeDouble(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -7893,10 +7755,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetCalInfoAttributeString(device_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -7908,10 +7769,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -7955,9 +7815,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetCalInfoAttributeUInt32(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8001,9 +7860,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetChanAttributeBool(task, channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8047,9 +7905,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetChanAttributeDouble(task, channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8092,10 +7949,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetChanAttributeDoubleArray(task, channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -8105,10 +7961,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); return ::grpc::Status::OK; } @@ -8152,9 +8007,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetChanAttributeInt32(task, channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ChannelInt32AttributeValues_IsValid(raw_value); @@ -8203,10 +8057,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetChanAttributeString(task, channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -8218,10 +8071,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -8267,9 +8119,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetChanAttributeUInt32(task, channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8311,9 +8162,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetDeviceAttributeBool(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8355,9 +8205,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetDeviceAttributeDouble(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8398,10 +8247,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeDoubleArray(device_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -8411,10 +8259,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -8456,9 +8303,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetDeviceAttributeInt32(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); @@ -8505,10 +8351,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeInt32Array(device_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value_raw()->Resize(size, 0); @@ -8518,10 +8363,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); @@ -8576,10 +8420,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeString(device_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -8591,10 +8434,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -8638,9 +8480,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetDeviceAttributeUInt32(device_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8681,10 +8522,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDeviceAttributeUInt32Array(device_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -8694,10 +8534,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -8719,9 +8558,8 @@ namespace nidaqmx_grpc { int32 logic_family {}; auto status = library_->GetDigitalLogicFamilyPowerUpState(device_name, &logic_family); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_logic_family(logic_family); return ::grpc::Status::OK; @@ -8764,9 +8602,8 @@ namespace nidaqmx_grpc { stateVector.resize(channel_name.size()); auto status = ((NiDAQmxLibrary*)library_)->GetDigitalPowerUpStates(device_name, get_channelName_if(channel_name, 0), get_state_if(stateVector, 0), get_channelName_if(channel_name, 1), get_state_if(stateVector, 1), get_channelName_if(channel_name, 2), get_state_if(stateVector, 2), get_channelName_if(channel_name, 3), get_state_if(stateVector, 3), get_channelName_if(channel_name, 4), get_state_if(stateVector, 4), get_channelName_if(channel_name, 5), get_state_if(stateVector, 5), get_channelName_if(channel_name, 6), get_state_if(stateVector, 6), get_channelName_if(channel_name, 7), get_state_if(stateVector, 7), get_channelName_if(channel_name, 8), get_state_if(stateVector, 8), get_channelName_if(channel_name, 9), get_state_if(stateVector, 9), get_channelName_if(channel_name, 10), get_state_if(stateVector, 10), get_channelName_if(channel_name, 11), get_state_if(stateVector, 11), get_channelName_if(channel_name, 12), get_state_if(stateVector, 12), get_channelName_if(channel_name, 13), get_state_if(stateVector, 13), get_channelName_if(channel_name, 14), get_state_if(stateVector, 14), get_channelName_if(channel_name, 15), get_state_if(stateVector, 15), get_channelName_if(channel_name, 16), get_state_if(stateVector, 16), get_channelName_if(channel_name, 17), get_state_if(stateVector, 17), get_channelName_if(channel_name, 18), get_state_if(stateVector, 18), get_channelName_if(channel_name, 19), get_state_if(stateVector, 19), get_channelName_if(channel_name, 20), get_state_if(stateVector, 20), get_channelName_if(channel_name, 21), get_state_if(stateVector, 21), get_channelName_if(channel_name, 22), get_state_if(stateVector, 22), get_channelName_if(channel_name, 23), get_state_if(stateVector, 23), get_channelName_if(channel_name, 24), get_state_if(stateVector, 24), get_channelName_if(channel_name, 25), get_state_if(stateVector, 25), get_channelName_if(channel_name, 26), get_state_if(stateVector, 26), get_channelName_if(channel_name, 27), get_state_if(stateVector, 27), get_channelName_if(channel_name, 28), get_state_if(stateVector, 28), get_channelName_if(channel_name, 29), get_state_if(stateVector, 29), get_channelName_if(channel_name, 30), get_state_if(stateVector, 30), get_channelName_if(channel_name, 31), get_state_if(stateVector, 31), get_channelName_if(channel_name, 32), get_state_if(stateVector, 32), get_channelName_if(channel_name, 33), get_state_if(stateVector, 33), get_channelName_if(channel_name, 34), get_state_if(stateVector, 34), get_channelName_if(channel_name, 35), get_state_if(stateVector, 35), get_channelName_if(channel_name, 36), get_state_if(stateVector, 36), get_channelName_if(channel_name, 37), get_state_if(stateVector, 37), get_channelName_if(channel_name, 38), get_state_if(stateVector, 38), get_channelName_if(channel_name, 39), get_state_if(stateVector, 39), get_channelName_if(channel_name, 40), get_state_if(stateVector, 40), get_channelName_if(channel_name, 41), get_state_if(stateVector, 41), get_channelName_if(channel_name, 42), get_state_if(stateVector, 42), get_channelName_if(channel_name, 43), get_state_if(stateVector, 43), get_channelName_if(channel_name, 44), get_state_if(stateVector, 44), get_channelName_if(channel_name, 45), get_state_if(stateVector, 45), get_channelName_if(channel_name, 46), get_state_if(stateVector, 46), get_channelName_if(channel_name, 47), get_state_if(stateVector, 47), get_channelName_if(channel_name, 48), get_state_if(stateVector, 48), get_channelName_if(channel_name, 49), get_state_if(stateVector, 49), get_channelName_if(channel_name, 50), get_state_if(stateVector, 50), get_channelName_if(channel_name, 51), get_state_if(stateVector, 51), get_channelName_if(channel_name, 52), get_state_if(stateVector, 52), get_channelName_if(channel_name, 53), get_state_if(stateVector, 53), get_channelName_if(channel_name, 54), get_state_if(stateVector, 54), get_channelName_if(channel_name, 55), get_state_if(stateVector, 55), get_channelName_if(channel_name, 56), get_state_if(stateVector, 56), get_channelName_if(channel_name, 57), get_state_if(stateVector, 57), get_channelName_if(channel_name, 58), get_state_if(stateVector, 58), get_channelName_if(channel_name, 59), get_state_if(stateVector, 59), get_channelName_if(channel_name, 60), get_state_if(stateVector, 60), get_channelName_if(channel_name, 61), get_state_if(stateVector, 61), get_channelName_if(channel_name, 62), get_state_if(stateVector, 62), get_channelName_if(channel_name, 63), get_state_if(stateVector, 63), get_channelName_if(channel_name, 64), get_state_if(stateVector, 64), get_channelName_if(channel_name, 65), get_state_if(stateVector, 65), get_channelName_if(channel_name, 66), get_state_if(stateVector, 66), get_channelName_if(channel_name, 67), get_state_if(stateVector, 67), get_channelName_if(channel_name, 68), get_state_if(stateVector, 68), get_channelName_if(channel_name, 69), get_state_if(stateVector, 69), get_channelName_if(channel_name, 70), get_state_if(stateVector, 70), get_channelName_if(channel_name, 71), get_state_if(stateVector, 71), get_channelName_if(channel_name, 72), get_state_if(stateVector, 72), get_channelName_if(channel_name, 73), get_state_if(stateVector, 73), get_channelName_if(channel_name, 74), get_state_if(stateVector, 74), get_channelName_if(channel_name, 75), get_state_if(stateVector, 75), get_channelName_if(channel_name, 76), get_state_if(stateVector, 76), get_channelName_if(channel_name, 77), get_state_if(stateVector, 77), get_channelName_if(channel_name, 78), get_state_if(stateVector, 78), get_channelName_if(channel_name, 79), get_state_if(stateVector, 79), get_channelName_if(channel_name, 80), get_state_if(stateVector, 80), get_channelName_if(channel_name, 81), get_state_if(stateVector, 81), get_channelName_if(channel_name, 82), get_state_if(stateVector, 82), get_channelName_if(channel_name, 83), get_state_if(stateVector, 83), get_channelName_if(channel_name, 84), get_state_if(stateVector, 84), get_channelName_if(channel_name, 85), get_state_if(stateVector, 85), get_channelName_if(channel_name, 86), get_state_if(stateVector, 86), get_channelName_if(channel_name, 87), get_state_if(stateVector, 87), get_channelName_if(channel_name, 88), get_state_if(stateVector, 88), get_channelName_if(channel_name, 89), get_state_if(stateVector, 89), get_channelName_if(channel_name, 90), get_state_if(stateVector, 90), get_channelName_if(channel_name, 91), get_state_if(stateVector, 91), get_channelName_if(channel_name, 92), get_state_if(stateVector, 92), get_channelName_if(channel_name, 93), get_state_if(stateVector, 93), get_channelName_if(channel_name, 94), get_state_if(stateVector, 94), get_channelName_if(channel_name, 95), get_state_if(stateVector, 95), get_channelName_if(channel_name, 96), get_state_if(stateVector, 96)); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); for (int i = 0; i < stateVector.size(); ++i) { response->add_power_up_states(static_cast(stateVector[i])); @@ -8811,9 +8648,8 @@ namespace nidaqmx_grpc { stateVector.resize(channel_name.size()); auto status = ((NiDAQmxLibrary*)library_)->GetDigitalPullUpPullDownStates(device_name, get_channelName_if(channel_name, 0), get_state_if(stateVector, 0), get_channelName_if(channel_name, 1), get_state_if(stateVector, 1), get_channelName_if(channel_name, 2), get_state_if(stateVector, 2), get_channelName_if(channel_name, 3), get_state_if(stateVector, 3), get_channelName_if(channel_name, 4), get_state_if(stateVector, 4), get_channelName_if(channel_name, 5), get_state_if(stateVector, 5), get_channelName_if(channel_name, 6), get_state_if(stateVector, 6), get_channelName_if(channel_name, 7), get_state_if(stateVector, 7), get_channelName_if(channel_name, 8), get_state_if(stateVector, 8), get_channelName_if(channel_name, 9), get_state_if(stateVector, 9), get_channelName_if(channel_name, 10), get_state_if(stateVector, 10), get_channelName_if(channel_name, 11), get_state_if(stateVector, 11), get_channelName_if(channel_name, 12), get_state_if(stateVector, 12), get_channelName_if(channel_name, 13), get_state_if(stateVector, 13), get_channelName_if(channel_name, 14), get_state_if(stateVector, 14), get_channelName_if(channel_name, 15), get_state_if(stateVector, 15), get_channelName_if(channel_name, 16), get_state_if(stateVector, 16), get_channelName_if(channel_name, 17), get_state_if(stateVector, 17), get_channelName_if(channel_name, 18), get_state_if(stateVector, 18), get_channelName_if(channel_name, 19), get_state_if(stateVector, 19), get_channelName_if(channel_name, 20), get_state_if(stateVector, 20), get_channelName_if(channel_name, 21), get_state_if(stateVector, 21), get_channelName_if(channel_name, 22), get_state_if(stateVector, 22), get_channelName_if(channel_name, 23), get_state_if(stateVector, 23), get_channelName_if(channel_name, 24), get_state_if(stateVector, 24), get_channelName_if(channel_name, 25), get_state_if(stateVector, 25), get_channelName_if(channel_name, 26), get_state_if(stateVector, 26), get_channelName_if(channel_name, 27), get_state_if(stateVector, 27), get_channelName_if(channel_name, 28), get_state_if(stateVector, 28), get_channelName_if(channel_name, 29), get_state_if(stateVector, 29), get_channelName_if(channel_name, 30), get_state_if(stateVector, 30), get_channelName_if(channel_name, 31), get_state_if(stateVector, 31), get_channelName_if(channel_name, 32), get_state_if(stateVector, 32), get_channelName_if(channel_name, 33), get_state_if(stateVector, 33), get_channelName_if(channel_name, 34), get_state_if(stateVector, 34), get_channelName_if(channel_name, 35), get_state_if(stateVector, 35), get_channelName_if(channel_name, 36), get_state_if(stateVector, 36), get_channelName_if(channel_name, 37), get_state_if(stateVector, 37), get_channelName_if(channel_name, 38), get_state_if(stateVector, 38), get_channelName_if(channel_name, 39), get_state_if(stateVector, 39), get_channelName_if(channel_name, 40), get_state_if(stateVector, 40), get_channelName_if(channel_name, 41), get_state_if(stateVector, 41), get_channelName_if(channel_name, 42), get_state_if(stateVector, 42), get_channelName_if(channel_name, 43), get_state_if(stateVector, 43), get_channelName_if(channel_name, 44), get_state_if(stateVector, 44), get_channelName_if(channel_name, 45), get_state_if(stateVector, 45), get_channelName_if(channel_name, 46), get_state_if(stateVector, 46), get_channelName_if(channel_name, 47), get_state_if(stateVector, 47), get_channelName_if(channel_name, 48), get_state_if(stateVector, 48), get_channelName_if(channel_name, 49), get_state_if(stateVector, 49), get_channelName_if(channel_name, 50), get_state_if(stateVector, 50), get_channelName_if(channel_name, 51), get_state_if(stateVector, 51), get_channelName_if(channel_name, 52), get_state_if(stateVector, 52), get_channelName_if(channel_name, 53), get_state_if(stateVector, 53), get_channelName_if(channel_name, 54), get_state_if(stateVector, 54), get_channelName_if(channel_name, 55), get_state_if(stateVector, 55), get_channelName_if(channel_name, 56), get_state_if(stateVector, 56), get_channelName_if(channel_name, 57), get_state_if(stateVector, 57), get_channelName_if(channel_name, 58), get_state_if(stateVector, 58), get_channelName_if(channel_name, 59), get_state_if(stateVector, 59), get_channelName_if(channel_name, 60), get_state_if(stateVector, 60), get_channelName_if(channel_name, 61), get_state_if(stateVector, 61), get_channelName_if(channel_name, 62), get_state_if(stateVector, 62), get_channelName_if(channel_name, 63), get_state_if(stateVector, 63), get_channelName_if(channel_name, 64), get_state_if(stateVector, 64), get_channelName_if(channel_name, 65), get_state_if(stateVector, 65), get_channelName_if(channel_name, 66), get_state_if(stateVector, 66), get_channelName_if(channel_name, 67), get_state_if(stateVector, 67), get_channelName_if(channel_name, 68), get_state_if(stateVector, 68), get_channelName_if(channel_name, 69), get_state_if(stateVector, 69), get_channelName_if(channel_name, 70), get_state_if(stateVector, 70), get_channelName_if(channel_name, 71), get_state_if(stateVector, 71), get_channelName_if(channel_name, 72), get_state_if(stateVector, 72), get_channelName_if(channel_name, 73), get_state_if(stateVector, 73), get_channelName_if(channel_name, 74), get_state_if(stateVector, 74), get_channelName_if(channel_name, 75), get_state_if(stateVector, 75), get_channelName_if(channel_name, 76), get_state_if(stateVector, 76), get_channelName_if(channel_name, 77), get_state_if(stateVector, 77), get_channelName_if(channel_name, 78), get_state_if(stateVector, 78), get_channelName_if(channel_name, 79), get_state_if(stateVector, 79), get_channelName_if(channel_name, 80), get_state_if(stateVector, 80), get_channelName_if(channel_name, 81), get_state_if(stateVector, 81), get_channelName_if(channel_name, 82), get_state_if(stateVector, 82), get_channelName_if(channel_name, 83), get_state_if(stateVector, 83), get_channelName_if(channel_name, 84), get_state_if(stateVector, 84), get_channelName_if(channel_name, 85), get_state_if(stateVector, 85), get_channelName_if(channel_name, 86), get_state_if(stateVector, 86), get_channelName_if(channel_name, 87), get_state_if(stateVector, 87), get_channelName_if(channel_name, 88), get_state_if(stateVector, 88), get_channelName_if(channel_name, 89), get_state_if(stateVector, 89), get_channelName_if(channel_name, 90), get_state_if(stateVector, 90), get_channelName_if(channel_name, 91), get_state_if(stateVector, 91), get_channelName_if(channel_name, 92), get_state_if(stateVector, 92), get_channelName_if(channel_name, 93), get_state_if(stateVector, 93), get_channelName_if(channel_name, 94), get_state_if(stateVector, 94), get_channelName_if(channel_name, 95), get_state_if(stateVector, 95), get_channelName_if(channel_name, 96), get_state_if(stateVector, 96)); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); for (int i = 0; i < stateVector.size(); ++i) { response->add_pull_up_pull_down_states(static_cast(stateVector[i])); @@ -8836,10 +8672,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetDisconnectedCDAQSyncPorts(nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 port_list_size = status; std::string port_list; @@ -8851,10 +8686,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_port_list(port_list); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); @@ -8878,10 +8712,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetErrorString(error_code, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 buffer_size = status; std::string error_string; @@ -8893,10 +8726,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_error_string(error_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); @@ -8941,9 +8773,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetExportedSignalAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -8986,9 +8817,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetExportedSignalAttributeDouble(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9031,9 +8861,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetExportedSignalAttributeInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ExportSignalInt32AttributeValues_IsValid(raw_value); @@ -9081,10 +8910,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetExportedSignalAttributeString(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -9096,10 +8924,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -9144,9 +8971,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetExportedSignalAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9167,10 +8993,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetExtendedErrorInfo(nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 buffer_size = status; std::string error_string; @@ -9182,10 +9007,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_error_string(error_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); @@ -9210,9 +9034,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetFirstSampClkWhen(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -9235,9 +9058,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetFirstSampTimestampVal(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -9261,10 +9083,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetNthTaskChannel(task, index, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } int32 buffer_size = status; std::string buffer; @@ -9276,10 +9097,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_buffer(buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); @@ -9305,10 +9125,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetNthTaskDevice(task, index, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } int32 buffer_size = status; std::string buffer; @@ -9320,10 +9139,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_buffer(buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); @@ -9349,10 +9167,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetNthTaskReadChannel(task, index, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } int32 buffer_size = status; std::string buffer; @@ -9364,10 +9181,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_buffer(buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); @@ -9411,9 +9227,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetPersistedChanAttributeBool(channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9454,10 +9269,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPersistedChanAttributeString(channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -9469,10 +9283,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -9516,9 +9329,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetPersistedScaleAttributeBool(scale_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9559,10 +9371,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPersistedScaleAttributeString(scale_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -9574,10 +9385,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -9621,9 +9431,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetPersistedTaskAttributeBool(task_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9664,10 +9473,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPersistedTaskAttributeString(task_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -9679,10 +9487,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -9726,9 +9533,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetPhysicalChanAttributeBool(physical_channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9769,10 +9575,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeBytes(physical_channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value(size, '\0'); @@ -9781,10 +9586,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9827,9 +9631,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetPhysicalChanAttributeDouble(physical_channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -9870,10 +9673,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeDoubleArray(physical_channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -9883,10 +9685,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -9928,9 +9729,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetPhysicalChanAttributeInt32(physical_channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); @@ -9977,10 +9777,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeInt32Array(physical_channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value_raw()->Resize(size, 0); @@ -9990,10 +9789,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); @@ -10048,10 +9846,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeString(physical_channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -10063,10 +9860,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -10110,9 +9906,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetPhysicalChanAttributeUInt32(physical_channel, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10153,10 +9948,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetPhysicalChanAttributeUInt32Array(physical_channel, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -10166,10 +9960,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -10212,9 +10005,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetReadAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10257,9 +10049,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetReadAttributeDouble(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10302,9 +10093,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetReadAttributeInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ReadInt32AttributeValues_IsValid(raw_value); @@ -10352,10 +10142,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetReadAttributeString(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -10367,10 +10156,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -10415,9 +10203,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetReadAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10460,9 +10247,8 @@ namespace nidaqmx_grpc { uInt64 value {}; auto status = library_->GetReadAttributeUInt64(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10505,9 +10291,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetRealTimeAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10550,9 +10335,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetRealTimeAttributeInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::RealTimeInt32AttributeValues_IsValid(raw_value); @@ -10601,9 +10385,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetRealTimeAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10626,9 +10409,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetRefTrigTimestampVal(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -10670,9 +10452,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetScaleAttributeDouble(scale_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -10713,10 +10494,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetScaleAttributeDoubleArray(scale_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -10726,10 +10506,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -10771,9 +10550,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetScaleAttributeInt32(scale_name, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::ScaleInt32AttributeValues_IsValid(raw_value); @@ -10820,10 +10598,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetScaleAttributeString(scale_name, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -10835,10 +10612,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -10866,9 +10642,8 @@ namespace nidaqmx_grpc { uInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(device_name, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -10895,9 +10670,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetStartTrigTimestampVal(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -10920,9 +10694,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetStartTrigTrigWhen(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -10945,9 +10718,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime data {}; auto status = library_->GetSyncPulseTimeWhen(task, &data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; @@ -10987,10 +10759,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetSystemInfoAttributeString(attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + } uInt32 size = status; std::string value; @@ -11002,10 +10773,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, 0); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -11048,9 +10818,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetSystemInfoAttributeUInt32(attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11093,9 +10862,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetTaskAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11137,10 +10905,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTaskAttributeString(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -11152,10 +10919,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -11200,9 +10966,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetTaskAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11245,9 +11010,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetTimingAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11290,9 +11054,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetTimingAttributeDouble(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11336,9 +11099,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetTimingAttributeExBool(task, device_names, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11382,9 +11144,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetTimingAttributeExDouble(task, device_names, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11428,9 +11189,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetTimingAttributeExInt32(task, device_names, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); @@ -11479,10 +11239,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTimingAttributeExString(task, device_names, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -11494,10 +11253,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -11543,9 +11301,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime value {}; auto status = library_->GetTimingAttributeExTimestamp(task, device_names, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(value, response->mutable_value()); return ::grpc::Status::OK; @@ -11589,9 +11346,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetTimingAttributeExUInt32(task, device_names, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11635,9 +11391,8 @@ namespace nidaqmx_grpc { uInt64 value {}; auto status = library_->GetTimingAttributeExUInt64(task, device_names, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11680,9 +11435,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetTimingAttributeInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); @@ -11730,10 +11484,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTimingAttributeString(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -11745,10 +11498,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -11793,9 +11545,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime value {}; auto status = library_->GetTimingAttributeTimestamp(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(value, response->mutable_value()); return ::grpc::Status::OK; @@ -11838,9 +11589,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetTimingAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11883,9 +11633,8 @@ namespace nidaqmx_grpc { uInt64 value {}; auto status = library_->GetTimingAttributeUInt64(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11928,9 +11677,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetTrigAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -11973,9 +11721,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetTrigAttributeDouble(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12017,10 +11764,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTrigAttributeDoubleArray(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; response->mutable_value()->Resize(size, 0); @@ -12030,10 +11776,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); return ::grpc::Status::OK; } @@ -12076,9 +11821,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetTrigAttributeInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); @@ -12126,10 +11870,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTrigAttributeInt32Array(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; response->mutable_value_raw()->Resize(size, 0); @@ -12139,10 +11882,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); @@ -12198,10 +11940,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetTrigAttributeString(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -12213,10 +11954,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -12261,9 +12001,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime value {}; auto status = library_->GetTrigAttributeTimestamp(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(value, response->mutable_value()); return ::grpc::Status::OK; @@ -12306,9 +12045,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetTrigAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12352,9 +12090,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetWatchdogAttributeBool(task, lines, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12398,9 +12135,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetWatchdogAttributeDouble(task, lines, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12444,9 +12180,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetWatchdogAttributeInt32(task, lines, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::WatchdogInt32AttributeValues_IsValid(raw_value); @@ -12495,10 +12230,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetWatchdogAttributeString(task, lines, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -12510,10 +12244,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -12558,9 +12291,8 @@ namespace nidaqmx_grpc { bool32 value {}; auto status = library_->GetWriteAttributeBool(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12603,9 +12335,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->GetWriteAttributeDouble(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12648,9 +12379,8 @@ namespace nidaqmx_grpc { int32 value {}; auto status = library_->GetWriteAttributeInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nidaqmx_grpc::WriteInt32AttributeValues_IsValid(raw_value); @@ -12698,10 +12428,9 @@ namespace nidaqmx_grpc { while (true) { auto status = library_->GetWriteAttributeString(task, attribute, nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForTaskHandle(status, task); - } - + } uInt32 size = status; std::string value; @@ -12713,10 +12442,9 @@ namespace nidaqmx_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(status, task); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -12761,9 +12489,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->GetWriteAttributeUInt32(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12806,9 +12533,8 @@ namespace nidaqmx_grpc { uInt64 value {}; auto status = library_->GetWriteAttributeUInt64(task, attribute, &value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12831,9 +12557,8 @@ namespace nidaqmx_grpc { bool32 is_task_done {}; auto status = library_->IsTaskDone(task, &is_task_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_is_task_done(is_task_done); return ::grpc::Status::OK; @@ -12863,9 +12588,8 @@ namespace nidaqmx_grpc { auto cleanup_lambda = [&] (TaskHandle id) { library_->ClearTask(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; @@ -12913,9 +12637,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadAnalogF64(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -12940,9 +12663,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->ReadAnalogScalarF64(task, timeout, &value, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -12986,9 +12708,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadBinaryI16(task, num_samps_per_chan, timeout, fill_mode, read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->mutable_read_array()->Clear(); response->mutable_read_array()->Reserve(array_size_in_samps); @@ -13042,9 +12763,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadBinaryI32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13088,9 +12808,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadBinaryU16(task, num_samps_per_chan, timeout, fill_mode, read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->mutable_read_array()->Clear(); response->mutable_read_array()->Reserve(array_size_in_samps); @@ -13144,9 +12863,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadBinaryU32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13175,9 +12893,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCounterF64(task, num_samps_per_chan, timeout, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13222,9 +12939,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCounterF64Ex(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13249,9 +12965,8 @@ namespace nidaqmx_grpc { float64 value {}; auto status = library_->ReadCounterScalarF64(task, timeout, &value, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -13276,9 +12991,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->ReadCounterScalarU32(task, timeout, &value, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -13307,9 +13021,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCounterU32(task, num_samps_per_chan, timeout, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13354,9 +13067,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCounterU32Ex(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13403,9 +13115,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCtrFreq(task, num_samps_per_chan, timeout, interleaved, read_array_frequency, read_array_duty_cycle, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13431,9 +13142,8 @@ namespace nidaqmx_grpc { float64 duty_cycle {}; auto status = library_->ReadCtrFreqScalar(task, timeout, &frequency, &duty_cycle, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_frequency(frequency); response->set_duty_cycle(duty_cycle); @@ -13481,9 +13191,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCtrTicks(task, num_samps_per_chan, timeout, interleaved, read_array_high_ticks, read_array_low_ticks, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13509,9 +13218,8 @@ namespace nidaqmx_grpc { uInt32 low_ticks {}; auto status = library_->ReadCtrTicksScalar(task, timeout, &high_ticks, &low_ticks, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_high_ticks(high_ticks); response->set_low_ticks(low_ticks); @@ -13559,9 +13267,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadCtrTime(task, num_samps_per_chan, timeout, interleaved, read_array_high_time, read_array_low_time, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13587,9 +13294,8 @@ namespace nidaqmx_grpc { float64 low_time {}; auto status = library_->ReadCtrTimeScalar(task, timeout, &high_time, &low_time, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_high_time(high_time); response->set_low_time(low_time); @@ -13635,9 +13341,8 @@ namespace nidaqmx_grpc { int32 num_bytes_per_samp {}; auto status = library_->ReadDigitalLines(task, num_samps_per_chan, timeout, fill_mode, (uInt8*)read_array.data(), array_size_in_bytes, &samps_per_chan_read, &num_bytes_per_samp, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_read_array(read_array); response->set_samps_per_chan_read(samps_per_chan_read); @@ -13664,9 +13369,8 @@ namespace nidaqmx_grpc { uInt32 value {}; auto status = library_->ReadDigitalScalarU32(task, timeout, &value, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -13710,9 +13414,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadDigitalU16(task, num_samps_per_chan, timeout, fill_mode, read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->mutable_read_array()->Clear(); response->mutable_read_array()->Reserve(array_size_in_samps); @@ -13766,9 +13469,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadDigitalU32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; @@ -13812,9 +13514,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_read {}; auto status = library_->ReadDigitalU8(task, num_samps_per_chan, timeout, fill_mode, (uInt8*)read_array.data(), array_size_in_samps, &samps_per_chan_read, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_read_array(read_array); response->set_samps_per_chan_read(samps_per_chan_read); @@ -13844,9 +13545,8 @@ namespace nidaqmx_grpc { int32 num_bytes_per_samp {}; auto status = library_->ReadRaw(task, num_samps_per_chan, timeout, (uInt8*)read_array.data(), array_size_in_bytes, &samps_read, &num_bytes_per_samp, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_read_array(read_array); response->set_samps_read(samps_read); @@ -14072,9 +13772,8 @@ namespace nidaqmx_grpc { auto port_list = request->port_list().c_str(); auto status = library_->RemoveCDAQSyncConnection(port_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14095,9 +13794,8 @@ namespace nidaqmx_grpc { bool32 override_reservation = request->override_reservation(); auto status = library_->ReserveNetworkDevice(device_name, override_reservation); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14137,9 +13835,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetBufferAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14180,9 +13877,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetChanAttribute(task, channel, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14202,9 +13898,8 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); auto status = library_->ResetDevice(device_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14244,9 +13939,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetExportedSignalAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14286,9 +13980,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetReadAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14328,9 +14021,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetRealTimeAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14370,9 +14062,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetTimingAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14413,9 +14104,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetTimingAttributeEx(task, device_names, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14455,9 +14145,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetTrigAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14498,9 +14187,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetWatchdogAttribute(task, lines, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14540,9 +14228,8 @@ namespace nidaqmx_grpc { auto status = library_->ResetWriteAttribute(task, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14582,9 +14269,8 @@ namespace nidaqmx_grpc { auto status = library_->SaveGlobalChan(task, channel_name, save_as, author, options); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14622,9 +14308,8 @@ namespace nidaqmx_grpc { auto status = library_->SaveScale(scale_name, save_as, author, options); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14663,9 +14348,8 @@ namespace nidaqmx_grpc { auto status = library_->SaveTask(task, save_as, author, options); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14685,9 +14369,8 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); auto status = library_->SelfCal(device_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14707,9 +14390,8 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); auto status = library_->SelfTestDevice(device_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14736,9 +14418,8 @@ namespace nidaqmx_grpc { uInt32 minute = request->minute(); auto status = library_->SetAIChanCalCalDate(task, channel_name, year, month, day, hour, minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14765,9 +14446,8 @@ namespace nidaqmx_grpc { uInt32 minute = request->minute(); auto status = library_->SetAIChanCalExpDate(task, channel_name, year, month, day, hour, minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14813,9 +14493,8 @@ namespace nidaqmx_grpc { auto status = ((NiDAQmxLibrary*)library_)->SetAnalogPowerUpStates(device_name, get_channelNames_if(power_up_states, 0), get_state_if(power_up_states, 0), get_channelType_if(power_up_states, 0), get_channelNames_if(power_up_states, 1), get_state_if(power_up_states, 1), get_channelType_if(power_up_states, 1), get_channelNames_if(power_up_states, 2), get_state_if(power_up_states, 2), get_channelType_if(power_up_states, 2), get_channelNames_if(power_up_states, 3), get_state_if(power_up_states, 3), get_channelType_if(power_up_states, 3), get_channelNames_if(power_up_states, 4), get_state_if(power_up_states, 4), get_channelType_if(power_up_states, 4), get_channelNames_if(power_up_states, 5), get_state_if(power_up_states, 5), get_channelType_if(power_up_states, 5), get_channelNames_if(power_up_states, 6), get_state_if(power_up_states, 6), get_channelType_if(power_up_states, 6), get_channelNames_if(power_up_states, 7), get_state_if(power_up_states, 7), get_channelType_if(power_up_states, 7), get_channelNames_if(power_up_states, 8), get_state_if(power_up_states, 8), get_channelType_if(power_up_states, 8), get_channelNames_if(power_up_states, 9), get_state_if(power_up_states, 9), get_channelType_if(power_up_states, 9), get_channelNames_if(power_up_states, 10), get_state_if(power_up_states, 10), get_channelType_if(power_up_states, 10), get_channelNames_if(power_up_states, 11), get_state_if(power_up_states, 11), get_channelType_if(power_up_states, 11), get_channelNames_if(power_up_states, 12), get_state_if(power_up_states, 12), get_channelType_if(power_up_states, 12), get_channelNames_if(power_up_states, 13), get_state_if(power_up_states, 13), get_channelType_if(power_up_states, 13), get_channelNames_if(power_up_states, 14), get_state_if(power_up_states, 14), get_channelType_if(power_up_states, 14), get_channelNames_if(power_up_states, 15), get_state_if(power_up_states, 15), get_channelType_if(power_up_states, 15), get_channelNames_if(power_up_states, 16), get_state_if(power_up_states, 16), get_channelType_if(power_up_states, 16), get_channelNames_if(power_up_states, 17), get_state_if(power_up_states, 17), get_channelType_if(power_up_states, 17), get_channelNames_if(power_up_states, 18), get_state_if(power_up_states, 18), get_channelType_if(power_up_states, 18), get_channelNames_if(power_up_states, 19), get_state_if(power_up_states, 19), get_channelType_if(power_up_states, 19), get_channelNames_if(power_up_states, 20), get_state_if(power_up_states, 20), get_channelType_if(power_up_states, 20), get_channelNames_if(power_up_states, 21), get_state_if(power_up_states, 21), get_channelType_if(power_up_states, 21), get_channelNames_if(power_up_states, 22), get_state_if(power_up_states, 22), get_channelType_if(power_up_states, 22), get_channelNames_if(power_up_states, 23), get_state_if(power_up_states, 23), get_channelType_if(power_up_states, 23), get_channelNames_if(power_up_states, 24), get_state_if(power_up_states, 24), get_channelType_if(power_up_states, 24), get_channelNames_if(power_up_states, 25), get_state_if(power_up_states, 25), get_channelType_if(power_up_states, 25), get_channelNames_if(power_up_states, 26), get_state_if(power_up_states, 26), get_channelType_if(power_up_states, 26), get_channelNames_if(power_up_states, 27), get_state_if(power_up_states, 27), get_channelType_if(power_up_states, 27), get_channelNames_if(power_up_states, 28), get_state_if(power_up_states, 28), get_channelType_if(power_up_states, 28), get_channelNames_if(power_up_states, 29), get_state_if(power_up_states, 29), get_channelType_if(power_up_states, 29), get_channelNames_if(power_up_states, 30), get_state_if(power_up_states, 30), get_channelType_if(power_up_states, 30), get_channelNames_if(power_up_states, 31), get_state_if(power_up_states, 31), get_channelType_if(power_up_states, 31), get_channelNames_if(power_up_states, 32), get_state_if(power_up_states, 32), get_channelType_if(power_up_states, 32), get_channelNames_if(power_up_states, 33), get_state_if(power_up_states, 33), get_channelType_if(power_up_states, 33), get_channelNames_if(power_up_states, 34), get_state_if(power_up_states, 34), get_channelType_if(power_up_states, 34), get_channelNames_if(power_up_states, 35), get_state_if(power_up_states, 35), get_channelType_if(power_up_states, 35), get_channelNames_if(power_up_states, 36), get_state_if(power_up_states, 36), get_channelType_if(power_up_states, 36), get_channelNames_if(power_up_states, 37), get_state_if(power_up_states, 37), get_channelType_if(power_up_states, 37), get_channelNames_if(power_up_states, 38), get_state_if(power_up_states, 38), get_channelType_if(power_up_states, 38), get_channelNames_if(power_up_states, 39), get_state_if(power_up_states, 39), get_channelType_if(power_up_states, 39), get_channelNames_if(power_up_states, 40), get_state_if(power_up_states, 40), get_channelType_if(power_up_states, 40), get_channelNames_if(power_up_states, 41), get_state_if(power_up_states, 41), get_channelType_if(power_up_states, 41), get_channelNames_if(power_up_states, 42), get_state_if(power_up_states, 42), get_channelType_if(power_up_states, 42), get_channelNames_if(power_up_states, 43), get_state_if(power_up_states, 43), get_channelType_if(power_up_states, 43), get_channelNames_if(power_up_states, 44), get_state_if(power_up_states, 44), get_channelType_if(power_up_states, 44), get_channelNames_if(power_up_states, 45), get_state_if(power_up_states, 45), get_channelType_if(power_up_states, 45), get_channelNames_if(power_up_states, 46), get_state_if(power_up_states, 46), get_channelType_if(power_up_states, 46), get_channelNames_if(power_up_states, 47), get_state_if(power_up_states, 47), get_channelType_if(power_up_states, 47), get_channelNames_if(power_up_states, 48), get_state_if(power_up_states, 48), get_channelType_if(power_up_states, 48), get_channelNames_if(power_up_states, 49), get_state_if(power_up_states, 49), get_channelType_if(power_up_states, 49), get_channelNames_if(power_up_states, 50), get_state_if(power_up_states, 50), get_channelType_if(power_up_states, 50), get_channelNames_if(power_up_states, 51), get_state_if(power_up_states, 51), get_channelType_if(power_up_states, 51), get_channelNames_if(power_up_states, 52), get_state_if(power_up_states, 52), get_channelType_if(power_up_states, 52), get_channelNames_if(power_up_states, 53), get_state_if(power_up_states, 53), get_channelType_if(power_up_states, 53), get_channelNames_if(power_up_states, 54), get_state_if(power_up_states, 54), get_channelType_if(power_up_states, 54), get_channelNames_if(power_up_states, 55), get_state_if(power_up_states, 55), get_channelType_if(power_up_states, 55), get_channelNames_if(power_up_states, 56), get_state_if(power_up_states, 56), get_channelType_if(power_up_states, 56), get_channelNames_if(power_up_states, 57), get_state_if(power_up_states, 57), get_channelType_if(power_up_states, 57), get_channelNames_if(power_up_states, 58), get_state_if(power_up_states, 58), get_channelType_if(power_up_states, 58), get_channelNames_if(power_up_states, 59), get_state_if(power_up_states, 59), get_channelType_if(power_up_states, 59), get_channelNames_if(power_up_states, 60), get_state_if(power_up_states, 60), get_channelType_if(power_up_states, 60), get_channelNames_if(power_up_states, 61), get_state_if(power_up_states, 61), get_channelType_if(power_up_states, 61), get_channelNames_if(power_up_states, 62), get_state_if(power_up_states, 62), get_channelType_if(power_up_states, 62), get_channelNames_if(power_up_states, 63), get_state_if(power_up_states, 63), get_channelType_if(power_up_states, 63), get_channelNames_if(power_up_states, 64), get_state_if(power_up_states, 64), get_channelType_if(power_up_states, 64), get_channelNames_if(power_up_states, 65), get_state_if(power_up_states, 65), get_channelType_if(power_up_states, 65), get_channelNames_if(power_up_states, 66), get_state_if(power_up_states, 66), get_channelType_if(power_up_states, 66), get_channelNames_if(power_up_states, 67), get_state_if(power_up_states, 67), get_channelType_if(power_up_states, 67), get_channelNames_if(power_up_states, 68), get_state_if(power_up_states, 68), get_channelType_if(power_up_states, 68), get_channelNames_if(power_up_states, 69), get_state_if(power_up_states, 69), get_channelType_if(power_up_states, 69), get_channelNames_if(power_up_states, 70), get_state_if(power_up_states, 70), get_channelType_if(power_up_states, 70), get_channelNames_if(power_up_states, 71), get_state_if(power_up_states, 71), get_channelType_if(power_up_states, 71), get_channelNames_if(power_up_states, 72), get_state_if(power_up_states, 72), get_channelType_if(power_up_states, 72), get_channelNames_if(power_up_states, 73), get_state_if(power_up_states, 73), get_channelType_if(power_up_states, 73), get_channelNames_if(power_up_states, 74), get_state_if(power_up_states, 74), get_channelType_if(power_up_states, 74), get_channelNames_if(power_up_states, 75), get_state_if(power_up_states, 75), get_channelType_if(power_up_states, 75), get_channelNames_if(power_up_states, 76), get_state_if(power_up_states, 76), get_channelType_if(power_up_states, 76), get_channelNames_if(power_up_states, 77), get_state_if(power_up_states, 77), get_channelType_if(power_up_states, 77), get_channelNames_if(power_up_states, 78), get_state_if(power_up_states, 78), get_channelType_if(power_up_states, 78), get_channelNames_if(power_up_states, 79), get_state_if(power_up_states, 79), get_channelType_if(power_up_states, 79), get_channelNames_if(power_up_states, 80), get_state_if(power_up_states, 80), get_channelType_if(power_up_states, 80), get_channelNames_if(power_up_states, 81), get_state_if(power_up_states, 81), get_channelType_if(power_up_states, 81), get_channelNames_if(power_up_states, 82), get_state_if(power_up_states, 82), get_channelType_if(power_up_states, 82), get_channelNames_if(power_up_states, 83), get_state_if(power_up_states, 83), get_channelType_if(power_up_states, 83), get_channelNames_if(power_up_states, 84), get_state_if(power_up_states, 84), get_channelType_if(power_up_states, 84), get_channelNames_if(power_up_states, 85), get_state_if(power_up_states, 85), get_channelType_if(power_up_states, 85), get_channelNames_if(power_up_states, 86), get_state_if(power_up_states, 86), get_channelType_if(power_up_states, 86), get_channelNames_if(power_up_states, 87), get_state_if(power_up_states, 87), get_channelType_if(power_up_states, 87), get_channelNames_if(power_up_states, 88), get_state_if(power_up_states, 88), get_channelType_if(power_up_states, 88), get_channelNames_if(power_up_states, 89), get_state_if(power_up_states, 89), get_channelType_if(power_up_states, 89), get_channelNames_if(power_up_states, 90), get_state_if(power_up_states, 90), get_channelType_if(power_up_states, 90), get_channelNames_if(power_up_states, 91), get_state_if(power_up_states, 91), get_channelType_if(power_up_states, 91), get_channelNames_if(power_up_states, 92), get_state_if(power_up_states, 92), get_channelType_if(power_up_states, 92), get_channelNames_if(power_up_states, 93), get_state_if(power_up_states, 93), get_channelType_if(power_up_states, 93), get_channelNames_if(power_up_states, 94), get_state_if(power_up_states, 94), get_channelType_if(power_up_states, 94), get_channelNames_if(power_up_states, 95), get_state_if(power_up_states, 95), get_channelType_if(power_up_states, 95), get_channelNames_if(power_up_states, 96), get_state_if(power_up_states, 96), get_channelType_if(power_up_states, 96)); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14857,9 +14536,8 @@ namespace nidaqmx_grpc { auto status = library_->SetAnalogPowerUpStatesWithOutputType(channel_names, state_array, channel_type_array, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14881,9 +14559,8 @@ namespace nidaqmx_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->SetArmStartTrigTrigWhen(task, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14924,9 +14601,8 @@ namespace nidaqmx_grpc { uInt32 value = request->value(); auto status = library_->SetBufferAttributeUInt32(task, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14967,9 +14643,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetCalInfoAttributeBool(device_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15010,9 +14685,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetCalInfoAttributeDouble(device_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15053,9 +14727,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetCalInfoAttributeString(device_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15096,9 +14769,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetCalInfoAttributeUInt32(device_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15141,9 +14813,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetChanAttributeBool(task, channel, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15186,9 +14857,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetChanAttributeDouble(task, channel, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15231,9 +14901,8 @@ namespace nidaqmx_grpc { uInt32 size = static_cast(request->value().size()); auto status = library_->SetChanAttributeDoubleArray(task, channel, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15291,9 +14960,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetChanAttributeInt32(task, channel, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15336,9 +15004,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetChanAttributeString(task, channel, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15381,9 +15048,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetChanAttributeUInt32(task, channel, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15419,9 +15085,8 @@ namespace nidaqmx_grpc { auto status = library_->SetDigitalLogicFamilyPowerUpState(device_name, logic_family); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15461,9 +15126,8 @@ namespace nidaqmx_grpc { auto status = ((NiDAQmxLibrary*)library_)->SetDigitalPowerUpStates(device_name, get_channelNames_if(power_up_states, 0), get_state_if(power_up_states, 0), get_channelNames_if(power_up_states, 1), get_state_if(power_up_states, 1), get_channelNames_if(power_up_states, 2), get_state_if(power_up_states, 2), get_channelNames_if(power_up_states, 3), get_state_if(power_up_states, 3), get_channelNames_if(power_up_states, 4), get_state_if(power_up_states, 4), get_channelNames_if(power_up_states, 5), get_state_if(power_up_states, 5), get_channelNames_if(power_up_states, 6), get_state_if(power_up_states, 6), get_channelNames_if(power_up_states, 7), get_state_if(power_up_states, 7), get_channelNames_if(power_up_states, 8), get_state_if(power_up_states, 8), get_channelNames_if(power_up_states, 9), get_state_if(power_up_states, 9), get_channelNames_if(power_up_states, 10), get_state_if(power_up_states, 10), get_channelNames_if(power_up_states, 11), get_state_if(power_up_states, 11), get_channelNames_if(power_up_states, 12), get_state_if(power_up_states, 12), get_channelNames_if(power_up_states, 13), get_state_if(power_up_states, 13), get_channelNames_if(power_up_states, 14), get_state_if(power_up_states, 14), get_channelNames_if(power_up_states, 15), get_state_if(power_up_states, 15), get_channelNames_if(power_up_states, 16), get_state_if(power_up_states, 16), get_channelNames_if(power_up_states, 17), get_state_if(power_up_states, 17), get_channelNames_if(power_up_states, 18), get_state_if(power_up_states, 18), get_channelNames_if(power_up_states, 19), get_state_if(power_up_states, 19), get_channelNames_if(power_up_states, 20), get_state_if(power_up_states, 20), get_channelNames_if(power_up_states, 21), get_state_if(power_up_states, 21), get_channelNames_if(power_up_states, 22), get_state_if(power_up_states, 22), get_channelNames_if(power_up_states, 23), get_state_if(power_up_states, 23), get_channelNames_if(power_up_states, 24), get_state_if(power_up_states, 24), get_channelNames_if(power_up_states, 25), get_state_if(power_up_states, 25), get_channelNames_if(power_up_states, 26), get_state_if(power_up_states, 26), get_channelNames_if(power_up_states, 27), get_state_if(power_up_states, 27), get_channelNames_if(power_up_states, 28), get_state_if(power_up_states, 28), get_channelNames_if(power_up_states, 29), get_state_if(power_up_states, 29), get_channelNames_if(power_up_states, 30), get_state_if(power_up_states, 30), get_channelNames_if(power_up_states, 31), get_state_if(power_up_states, 31), get_channelNames_if(power_up_states, 32), get_state_if(power_up_states, 32), get_channelNames_if(power_up_states, 33), get_state_if(power_up_states, 33), get_channelNames_if(power_up_states, 34), get_state_if(power_up_states, 34), get_channelNames_if(power_up_states, 35), get_state_if(power_up_states, 35), get_channelNames_if(power_up_states, 36), get_state_if(power_up_states, 36), get_channelNames_if(power_up_states, 37), get_state_if(power_up_states, 37), get_channelNames_if(power_up_states, 38), get_state_if(power_up_states, 38), get_channelNames_if(power_up_states, 39), get_state_if(power_up_states, 39), get_channelNames_if(power_up_states, 40), get_state_if(power_up_states, 40), get_channelNames_if(power_up_states, 41), get_state_if(power_up_states, 41), get_channelNames_if(power_up_states, 42), get_state_if(power_up_states, 42), get_channelNames_if(power_up_states, 43), get_state_if(power_up_states, 43), get_channelNames_if(power_up_states, 44), get_state_if(power_up_states, 44), get_channelNames_if(power_up_states, 45), get_state_if(power_up_states, 45), get_channelNames_if(power_up_states, 46), get_state_if(power_up_states, 46), get_channelNames_if(power_up_states, 47), get_state_if(power_up_states, 47), get_channelNames_if(power_up_states, 48), get_state_if(power_up_states, 48), get_channelNames_if(power_up_states, 49), get_state_if(power_up_states, 49), get_channelNames_if(power_up_states, 50), get_state_if(power_up_states, 50), get_channelNames_if(power_up_states, 51), get_state_if(power_up_states, 51), get_channelNames_if(power_up_states, 52), get_state_if(power_up_states, 52), get_channelNames_if(power_up_states, 53), get_state_if(power_up_states, 53), get_channelNames_if(power_up_states, 54), get_state_if(power_up_states, 54), get_channelNames_if(power_up_states, 55), get_state_if(power_up_states, 55), get_channelNames_if(power_up_states, 56), get_state_if(power_up_states, 56), get_channelNames_if(power_up_states, 57), get_state_if(power_up_states, 57), get_channelNames_if(power_up_states, 58), get_state_if(power_up_states, 58), get_channelNames_if(power_up_states, 59), get_state_if(power_up_states, 59), get_channelNames_if(power_up_states, 60), get_state_if(power_up_states, 60), get_channelNames_if(power_up_states, 61), get_state_if(power_up_states, 61), get_channelNames_if(power_up_states, 62), get_state_if(power_up_states, 62), get_channelNames_if(power_up_states, 63), get_state_if(power_up_states, 63), get_channelNames_if(power_up_states, 64), get_state_if(power_up_states, 64), get_channelNames_if(power_up_states, 65), get_state_if(power_up_states, 65), get_channelNames_if(power_up_states, 66), get_state_if(power_up_states, 66), get_channelNames_if(power_up_states, 67), get_state_if(power_up_states, 67), get_channelNames_if(power_up_states, 68), get_state_if(power_up_states, 68), get_channelNames_if(power_up_states, 69), get_state_if(power_up_states, 69), get_channelNames_if(power_up_states, 70), get_state_if(power_up_states, 70), get_channelNames_if(power_up_states, 71), get_state_if(power_up_states, 71), get_channelNames_if(power_up_states, 72), get_state_if(power_up_states, 72), get_channelNames_if(power_up_states, 73), get_state_if(power_up_states, 73), get_channelNames_if(power_up_states, 74), get_state_if(power_up_states, 74), get_channelNames_if(power_up_states, 75), get_state_if(power_up_states, 75), get_channelNames_if(power_up_states, 76), get_state_if(power_up_states, 76), get_channelNames_if(power_up_states, 77), get_state_if(power_up_states, 77), get_channelNames_if(power_up_states, 78), get_state_if(power_up_states, 78), get_channelNames_if(power_up_states, 79), get_state_if(power_up_states, 79), get_channelNames_if(power_up_states, 80), get_state_if(power_up_states, 80), get_channelNames_if(power_up_states, 81), get_state_if(power_up_states, 81), get_channelNames_if(power_up_states, 82), get_state_if(power_up_states, 82), get_channelNames_if(power_up_states, 83), get_state_if(power_up_states, 83), get_channelNames_if(power_up_states, 84), get_state_if(power_up_states, 84), get_channelNames_if(power_up_states, 85), get_state_if(power_up_states, 85), get_channelNames_if(power_up_states, 86), get_state_if(power_up_states, 86), get_channelNames_if(power_up_states, 87), get_state_if(power_up_states, 87), get_channelNames_if(power_up_states, 88), get_state_if(power_up_states, 88), get_channelNames_if(power_up_states, 89), get_state_if(power_up_states, 89), get_channelNames_if(power_up_states, 90), get_state_if(power_up_states, 90), get_channelNames_if(power_up_states, 91), get_state_if(power_up_states, 91), get_channelNames_if(power_up_states, 92), get_state_if(power_up_states, 92), get_channelNames_if(power_up_states, 93), get_state_if(power_up_states, 93), get_channelNames_if(power_up_states, 94), get_state_if(power_up_states, 94), get_channelNames_if(power_up_states, 95), get_state_if(power_up_states, 95), get_channelNames_if(power_up_states, 96), get_state_if(power_up_states, 96)); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15503,9 +15167,8 @@ namespace nidaqmx_grpc { auto status = ((NiDAQmxLibrary*)library_)->SetDigitalPullUpPullDownStates(device_name, get_channelNames_if(pull_up_pull_down_states, 0), get_state_if(pull_up_pull_down_states, 0), get_channelNames_if(pull_up_pull_down_states, 1), get_state_if(pull_up_pull_down_states, 1), get_channelNames_if(pull_up_pull_down_states, 2), get_state_if(pull_up_pull_down_states, 2), get_channelNames_if(pull_up_pull_down_states, 3), get_state_if(pull_up_pull_down_states, 3), get_channelNames_if(pull_up_pull_down_states, 4), get_state_if(pull_up_pull_down_states, 4), get_channelNames_if(pull_up_pull_down_states, 5), get_state_if(pull_up_pull_down_states, 5), get_channelNames_if(pull_up_pull_down_states, 6), get_state_if(pull_up_pull_down_states, 6), get_channelNames_if(pull_up_pull_down_states, 7), get_state_if(pull_up_pull_down_states, 7), get_channelNames_if(pull_up_pull_down_states, 8), get_state_if(pull_up_pull_down_states, 8), get_channelNames_if(pull_up_pull_down_states, 9), get_state_if(pull_up_pull_down_states, 9), get_channelNames_if(pull_up_pull_down_states, 10), get_state_if(pull_up_pull_down_states, 10), get_channelNames_if(pull_up_pull_down_states, 11), get_state_if(pull_up_pull_down_states, 11), get_channelNames_if(pull_up_pull_down_states, 12), get_state_if(pull_up_pull_down_states, 12), get_channelNames_if(pull_up_pull_down_states, 13), get_state_if(pull_up_pull_down_states, 13), get_channelNames_if(pull_up_pull_down_states, 14), get_state_if(pull_up_pull_down_states, 14), get_channelNames_if(pull_up_pull_down_states, 15), get_state_if(pull_up_pull_down_states, 15), get_channelNames_if(pull_up_pull_down_states, 16), get_state_if(pull_up_pull_down_states, 16), get_channelNames_if(pull_up_pull_down_states, 17), get_state_if(pull_up_pull_down_states, 17), get_channelNames_if(pull_up_pull_down_states, 18), get_state_if(pull_up_pull_down_states, 18), get_channelNames_if(pull_up_pull_down_states, 19), get_state_if(pull_up_pull_down_states, 19), get_channelNames_if(pull_up_pull_down_states, 20), get_state_if(pull_up_pull_down_states, 20), get_channelNames_if(pull_up_pull_down_states, 21), get_state_if(pull_up_pull_down_states, 21), get_channelNames_if(pull_up_pull_down_states, 22), get_state_if(pull_up_pull_down_states, 22), get_channelNames_if(pull_up_pull_down_states, 23), get_state_if(pull_up_pull_down_states, 23), get_channelNames_if(pull_up_pull_down_states, 24), get_state_if(pull_up_pull_down_states, 24), get_channelNames_if(pull_up_pull_down_states, 25), get_state_if(pull_up_pull_down_states, 25), get_channelNames_if(pull_up_pull_down_states, 26), get_state_if(pull_up_pull_down_states, 26), get_channelNames_if(pull_up_pull_down_states, 27), get_state_if(pull_up_pull_down_states, 27), get_channelNames_if(pull_up_pull_down_states, 28), get_state_if(pull_up_pull_down_states, 28), get_channelNames_if(pull_up_pull_down_states, 29), get_state_if(pull_up_pull_down_states, 29), get_channelNames_if(pull_up_pull_down_states, 30), get_state_if(pull_up_pull_down_states, 30), get_channelNames_if(pull_up_pull_down_states, 31), get_state_if(pull_up_pull_down_states, 31), get_channelNames_if(pull_up_pull_down_states, 32), get_state_if(pull_up_pull_down_states, 32), get_channelNames_if(pull_up_pull_down_states, 33), get_state_if(pull_up_pull_down_states, 33), get_channelNames_if(pull_up_pull_down_states, 34), get_state_if(pull_up_pull_down_states, 34), get_channelNames_if(pull_up_pull_down_states, 35), get_state_if(pull_up_pull_down_states, 35), get_channelNames_if(pull_up_pull_down_states, 36), get_state_if(pull_up_pull_down_states, 36), get_channelNames_if(pull_up_pull_down_states, 37), get_state_if(pull_up_pull_down_states, 37), get_channelNames_if(pull_up_pull_down_states, 38), get_state_if(pull_up_pull_down_states, 38), get_channelNames_if(pull_up_pull_down_states, 39), get_state_if(pull_up_pull_down_states, 39), get_channelNames_if(pull_up_pull_down_states, 40), get_state_if(pull_up_pull_down_states, 40), get_channelNames_if(pull_up_pull_down_states, 41), get_state_if(pull_up_pull_down_states, 41), get_channelNames_if(pull_up_pull_down_states, 42), get_state_if(pull_up_pull_down_states, 42), get_channelNames_if(pull_up_pull_down_states, 43), get_state_if(pull_up_pull_down_states, 43), get_channelNames_if(pull_up_pull_down_states, 44), get_state_if(pull_up_pull_down_states, 44), get_channelNames_if(pull_up_pull_down_states, 45), get_state_if(pull_up_pull_down_states, 45), get_channelNames_if(pull_up_pull_down_states, 46), get_state_if(pull_up_pull_down_states, 46), get_channelNames_if(pull_up_pull_down_states, 47), get_state_if(pull_up_pull_down_states, 47), get_channelNames_if(pull_up_pull_down_states, 48), get_state_if(pull_up_pull_down_states, 48), get_channelNames_if(pull_up_pull_down_states, 49), get_state_if(pull_up_pull_down_states, 49), get_channelNames_if(pull_up_pull_down_states, 50), get_state_if(pull_up_pull_down_states, 50), get_channelNames_if(pull_up_pull_down_states, 51), get_state_if(pull_up_pull_down_states, 51), get_channelNames_if(pull_up_pull_down_states, 52), get_state_if(pull_up_pull_down_states, 52), get_channelNames_if(pull_up_pull_down_states, 53), get_state_if(pull_up_pull_down_states, 53), get_channelNames_if(pull_up_pull_down_states, 54), get_state_if(pull_up_pull_down_states, 54), get_channelNames_if(pull_up_pull_down_states, 55), get_state_if(pull_up_pull_down_states, 55), get_channelNames_if(pull_up_pull_down_states, 56), get_state_if(pull_up_pull_down_states, 56), get_channelNames_if(pull_up_pull_down_states, 57), get_state_if(pull_up_pull_down_states, 57), get_channelNames_if(pull_up_pull_down_states, 58), get_state_if(pull_up_pull_down_states, 58), get_channelNames_if(pull_up_pull_down_states, 59), get_state_if(pull_up_pull_down_states, 59), get_channelNames_if(pull_up_pull_down_states, 60), get_state_if(pull_up_pull_down_states, 60), get_channelNames_if(pull_up_pull_down_states, 61), get_state_if(pull_up_pull_down_states, 61), get_channelNames_if(pull_up_pull_down_states, 62), get_state_if(pull_up_pull_down_states, 62), get_channelNames_if(pull_up_pull_down_states, 63), get_state_if(pull_up_pull_down_states, 63), get_channelNames_if(pull_up_pull_down_states, 64), get_state_if(pull_up_pull_down_states, 64), get_channelNames_if(pull_up_pull_down_states, 65), get_state_if(pull_up_pull_down_states, 65), get_channelNames_if(pull_up_pull_down_states, 66), get_state_if(pull_up_pull_down_states, 66), get_channelNames_if(pull_up_pull_down_states, 67), get_state_if(pull_up_pull_down_states, 67), get_channelNames_if(pull_up_pull_down_states, 68), get_state_if(pull_up_pull_down_states, 68), get_channelNames_if(pull_up_pull_down_states, 69), get_state_if(pull_up_pull_down_states, 69), get_channelNames_if(pull_up_pull_down_states, 70), get_state_if(pull_up_pull_down_states, 70), get_channelNames_if(pull_up_pull_down_states, 71), get_state_if(pull_up_pull_down_states, 71), get_channelNames_if(pull_up_pull_down_states, 72), get_state_if(pull_up_pull_down_states, 72), get_channelNames_if(pull_up_pull_down_states, 73), get_state_if(pull_up_pull_down_states, 73), get_channelNames_if(pull_up_pull_down_states, 74), get_state_if(pull_up_pull_down_states, 74), get_channelNames_if(pull_up_pull_down_states, 75), get_state_if(pull_up_pull_down_states, 75), get_channelNames_if(pull_up_pull_down_states, 76), get_state_if(pull_up_pull_down_states, 76), get_channelNames_if(pull_up_pull_down_states, 77), get_state_if(pull_up_pull_down_states, 77), get_channelNames_if(pull_up_pull_down_states, 78), get_state_if(pull_up_pull_down_states, 78), get_channelNames_if(pull_up_pull_down_states, 79), get_state_if(pull_up_pull_down_states, 79), get_channelNames_if(pull_up_pull_down_states, 80), get_state_if(pull_up_pull_down_states, 80), get_channelNames_if(pull_up_pull_down_states, 81), get_state_if(pull_up_pull_down_states, 81), get_channelNames_if(pull_up_pull_down_states, 82), get_state_if(pull_up_pull_down_states, 82), get_channelNames_if(pull_up_pull_down_states, 83), get_state_if(pull_up_pull_down_states, 83), get_channelNames_if(pull_up_pull_down_states, 84), get_state_if(pull_up_pull_down_states, 84), get_channelNames_if(pull_up_pull_down_states, 85), get_state_if(pull_up_pull_down_states, 85), get_channelNames_if(pull_up_pull_down_states, 86), get_state_if(pull_up_pull_down_states, 86), get_channelNames_if(pull_up_pull_down_states, 87), get_state_if(pull_up_pull_down_states, 87), get_channelNames_if(pull_up_pull_down_states, 88), get_state_if(pull_up_pull_down_states, 88), get_channelNames_if(pull_up_pull_down_states, 89), get_state_if(pull_up_pull_down_states, 89), get_channelNames_if(pull_up_pull_down_states, 90), get_state_if(pull_up_pull_down_states, 90), get_channelNames_if(pull_up_pull_down_states, 91), get_state_if(pull_up_pull_down_states, 91), get_channelNames_if(pull_up_pull_down_states, 92), get_state_if(pull_up_pull_down_states, 92), get_channelNames_if(pull_up_pull_down_states, 93), get_state_if(pull_up_pull_down_states, 93), get_channelNames_if(pull_up_pull_down_states, 94), get_state_if(pull_up_pull_down_states, 94), get_channelNames_if(pull_up_pull_down_states, 95), get_state_if(pull_up_pull_down_states, 95), get_channelNames_if(pull_up_pull_down_states, 96), get_state_if(pull_up_pull_down_states, 96)); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15547,9 +15210,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetExportedSignalAttributeBool(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15591,9 +15253,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetExportedSignalAttributeDouble(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15650,9 +15311,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetExportedSignalAttributeInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15694,9 +15354,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetExportedSignalAttributeString(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15738,9 +15397,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetExportedSignalAttributeUInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15762,9 +15420,8 @@ namespace nidaqmx_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->SetFirstSampClkWhen(task, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15806,9 +15463,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeBool(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15850,9 +15506,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeDouble(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15909,9 +15564,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15953,9 +15607,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeString(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15997,9 +15650,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeUInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16041,9 +15693,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetReadAttributeUInt64(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16085,9 +15736,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetRealTimeAttributeBool(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16144,9 +15794,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetRealTimeAttributeInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16188,9 +15837,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetRealTimeAttributeUInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16231,9 +15879,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetScaleAttributeDouble(scale_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16274,9 +15921,8 @@ namespace nidaqmx_grpc { uInt32 size = static_cast(request->value().size()); auto status = library_->SetScaleAttributeDoubleArray(scale_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16332,9 +15978,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetScaleAttributeInt32(scale_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16375,9 +16020,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetScaleAttributeString(scale_name, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16399,9 +16043,8 @@ namespace nidaqmx_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->SetStartTrigTrigWhen(task, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16423,9 +16066,8 @@ namespace nidaqmx_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->SetSyncPulseTimeWhen(task, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16467,9 +16109,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeBool(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16511,9 +16152,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeDouble(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16556,9 +16196,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExBool(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16601,9 +16240,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExDouble(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16661,9 +16299,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExInt32(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16706,9 +16343,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExString(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16751,9 +16387,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExTimestamp(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16796,9 +16431,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExUInt32(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16841,9 +16475,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeExUInt64(task, device_names, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16900,9 +16533,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16944,9 +16576,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeString(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16988,9 +16619,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeTimestamp(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17032,9 +16662,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeUInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17076,9 +16705,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTimingAttributeUInt64(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17120,9 +16748,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeBool(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17164,9 +16791,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeDouble(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17208,9 +16834,8 @@ namespace nidaqmx_grpc { uInt32 size = static_cast(request->value().size()); auto status = library_->SetTrigAttributeDoubleArray(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17267,9 +16892,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17311,9 +16935,8 @@ namespace nidaqmx_grpc { uInt32 size = static_cast(request->value().size()); auto status = library_->SetTrigAttributeInt32Array(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17355,9 +16978,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeString(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17399,9 +17021,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeTimestamp(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17443,9 +17064,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetTrigAttributeUInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17488,9 +17108,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWatchdogAttributeBool(task, lines, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17533,9 +17152,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWatchdogAttributeDouble(task, lines, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17593,9 +17211,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWatchdogAttributeInt32(task, lines, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17638,9 +17255,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWatchdogAttributeString(task, lines, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17682,9 +17298,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeBool(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17726,9 +17341,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeDouble(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17785,9 +17399,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17829,9 +17442,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeString(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17873,9 +17485,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeUInt32(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17917,9 +17528,8 @@ namespace nidaqmx_grpc { auto size = 0U; auto status = library_->SetWriteAttributeUInt64(task, attribute, value, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17941,9 +17551,8 @@ namespace nidaqmx_grpc { auto file_path = request->file_path().c_str(); auto status = library_->StartNewFile(task, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17964,9 +17573,8 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->StartTask(task); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -17987,9 +17595,8 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.id(), task_grpc_session.name()); auto status = library_->StopTask(task); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18026,9 +17633,8 @@ namespace nidaqmx_grpc { auto status = library_->TaskControl(task, action); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18048,9 +17654,8 @@ namespace nidaqmx_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->TristateOutputTerm(output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18070,9 +17675,8 @@ namespace nidaqmx_grpc { auto device_name = request->device_name().c_str(); auto status = library_->UnreserveNetworkDevice(device_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18095,9 +17699,8 @@ namespace nidaqmx_grpc { bool32 is_late {}; auto status = library_->WaitForNextSampleClock(task, timeout, &is_late); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_is_late(is_late); return ::grpc::Status::OK; @@ -18137,9 +17740,8 @@ namespace nidaqmx_grpc { CVIAbsoluteTime timestamp {}; auto status = library_->WaitForValidTimestamp(task, timestamp_event, timeout, ×tamp); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); convert_to_grpc(timestamp, response->mutable_timestamp()); return ::grpc::Status::OK; @@ -18162,9 +17764,8 @@ namespace nidaqmx_grpc { float64 time_to_wait = request->time_to_wait(); auto status = library_->WaitUntilTaskDone(task, time_to_wait); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18207,9 +17808,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteAnalogF64(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18235,9 +17835,8 @@ namespace nidaqmx_grpc { auto reserved = nullptr; auto status = library_->WriteAnalogScalarF64(task, auto_start, timeout, value, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18297,9 +17896,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteBinaryI16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18346,9 +17944,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteBinaryI32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18409,9 +18006,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteBinaryU16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18458,9 +18054,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteBinaryU32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18505,9 +18100,8 @@ namespace nidaqmx_grpc { int32 num_samps_per_chan_written {}; auto status = library_->WriteCtrFreq(task, num_samps_per_chan, auto_start, timeout, data_layout, frequency, duty_cycle, &num_samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_num_samps_per_chan_written(num_samps_per_chan_written); return ::grpc::Status::OK; @@ -18534,9 +18128,8 @@ namespace nidaqmx_grpc { auto reserved = nullptr; auto status = library_->WriteCtrFreqScalar(task, auto_start, timeout, frequency, duty_cycle, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18580,9 +18173,8 @@ namespace nidaqmx_grpc { int32 num_samps_per_chan_written {}; auto status = library_->WriteCtrTicks(task, num_samps_per_chan, auto_start, timeout, data_layout, high_ticks, low_ticks, &num_samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_num_samps_per_chan_written(num_samps_per_chan_written); return ::grpc::Status::OK; @@ -18609,9 +18201,8 @@ namespace nidaqmx_grpc { auto reserved = nullptr; auto status = library_->WriteCtrTicksScalar(task, auto_start, timeout, high_ticks, low_ticks, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18655,9 +18246,8 @@ namespace nidaqmx_grpc { int32 num_samps_per_chan_written {}; auto status = library_->WriteCtrTime(task, num_samps_per_chan, auto_start, timeout, data_layout, high_time, low_time, &num_samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_num_samps_per_chan_written(num_samps_per_chan_written); return ::grpc::Status::OK; @@ -18684,9 +18274,8 @@ namespace nidaqmx_grpc { auto reserved = nullptr; auto status = library_->WriteCtrTimeScalar(task, auto_start, timeout, high_time, low_time, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18729,9 +18318,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteDigitalLines(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18757,9 +18345,8 @@ namespace nidaqmx_grpc { auto reserved = nullptr; auto status = library_->WriteDigitalScalarU32(task, auto_start, timeout, value, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); return ::grpc::Status::OK; } @@ -18819,9 +18406,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteDigitalU16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18868,9 +18454,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteDigitalU32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18914,9 +18499,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteDigitalU8(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18944,9 +18528,8 @@ namespace nidaqmx_grpc { int32 samps_per_chan_written {}; auto status = library_->WriteRaw(task, num_samps, auto_start, timeout, write_array, &samps_per_chan_written, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, task); + return ConvertApiErrorStatusForTaskHandle(status, task); } - response->set_status(status); response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; @@ -18985,9 +18568,8 @@ namespace nidaqmx_grpc { auto status = library_->WriteToTEDSFromArray(physical_channel, bit_stream, array_size, basic_teds_options); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -19024,9 +18606,8 @@ namespace nidaqmx_grpc { auto status = library_->WriteToTEDSFromFile(physical_channel, file_path, basic_teds_options); if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(status, 0); + return ConvertApiErrorStatusForTaskHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidcpower/nidcpower_service.cpp b/generated/nidcpower/nidcpower_service.cpp index a9ef22de1..122e05b9d 100644 --- a/generated/nidcpower/nidcpower_service.cpp +++ b/generated/nidcpower/nidcpower_service.cpp @@ -58,9 +58,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->AbortWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -82,9 +81,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->CommitWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -123,9 +121,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeMeasureTriggerWithChannels(vi, channel_name, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -164,9 +161,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgePulseTriggerWithChannels(vi, channel_name, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -205,9 +201,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeSequenceAdvanceTriggerWithChannels(vi, channel_name, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -246,9 +241,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeShutdownTriggerWithChannels(vi, channel_name, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -287,9 +281,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeSourceTriggerWithChannels(vi, channel_name, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -328,9 +321,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeStartTriggerWithChannels(vi, channel_name, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -354,9 +346,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigureOvp(vi, channel_name, enabled, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -378,9 +369,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeMeasureTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -402,9 +392,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgePulseTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -426,9 +415,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeSequenceAdvanceTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -450,9 +438,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeShutdownTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -474,9 +461,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeSourceTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -498,9 +484,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ConfigureSoftwareEdgeStartTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -538,9 +523,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureSourceModeWithChannels(vi, channel_name, source_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -563,9 +547,8 @@ namespace nidcpower_grpc { ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateAdvancedSequenceCommitStepWithChannels(vi, channel_name, set_as_active_step); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -588,9 +571,8 @@ namespace nidcpower_grpc { ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateAdvancedSequenceStepWithChannels(vi, channel_name, set_as_active_step); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -616,9 +598,8 @@ namespace nidcpower_grpc { ViBoolean set_as_active_sequence = request->set_as_active_sequence(); auto status = library_->CreateAdvancedSequenceWithChannels(vi, channel_name, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -643,9 +624,8 @@ namespace nidcpower_grpc { ViBoolean set_as_active_sequence = request->set_as_active_sequence(); auto status = library_->CreateAdvancedSequence(vi, sequence_name, attribute_id_count, attribute_ids, set_as_active_sequence); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -668,9 +648,8 @@ namespace nidcpower_grpc { auto sequence_name = request->sequence_name().c_str(); auto status = library_->DeleteAdvancedSequenceWithChannels(vi, channel_name, sequence_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -692,9 +671,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisablePulseTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -716,9 +694,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableSequenceAdvanceTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -740,9 +717,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableShutdownTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -764,9 +740,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableSourceTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -788,9 +763,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableStartTriggerWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -813,9 +787,8 @@ namespace nidcpower_grpc { ViInt32 error_code {}; auto status = library_->ErrorQuery(vi, &error_code, error_message); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_code(error_code); return ::grpc::Status::OK; @@ -856,9 +829,8 @@ namespace nidcpower_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignalWithChannels(vi, channel_name, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -889,9 +861,8 @@ namespace nidcpower_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -917,9 +888,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->InitiateWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -940,9 +910,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -964,9 +933,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ResetWithChannels(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1004,9 +972,8 @@ namespace nidcpower_grpc { auto status = library_->SendSoftwareEdgeTriggerWithChannels(vi, channel_name, trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1045,9 +1012,8 @@ namespace nidcpower_grpc { ViReal64 timeout = request->timeout(); auto status = library_->WaitForEventWithChannels(vi, channel_name, event_id, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1068,9 +1034,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1092,9 +1057,8 @@ namespace nidcpower_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->CalSelfCalibrate(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1115,9 +1079,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1138,9 +1101,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1162,9 +1124,8 @@ namespace nidcpower_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1185,9 +1146,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1226,9 +1186,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureApertureTime(vi, channel_name, aperture_time, units); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1266,9 +1225,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureAutoZero(vi, channel_name, auto_zero); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1291,9 +1249,8 @@ namespace nidcpower_grpc { ViReal64 level = request->level(); auto status = library_->ConfigureCurrentLevel(vi, channel_name, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1316,9 +1273,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigureCurrentLevelRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1357,9 +1313,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigureCurrentLimit(vi, channel_name, behavior, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1382,9 +1337,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigureCurrentLimitRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1422,9 +1376,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeMeasureTrigger(vi, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1462,9 +1415,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgePulseTrigger(vi, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1502,9 +1454,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeSequenceAdvanceTrigger(vi, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1542,9 +1493,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeSourceTrigger(vi, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1582,9 +1532,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, input_terminal, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1607,9 +1556,8 @@ namespace nidcpower_grpc { ViBoolean enabled = request->enabled(); auto status = library_->ConfigureOutputEnabled(vi, channel_name, enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1647,9 +1595,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureOutputFunction(vi, channel_name, function); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1672,9 +1619,8 @@ namespace nidcpower_grpc { ViReal64 resistance = request->resistance(); auto status = library_->ConfigureOutputResistance(vi, channel_name, resistance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1711,9 +1657,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigurePowerLineFrequency(vi, powerline_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1736,9 +1681,8 @@ namespace nidcpower_grpc { ViReal64 level = request->level(); auto status = library_->ConfigurePulseBiasCurrentLevel(vi, channel_name, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1761,9 +1705,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseBiasCurrentLimit(vi, channel_name, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1786,9 +1729,8 @@ namespace nidcpower_grpc { ViReal64 level = request->level(); auto status = library_->ConfigurePulseBiasVoltageLevel(vi, channel_name, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1811,9 +1753,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseBiasVoltageLimit(vi, channel_name, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1836,9 +1777,8 @@ namespace nidcpower_grpc { ViReal64 level = request->level(); auto status = library_->ConfigurePulseCurrentLevel(vi, channel_name, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1861,9 +1801,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigurePulseCurrentLevelRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1886,9 +1825,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseCurrentLimit(vi, channel_name, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1911,9 +1849,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigurePulseCurrentLimitRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1936,9 +1873,8 @@ namespace nidcpower_grpc { ViReal64 level = request->level(); auto status = library_->ConfigurePulseVoltageLevel(vi, channel_name, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1961,9 +1897,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigurePulseVoltageLevelRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1986,9 +1921,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigurePulseVoltageLimit(vi, channel_name, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2011,9 +1945,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigurePulseVoltageLimitRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2051,9 +1984,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureSense(vi, channel_name, sense); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2074,9 +2006,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeMeasureTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2097,9 +2028,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgePulseTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2120,9 +2050,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeSequenceAdvanceTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2143,9 +2072,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeSourceTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2166,9 +2094,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2205,9 +2132,8 @@ namespace nidcpower_grpc { auto status = library_->ConfigureSourceMode(vi, source_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2230,9 +2156,8 @@ namespace nidcpower_grpc { ViReal64 level = request->level(); auto status = library_->ConfigureVoltageLevel(vi, channel_name, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2255,9 +2180,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigureVoltageLevelRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2280,9 +2204,8 @@ namespace nidcpower_grpc { ViReal64 limit = request->limit(); auto status = library_->ConfigureVoltageLimit(vi, channel_name, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2305,9 +2228,8 @@ namespace nidcpower_grpc { ViReal64 range = request->range(); auto status = library_->ConfigureVoltageLimitRange(vi, channel_name, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2329,9 +2251,8 @@ namespace nidcpower_grpc { ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateAdvancedSequenceStep(vi, set_as_active_step); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2353,9 +2274,8 @@ namespace nidcpower_grpc { auto sequence_name = request->sequence_name().c_str(); auto status = library_->DeleteAdvancedSequence(vi, sequence_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2376,9 +2296,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2399,9 +2318,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisablePulseTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2422,9 +2340,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableSequenceAdvanceTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2445,9 +2362,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableSourceTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2468,9 +2384,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2493,9 +2408,8 @@ namespace nidcpower_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -2519,10 +2433,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 size = status; response->mutable_configuration()->Resize(size, 0); @@ -2532,10 +2445,9 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); return ::grpc::Status::OK; } @@ -2558,9 +2470,8 @@ namespace nidcpower_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2599,9 +2510,8 @@ namespace nidcpower_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2631,9 +2541,8 @@ namespace nidcpower_grpc { ViInt32 actual_count {}; auto status = library_->FetchMultiple(vi, channel_name, timeout, count, voltage_measurements, current_measurements, in_compliance.data(), &actual_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(in_compliance, response->mutable_in_compliance()); response->set_actual_count(actual_count); @@ -2659,9 +2568,8 @@ namespace nidcpower_grpc { ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2686,9 +2594,8 @@ namespace nidcpower_grpc { ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2713,9 +2620,8 @@ namespace nidcpower_grpc { ViInt64 attribute_value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2740,9 +2646,8 @@ namespace nidcpower_grpc { ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2767,9 +2672,8 @@ namespace nidcpower_grpc { ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); @@ -2795,10 +2699,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string attribute_value; @@ -2810,10 +2713,9 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); @@ -2839,10 +2741,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string channel_name; @@ -2854,10 +2755,9 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_channel_name(channel_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); @@ -2883,10 +2783,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetChannelNameFromString(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string channel_name; @@ -2898,10 +2797,9 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_channel_name(channel_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); @@ -2926,10 +2824,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; ViStatus code {}; @@ -2937,15 +2834,14 @@ namespace nidcpower_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &code, buffer_size, description.data()); + status = library_->GetError(vi, &code, buffer_size, (ViChar*)description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_code(code); response->set_description(description); @@ -2975,9 +2871,8 @@ namespace nidcpower_grpc { ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -3004,9 +2899,8 @@ namespace nidcpower_grpc { ViReal64 temperature {}; auto status = library_->GetExtCalLastTemp(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -3029,9 +2923,8 @@ namespace nidcpower_grpc { ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_months(months); return ::grpc::Status::OK; @@ -3054,10 +2947,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string coercion_record; @@ -3069,10 +2961,9 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); @@ -3097,10 +2988,9 @@ namespace nidcpower_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string interchange_warning; @@ -3112,10 +3002,9 @@ namespace nidcpower_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); @@ -3144,9 +3033,8 @@ namespace nidcpower_grpc { ViInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -3173,9 +3061,8 @@ namespace nidcpower_grpc { ViReal64 temperature {}; auto status = library_->GetSelfCalLastTemp(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -3199,9 +3086,8 @@ namespace nidcpower_grpc { auto configuration = const_cast(reinterpret_cast(request->configuration().data())); auto status = library_->ImportAttributeConfigurationBuffer(vi, size, configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3223,9 +3109,8 @@ namespace nidcpower_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3257,9 +3142,8 @@ namespace nidcpower_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -3284,9 +3168,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3325,9 +3208,8 @@ namespace nidcpower_grpc { ViReal64 measurement {}; auto status = library_->Measure(vi, channel_name, measurement_type, &measurement); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_measurement(measurement); return ::grpc::Status::OK; @@ -3351,9 +3233,8 @@ namespace nidcpower_grpc { ViBoolean in_compliance {}; auto status = library_->QueryInCompliance(vi, channel_name, &in_compliance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_in_compliance(in_compliance); return ::grpc::Status::OK; @@ -3378,9 +3259,8 @@ namespace nidcpower_grpc { ViReal64 max_current_limit {}; auto status = library_->QueryMaxCurrentLimit(vi, channel_name, voltage_level, &max_current_limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_max_current_limit(max_current_limit); return ::grpc::Status::OK; @@ -3405,9 +3285,8 @@ namespace nidcpower_grpc { ViReal64 max_voltage_level {}; auto status = library_->QueryMaxVoltageLevel(vi, channel_name, current_limit, &max_voltage_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_max_voltage_level(max_voltage_level); return ::grpc::Status::OK; @@ -3432,9 +3311,8 @@ namespace nidcpower_grpc { ViReal64 min_current_limit {}; auto status = library_->QueryMinCurrentLimit(vi, channel_name, voltage_level, &min_current_limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_min_current_limit(min_current_limit); return ::grpc::Status::OK; @@ -3474,9 +3352,8 @@ namespace nidcpower_grpc { ViBoolean in_state {}; auto status = library_->QueryOutputState(vi, channel_name, output_state, &in_state); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_in_state(in_state); return ::grpc::Status::OK; @@ -3499,9 +3376,8 @@ namespace nidcpower_grpc { ViReal64 temperature {}; auto status = library_->ReadCurrentTemperature(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -3523,9 +3399,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3546,9 +3421,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3569,9 +3443,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3592,9 +3465,8 @@ namespace nidcpower_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3617,9 +3489,8 @@ namespace nidcpower_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); @@ -3646,9 +3517,8 @@ namespace nidcpower_grpc { std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -3688,9 +3558,8 @@ namespace nidcpower_grpc { auto status = library_->SendSoftwareEdgeTrigger(vi, trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3714,9 +3583,8 @@ namespace nidcpower_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3755,9 +3623,8 @@ namespace nidcpower_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3781,9 +3648,8 @@ namespace nidcpower_grpc { ViInt64 attribute_value = request->attribute_value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3822,9 +3688,8 @@ namespace nidcpower_grpc { auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3849,9 +3714,8 @@ namespace nidcpower_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3875,9 +3739,8 @@ namespace nidcpower_grpc { auto attribute_value = request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3913,9 +3776,8 @@ namespace nidcpower_grpc { auto status = library_->SetSequence(vi, channel_name, values, source_delays, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3953,9 +3815,8 @@ namespace nidcpower_grpc { ViReal64 timeout = request->timeout(); auto status = library_->WaitForEvent(vi, event_id, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidigitalpattern/nidigitalpattern_service.cpp b/generated/nidigitalpattern/nidigitalpattern_service.cpp index 463690485..812d28bed 100644 --- a/generated/nidigitalpattern/nidigitalpattern_service.cpp +++ b/generated/nidigitalpattern/nidigitalpattern_service.cpp @@ -66,9 +66,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -89,9 +88,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AbortKeepAlive(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -118,9 +116,8 @@ namespace nidigitalpattern_grpc { auto initial_state_tristate_pins = request->initial_state_tristate_pins().c_str(); auto status = library_->ApplyLevelsAndTiming(vi, site_list, levels_sheet, timing_sheet, initial_state_high_pins, initial_state_low_pins, initial_state_tristate_pins); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -144,9 +141,8 @@ namespace nidigitalpattern_grpc { auto offsets = const_cast(request->offsets().data()); auto status = library_->ApplyTDROffsets(vi, channel_list, num_offsets, offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -172,9 +168,8 @@ namespace nidigitalpattern_grpc { ViReal64 timeout = request->timeout(); auto status = library_->BurstPattern(vi, site_list, start_label, select_digital_function, wait_until_done, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -206,9 +201,8 @@ namespace nidigitalpattern_grpc { ViReal64 timeout = request->timeout(); auto status = library_->BurstPatternSynchronized(session_count, sessions.data(), site_list, start_label, select_digital_function, wait_until_done, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -229,9 +223,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -253,9 +246,8 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); auto status = library_->ClockGeneratorAbort(vi, channel_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -279,9 +271,8 @@ namespace nidigitalpattern_grpc { ViBoolean select_digital_function = request->select_digital_function(); auto status = library_->ClockGeneratorGenerateClock(vi, channel_list, frequency, select_digital_function); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -303,9 +294,8 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); auto status = library_->ClockGeneratorInitiate(vi, channel_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -327,9 +317,8 @@ namespace nidigitalpattern_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -350,9 +339,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -377,9 +365,8 @@ namespace nidigitalpattern_grpc { ViReal64 vcom = request->vcom(); auto status = library_->ConfigureActiveLoadLevels(vi, channel_list, iol, ioh, vcom); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -402,9 +389,8 @@ namespace nidigitalpattern_grpc { ViInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureCycleNumberHistoryRAMTrigger(vi, cycle_number, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -443,9 +429,8 @@ namespace nidigitalpattern_grpc { auto status = library_->ConfigureDigitalEdgeConditionalJumpTrigger(vi, trigger_identifier, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -483,9 +468,8 @@ namespace nidigitalpattern_grpc { auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -507,9 +491,8 @@ namespace nidigitalpattern_grpc { ViInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureFirstFailureHistoryRAMTrigger(vi, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -546,9 +529,8 @@ namespace nidigitalpattern_grpc { auto status = library_->ConfigureHistoryRAMCyclesToAcquire(vi, cycles_to_acquire); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -570,9 +552,8 @@ namespace nidigitalpattern_grpc { auto site_list = request->site_list().c_str(); auto status = library_->ConfigurePatternBurstSites(vi, site_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -597,9 +578,8 @@ namespace nidigitalpattern_grpc { ViInt32 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigurePatternLabelHistoryRAMTrigger(vi, label, vector_offset, cycle_offset, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -621,9 +601,8 @@ namespace nidigitalpattern_grpc { auto label = request->label().c_str(); auto status = library_->ConfigureStartLabel(vi, label); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -645,9 +624,8 @@ namespace nidigitalpattern_grpc { auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->ConfigureSoftwareEdgeConditionalJumpTrigger(vi, trigger_identifier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -668,9 +646,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -708,9 +685,8 @@ namespace nidigitalpattern_grpc { auto status = library_->ConfigureTerminationMode(vi, channel_list, mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -734,9 +710,8 @@ namespace nidigitalpattern_grpc { ViReal64 strobe_edge = request->strobe_edge(); auto status = library_->ConfigureTimeSetCompareEdgesStrobe(vi, pin_list, time_set_name, strobe_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -761,9 +736,8 @@ namespace nidigitalpattern_grpc { ViReal64 strobe2_edge = request->strobe2_edge(); auto status = library_->ConfigureTimeSetCompareEdgesStrobe2x(vi, pin_list, time_set_name, strobe_edge, strobe2_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -806,9 +780,8 @@ namespace nidigitalpattern_grpc { ViReal64 drive_off_edge = request->drive_off_edge(); auto status = library_->ConfigureTimeSetDriveEdges(vi, pin_list, time_set_name, format, drive_on_edge, drive_data_edge, drive_return_edge, drive_off_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -853,9 +826,8 @@ namespace nidigitalpattern_grpc { ViReal64 drive_return2_edge = request->drive_return2_edge(); auto status = library_->ConfigureTimeSetDriveEdges2x(vi, pin_list, time_set_name, format, drive_on_edge, drive_data_edge, drive_return_edge, drive_off_edge, drive_data2_edge, drive_return2_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -894,9 +866,8 @@ namespace nidigitalpattern_grpc { auto status = library_->ConfigureTimeSetDriveFormat(vi, pin_list, time_set_name, drive_format); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -936,9 +907,8 @@ namespace nidigitalpattern_grpc { ViReal64 time = request->time(); auto status = library_->ConfigureTimeSetEdge(vi, pin_list, time_set_name, edge, time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -962,9 +932,8 @@ namespace nidigitalpattern_grpc { ViInt32 edge_multiplier = request->edge_multiplier(); auto status = library_->ConfigureTimeSetEdgeMultiplier(vi, pin_list, time_set_name, edge_multiplier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -987,9 +956,8 @@ namespace nidigitalpattern_grpc { ViReal64 period = request->period(); auto status = library_->ConfigureTimeSetPeriod(vi, time_set_name, period); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1016,9 +984,8 @@ namespace nidigitalpattern_grpc { ViReal64 vterm = request->vterm(); auto status = library_->ConfigureVoltageLevels(vi, channel_list, vil, vih, vol, voh, vterm); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1041,9 +1008,8 @@ namespace nidigitalpattern_grpc { auto waveform_file_path = request->waveform_file_path().c_str(); auto status = library_->CreateCaptureWaveformFromFileDigicapture(vi, waveform_name, waveform_file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1066,9 +1032,8 @@ namespace nidigitalpattern_grpc { auto waveform_name = request->waveform_name().c_str(); auto status = library_->CreateCaptureWaveformParallel(vi, pin_list, waveform_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1108,9 +1073,8 @@ namespace nidigitalpattern_grpc { auto status = library_->CreateCaptureWaveformSerial(vi, pin_list, waveform_name, sample_width, bit_order); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1132,9 +1096,8 @@ namespace nidigitalpattern_grpc { ViInt32 num_sites = request->num_sites(); auto status = library_->CreateChannelMap(vi, num_sites); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1158,9 +1121,8 @@ namespace nidigitalpattern_grpc { ViBoolean write_waveform_data = request->write_waveform_data(); auto status = library_->CreateSourceWaveformFromFileTDMS(vi, waveform_name, waveform_file_path, write_waveform_data); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1183,9 +1145,8 @@ namespace nidigitalpattern_grpc { auto system_pin_list = request->system_pin_list().c_str(); auto status = library_->CreatePinMap(vi, dut_pin_list, system_pin_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1208,9 +1169,8 @@ namespace nidigitalpattern_grpc { auto pin_list = request->pin_list().c_str(); auto status = library_->CreatePinGroup(vi, pin_group_name, pin_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1249,9 +1209,8 @@ namespace nidigitalpattern_grpc { auto status = library_->CreateSourceWaveformParallel(vi, pin_list, waveform_name, data_mapping); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1307,9 +1266,8 @@ namespace nidigitalpattern_grpc { auto status = library_->CreateSourceWaveformSerial(vi, pin_list, waveform_name, data_mapping, sample_width, bit_order); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1331,9 +1289,8 @@ namespace nidigitalpattern_grpc { auto name = request->name().c_str(); auto status = library_->CreateTimeSet(vi, name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1354,9 +1311,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DeleteAllTimeSets(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1378,9 +1334,8 @@ namespace nidigitalpattern_grpc { auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->DisableConditionalJumpTrigger(vi, trigger_identifier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1402,9 +1357,8 @@ namespace nidigitalpattern_grpc { auto site_list = request->site_list().c_str(); auto status = library_->DisableSites(vi, site_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1425,9 +1379,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1456,9 +1409,8 @@ namespace nidigitalpattern_grpc { ViSession sync_session = session_repository_->access_session(sync_session_grpc_session.id(), sync_session_grpc_session.name()); auto status = library_->EnableMatchFailCombination(session_count, sessions.data(), sync_session); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, sync_session); + return ConvertApiErrorStatusForViSession(status, sync_session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1480,9 +1432,8 @@ namespace nidigitalpattern_grpc { auto site_list = request->site_list().c_str(); auto status = library_->EnableSites(vi, site_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1503,9 +1454,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->EndChannelMap(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1528,9 +1478,8 @@ namespace nidigitalpattern_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -1571,9 +1520,8 @@ namespace nidigitalpattern_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1600,10 +1548,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_samples_per_waveform {}; while (true) { auto status = library_->FetchCaptureWaveformU32(vi, site_list, waveform_name, samples_to_read, timeout, 0, nullptr, &actual_num_waveforms, &actual_samples_per_waveform); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_data()->Resize(actual_num_waveforms, 0); ViUInt32* data = reinterpret_cast(response->mutable_data()->mutable_data()); auto data_buffer_size = actual_num_waveforms; @@ -1612,10 +1559,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_data()->Resize(actual_num_waveforms, 0); response->set_actual_num_waveforms(actual_num_waveforms); @@ -1647,9 +1593,8 @@ namespace nidigitalpattern_grpc { ViInt32 num_dut_cycles {}; auto status = library_->FetchHistoryRAMCycleInformation(vi, site, sample_index, &pattern_index, &time_set_index, &vector_number, &cycle_number, &num_dut_cycles); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_pattern_index(pattern_index); response->set_time_set_index(time_set_index); @@ -1680,10 +1625,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_pin_data {}; while (true) { auto status = library_->FetchHistoryRAMCyclePinData(vi, site, pin_list, sample_index, dut_cycle_index, 0, nullptr, nullptr, nullptr, &actual_num_pin_data); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::string expected_pin_states(actual_num_pin_data, '\0'); std::string actual_pin_states(actual_num_pin_data, '\0'); std::vector per_pin_pass_fail(actual_num_pin_data, ViBoolean()); @@ -1693,10 +1637,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); CopyBytesToEnums(expected_pin_states, response->mutable_expected_pin_states()); response->set_expected_pin_states_raw(expected_pin_states); @@ -1730,9 +1673,8 @@ namespace nidigitalpattern_grpc { ViInt64 scan_cycle_number {}; auto status = library_->FetchHistoryRAMScanCycleNumber(vi, site, sample_index, &scan_cycle_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_scan_cycle_number(scan_cycle_number); return ::grpc::Status::OK; @@ -1770,9 +1712,8 @@ namespace nidigitalpattern_grpc { auto status = library_->FrequencyCounterConfigureMeasurementMode(vi, measurement_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1795,9 +1736,8 @@ namespace nidigitalpattern_grpc { ViReal64 measurement_time = request->measurement_time(); auto status = library_->FrequencyCounterConfigureMeasurementTime(vi, channel_list, measurement_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1820,10 +1760,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_frequencies {}; while (true) { auto status = library_->FrequencyCounterMeasureFrequency(vi, channel_list, 0, nullptr, &actual_num_frequencies); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_frequencies()->Resize(actual_num_frequencies, 0); ViReal64* frequencies = response->mutable_frequencies()->mutable_data(); auto frequencies_buffer_size = actual_num_frequencies; @@ -1832,10 +1771,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_frequencies()->Resize(actual_num_frequencies, 0); response->set_actual_num_frequencies(actual_num_frequencies); @@ -1862,9 +1800,8 @@ namespace nidigitalpattern_grpc { ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1889,9 +1826,8 @@ namespace nidigitalpattern_grpc { ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1916,9 +1852,8 @@ namespace nidigitalpattern_grpc { ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1943,9 +1878,8 @@ namespace nidigitalpattern_grpc { ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1970,9 +1904,8 @@ namespace nidigitalpattern_grpc { ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_list, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); @@ -1998,10 +1931,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string value; @@ -2013,10 +1945,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -2042,10 +1973,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 name_buffer_size = status; std::string name; @@ -2057,10 +1987,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -2086,10 +2015,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetChannelNameFromString(vi, indices, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 name_buffer_size = status; std::string names; @@ -2101,10 +2029,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_names(names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_names())); @@ -2129,10 +2056,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -2145,10 +2071,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -2175,10 +2100,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_read {}; while (true) { auto status = library_->GetFailCount(vi, channel_list, 0, nullptr, &actual_num_read); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_failure_count()->Resize(actual_num_read, 0); ViInt64* failure_count = response->mutable_failure_count()->mutable_data(); auto buffer_size = actual_num_read; @@ -2187,10 +2111,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_failure_count()->Resize(actual_num_read, 0); response->set_actual_num_read(actual_num_read); @@ -2216,9 +2139,8 @@ namespace nidigitalpattern_grpc { ViInt64 sample_count {}; auto status = library_->GetHistoryRAMSampleCount(vi, site, &sample_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_sample_count(sample_count); return ::grpc::Status::OK; @@ -2242,10 +2164,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_pins {}; while (true) { auto status = library_->GetPatternPinIndexes(vi, start_label, 0, nullptr, &actual_num_pins); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_pin_indexes()->Resize(actual_num_pins, 0); ViInt32* pin_indexes = reinterpret_cast(response->mutable_pin_indexes()->mutable_data()); auto pin_indexes_buffer_size = actual_num_pins; @@ -2254,10 +2175,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_pin_indexes()->Resize(actual_num_pins, 0); response->set_actual_num_pins(actual_num_pins); @@ -2283,10 +2203,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetPatternName(vi, pattern_index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 name_buffer_size = status; std::string name; @@ -2298,10 +2217,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -2327,10 +2245,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetPatternPinList(vi, start_label, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 pin_list_buffer_size = status; std::string pin_list; @@ -2342,10 +2259,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_pin_list(pin_list); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_pin_list())); @@ -2371,10 +2287,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetPinName(vi, pin_index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 name_buffer_size = status; std::string name; @@ -2386,10 +2301,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -2415,10 +2329,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_values {}; while (true) { auto status = library_->GetPinResultsPinInformation(vi, channel_list, 0, nullptr, nullptr, nullptr, &actual_num_values); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_pin_indexes()->Resize(actual_num_values, 0); ViInt32* pin_indexes = reinterpret_cast(response->mutable_pin_indexes()->mutable_data()); response->mutable_site_numbers()->Resize(actual_num_values, 0); @@ -2431,10 +2344,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_pin_indexes()->Resize(actual_num_values, 0); response->mutable_site_numbers()->Resize(actual_num_values, 0); @@ -2462,10 +2374,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_sites {}; while (true) { auto status = library_->GetSitePassFail(vi, site_list, 0, nullptr, &actual_num_sites); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::vector pass_fail(actual_num_sites, ViBoolean()); auto pass_fail_buffer_size = actual_num_sites; status = library_->GetSitePassFail(vi, site_list, pass_fail_buffer_size, pass_fail.data(), &actual_num_sites); @@ -2473,10 +2384,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); convert_to_grpc(pass_fail, response->mutable_pass_fail()); response->mutable_pass_fail()->Resize(actual_num_sites, 0); @@ -2519,10 +2429,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_site_numbers {}; while (true) { auto status = library_->GetSiteResultsSiteNumbers(vi, site_list, site_result_type, 0, nullptr, &actual_num_site_numbers); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_site_numbers()->Resize(actual_num_site_numbers, 0); ViInt32* site_numbers = reinterpret_cast(response->mutable_site_numbers()->mutable_data()); auto site_numbers_buffer_size = actual_num_site_numbers; @@ -2531,10 +2440,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_site_numbers()->Resize(actual_num_site_numbers, 0); response->set_actual_num_site_numbers(actual_num_site_numbers); @@ -2561,9 +2469,8 @@ namespace nidigitalpattern_grpc { ViInt32 format {}; auto status = library_->GetTimeSetDriveFormat(vi, pin, time_set_name, &format); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_format(static_cast(format)); response->set_format_raw(format); @@ -2605,9 +2512,8 @@ namespace nidigitalpattern_grpc { ViReal64 time {}; auto status = library_->GetTimeSetEdge(vi, pin, time_set_name, edge, &time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_time(time); return ::grpc::Status::OK; @@ -2632,9 +2538,8 @@ namespace nidigitalpattern_grpc { ViInt32 edge_multiplier {}; auto status = library_->GetTimeSetEdgeMultiplier(vi, pin, time_set_name, &edge_multiplier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_edge_multiplier(edge_multiplier); return ::grpc::Status::OK; @@ -2658,10 +2563,9 @@ namespace nidigitalpattern_grpc { while (true) { auto status = library_->GetTimeSetName(vi, time_set_index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 name_buffer_size = status; std::string name; @@ -2673,10 +2577,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -2702,9 +2605,8 @@ namespace nidigitalpattern_grpc { ViReal64 period {}; auto status = library_->GetTimeSetPeriod(vi, time_set_name, &period); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_period(period); return ::grpc::Status::OK; @@ -2736,9 +2638,8 @@ namespace nidigitalpattern_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2774,9 +2675,8 @@ namespace nidigitalpattern_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2801,9 +2701,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2825,9 +2724,8 @@ namespace nidigitalpattern_grpc { ViBoolean done {}; auto status = library_->IsDone(vi, &done); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_done(done); return ::grpc::Status::OK; @@ -2851,9 +2749,8 @@ namespace nidigitalpattern_grpc { ViBoolean enable {}; auto status = library_->IsSiteEnabled(vi, site, &enable); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_enable(enable); return ::grpc::Status::OK; @@ -2876,9 +2773,8 @@ namespace nidigitalpattern_grpc { auto file_path = request->file_path().c_str(); auto status = library_->LoadLevels(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2900,9 +2796,8 @@ namespace nidigitalpattern_grpc { auto file_path = request->file_path().c_str(); auto status = library_->LoadPattern(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2924,9 +2819,8 @@ namespace nidigitalpattern_grpc { auto file_path = request->file_path().c_str(); auto status = library_->LoadPinMap(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2948,9 +2842,8 @@ namespace nidigitalpattern_grpc { auto file_path = request->file_path().c_str(); auto status = library_->LoadSpecifications(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2972,9 +2865,8 @@ namespace nidigitalpattern_grpc { auto file_path = request->file_path().c_str(); auto status = library_->LoadTiming(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2998,9 +2890,8 @@ namespace nidigitalpattern_grpc { auto channel = request->channel().c_str(); auto status = library_->MapPinToChannel(vi, pin, site, channel); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3039,9 +2930,8 @@ namespace nidigitalpattern_grpc { auto status = library_->PPMUConfigureApertureTime(vi, channel_list, aperture_time, units); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3064,9 +2954,8 @@ namespace nidigitalpattern_grpc { ViReal64 current_level = request->current_level(); auto status = library_->PPMUConfigureCurrentLevel(vi, channel_list, current_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3089,9 +2978,8 @@ namespace nidigitalpattern_grpc { ViReal64 range = request->range(); auto status = library_->PPMUConfigureCurrentLevelRange(vi, channel_list, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3130,9 +3018,8 @@ namespace nidigitalpattern_grpc { ViReal64 limit = request->limit(); auto status = library_->PPMUConfigureCurrentLimit(vi, channel_list, behavior, limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3155,9 +3042,8 @@ namespace nidigitalpattern_grpc { ViReal64 range = request->range(); auto status = library_->PPMUConfigureCurrentLimitRange(vi, channel_list, range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3195,9 +3081,8 @@ namespace nidigitalpattern_grpc { auto status = library_->PPMUConfigureOutputFunction(vi, channel_list, output_function); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3220,9 +3105,8 @@ namespace nidigitalpattern_grpc { ViReal64 voltage_level = request->voltage_level(); auto status = library_->PPMUConfigureVoltageLevel(vi, channel_list, voltage_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3246,9 +3130,8 @@ namespace nidigitalpattern_grpc { ViReal64 upper_voltage_limit = request->upper_voltage_limit(); auto status = library_->PPMUConfigureVoltageLimits(vi, channel_list, lower_voltage_limit, upper_voltage_limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3287,10 +3170,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_read {}; while (true) { auto status = library_->PPMUMeasure(vi, channel_list, measurement_type, 0, nullptr, &actual_num_read); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_measurements()->Resize(actual_num_read, 0); ViReal64* measurements = response->mutable_measurements()->mutable_data(); auto buffer_size = actual_num_read; @@ -3299,10 +3181,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_measurements()->Resize(actual_num_read, 0); response->set_actual_num_read(actual_num_read); @@ -3327,9 +3208,8 @@ namespace nidigitalpattern_grpc { auto channel_list = request->channel_list().c_str(); auto status = library_->PPMUSource(vi, channel_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3352,9 +3232,8 @@ namespace nidigitalpattern_grpc { ViBoolean value {}; auto status = library_->ReadSequencerFlag(vi, flag, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -3378,9 +3257,8 @@ namespace nidigitalpattern_grpc { ViInt32 value {}; auto status = library_->ReadSequencerRegister(vi, reg, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -3404,10 +3282,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_read {}; while (true) { auto status = library_->ReadStatic(vi, channel_list, 0, nullptr, &actual_num_read); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::string data(actual_num_read, '\0'); auto buffer_size = actual_num_read; status = library_->ReadStatic(vi, channel_list, buffer_size, (ViUInt8*)data.data(), &actual_num_read); @@ -3415,10 +3292,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); CopyBytesToEnums(data, response->mutable_data()); response->set_data_raw(data); @@ -3444,9 +3320,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3469,9 +3344,8 @@ namespace nidigitalpattern_grpc { ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3492,9 +3366,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3532,9 +3405,8 @@ namespace nidigitalpattern_grpc { auto status = library_->SelectFunction(vi, channel_list, function); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3555,9 +3427,8 @@ namespace nidigitalpattern_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCalibrate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3580,9 +3451,8 @@ namespace nidigitalpattern_grpc { std::string test_message(2048 - 1, '\0'); auto status = library_->SelfTest(vi, &test_result, (ViChar*)test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_test_result(test_result); response->set_test_message(test_message); @@ -3623,9 +3493,8 @@ namespace nidigitalpattern_grpc { auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_identifier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3649,9 +3518,8 @@ namespace nidigitalpattern_grpc { ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3690,9 +3558,8 @@ namespace nidigitalpattern_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3716,9 +3583,8 @@ namespace nidigitalpattern_grpc { ViInt64 value = request->value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3742,9 +3608,8 @@ namespace nidigitalpattern_grpc { ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(vi, channel_name, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3769,9 +3634,8 @@ namespace nidigitalpattern_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_list, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3795,9 +3659,8 @@ namespace nidigitalpattern_grpc { auto value = request->value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3821,10 +3684,9 @@ namespace nidigitalpattern_grpc { ViInt32 actual_num_offsets {}; while (true) { auto status = library_->TDR(vi, channel_list, apply_offsets, 0, nullptr, &actual_num_offsets); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_offsets()->Resize(actual_num_offsets, 0); ViReal64* offsets = response->mutable_offsets()->mutable_data(); auto offsets_buffer_size = actual_num_offsets; @@ -3833,10 +3695,9 @@ namespace nidigitalpattern_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_offsets()->Resize(actual_num_offsets, 0); response->set_actual_num_offsets(actual_num_offsets); @@ -3861,9 +3722,8 @@ namespace nidigitalpattern_grpc { ViBoolean unload_keep_alive_pattern = request->unload_keep_alive_pattern(); auto status = library_->UnloadAllPatterns(vi, unload_keep_alive_pattern); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3885,9 +3745,8 @@ namespace nidigitalpattern_grpc { auto file_path = request->file_path().c_str(); auto status = library_->UnloadSpecifications(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3909,9 +3768,8 @@ namespace nidigitalpattern_grpc { ViReal64 timeout = request->timeout(); auto status = library_->WaitUntilDone(vi, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3934,9 +3792,8 @@ namespace nidigitalpattern_grpc { ViBoolean value = request->value(); auto status = library_->WriteSequencerFlag(vi, flag, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3965,9 +3822,8 @@ namespace nidigitalpattern_grpc { ViBoolean value = request->value(); auto status = library_->WriteSequencerFlagSynchronized(session_count, sessions.data(), flag, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3990,9 +3846,8 @@ namespace nidigitalpattern_grpc { ViInt32 value = request->value(); auto status = library_->WriteSequencerRegister(vi, reg, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4016,9 +3871,8 @@ namespace nidigitalpattern_grpc { auto waveform_data = const_cast(reinterpret_cast(request->waveform_data().data())); auto status = library_->WriteSourceWaveformBroadcastU32(vi, waveform_name, waveform_size, waveform_data); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4041,9 +3895,8 @@ namespace nidigitalpattern_grpc { auto waveform_file_path = request->waveform_file_path().c_str(); auto status = library_->WriteSourceWaveformDataFromFileTDMS(vi, waveform_name, waveform_file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4081,9 +3934,8 @@ namespace nidigitalpattern_grpc { auto status = library_->WriteStatic(vi, channel_list, state); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4109,9 +3961,8 @@ namespace nidigitalpattern_grpc { auto waveform_data = const_cast(reinterpret_cast(request->waveform_data().data())); auto status = library_->WriteSourceWaveformSiteUniqueU32(vi, site_list, waveform_name, num_waveforms, samples_per_waveform, waveform_data); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nidmm/nidmm_service.cpp b/generated/nidmm/nidmm_service.cpp index 5e6624058..3051bade7 100644 --- a/generated/nidmm/nidmm_service.cpp +++ b/generated/nidmm/nidmm_service.cpp @@ -72,9 +72,8 @@ namespace nidmm_grpc { auto status = library_->Control4022(resource_name, configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -95,9 +94,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -121,9 +119,8 @@ namespace nidmm_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -162,9 +159,8 @@ namespace nidmm_grpc { auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -203,9 +199,8 @@ namespace nidmm_grpc { auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -230,9 +225,8 @@ namespace nidmm_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -256,9 +250,8 @@ namespace nidmm_grpc { ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -279,9 +272,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -302,9 +294,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -326,9 +317,8 @@ namespace nidmm_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -351,9 +341,8 @@ namespace nidmm_grpc { ViReal64 ac_maximum_frequency_hz = request->ac_maximum_frequency_hz(); auto status = library_->ConfigureACBandwidth(vi, ac_minimum_frequency_hz, ac_maximum_frequency_hz); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -375,9 +364,8 @@ namespace nidmm_grpc { ViInt32 adc_calibration = request->adc_calibration(); auto status = library_->ConfigureADCCalibration(vi, adc_calibration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -399,9 +387,8 @@ namespace nidmm_grpc { ViInt32 auto_zero_mode = request->auto_zero_mode(); auto status = library_->ConfigureAutoZeroMode(vi, auto_zero_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -423,9 +410,8 @@ namespace nidmm_grpc { ViInt32 cable_comp_type = request->cable_comp_type(); auto status = library_->ConfigureCableCompType(vi, cable_comp_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -447,9 +433,8 @@ namespace nidmm_grpc { ViReal64 current_source = request->current_source(); auto status = library_->ConfigureCurrentSource(vi, current_source); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -471,9 +456,8 @@ namespace nidmm_grpc { ViReal64 fixed_reference_junction = request->fixed_reference_junction(); auto status = library_->ConfigureFixedRefJunction(vi, fixed_reference_junction); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -510,9 +494,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureFrequencyVoltageRange(vi, voltage_range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -534,9 +517,8 @@ namespace nidmm_grpc { ViInt32 meas_complete_destination = request->meas_complete_destination(); auto status = library_->ConfigureMeasCompleteDest(vi, meas_complete_destination); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -575,9 +557,8 @@ namespace nidmm_grpc { ViReal64 resolution_absolute = request->resolution_absolute(); auto status = library_->ConfigureMeasurementAbsolute(vi, measurement_function, range, resolution_absolute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -599,9 +580,8 @@ namespace nidmm_grpc { ViInt32 meas_complete_slope = request->meas_complete_slope(); auto status = library_->ConfigureMeasCompleteSlope(vi, meas_complete_slope); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -640,9 +620,8 @@ namespace nidmm_grpc { ViReal64 resolution_digits = request->resolution_digits(); auto status = library_->ConfigureMeasurementDigits(vi, measurement_function, range, resolution_digits); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -727,9 +706,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureMultiPoint(vi, trigger_count, sample_count, sample_trigger, sample_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -766,9 +744,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureOffsetCompOhms(vi, offset_comp_ohms); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -791,9 +768,8 @@ namespace nidmm_grpc { ViReal64 susceptance = request->susceptance(); auto status = library_->ConfigureOpenCableCompValues(vi, conductance, susceptance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -830,9 +806,8 @@ namespace nidmm_grpc { auto status = library_->ConfigurePowerLineFrequency(vi, power_line_frequency_hz); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -855,9 +830,8 @@ namespace nidmm_grpc { ViReal64 reactance = request->reactance(); auto status = library_->ConfigureShortCableCompValues(vi, resistance, reactance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -881,9 +855,8 @@ namespace nidmm_grpc { ViReal64 rtd_c = request->rtd_c(); auto status = library_->ConfigureRTDCustom(vi, rtd_a, rtd_b, rtd_c); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -921,9 +894,8 @@ namespace nidmm_grpc { ViReal64 rtd_resistance = request->rtd_resistance(); auto status = library_->ConfigureRTDType(vi, rtd_type, rtd_resistance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -960,9 +932,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureSampleTriggerSlope(vi, sample_trigger_slope); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -986,9 +957,8 @@ namespace nidmm_grpc { ViReal64 thermistor_c = request->thermistor_c(); auto status = library_->ConfigureThermistorCustom(vi, thermistor_a, thermistor_b, thermistor_c); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1041,9 +1011,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureThermocouple(vi, thermocouple_type, reference_junction_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1065,9 +1034,8 @@ namespace nidmm_grpc { ViInt32 thermistor_type = request->thermistor_type(); auto status = library_->ConfigureThermistorType(vi, thermistor_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1089,9 +1057,8 @@ namespace nidmm_grpc { ViInt32 transducer_type = request->transducer_type(); auto status = library_->ConfigureTransducerType(vi, transducer_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1144,9 +1111,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureTrigger(vi, trigger_source, trigger_delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1183,9 +1149,8 @@ namespace nidmm_grpc { auto status = library_->ConfigureTriggerSlope(vi, trigger_slope); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1225,9 +1190,8 @@ namespace nidmm_grpc { ViInt32 waveform_points = request->waveform_points(); auto status = library_->ConfigureWaveformAcquisition(vi, measurement_function, range, rate, waveform_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1249,9 +1213,8 @@ namespace nidmm_grpc { ViInt32 waveform_coupling = request->waveform_coupling(); auto status = library_->ConfigureWaveformCoupling(vi, waveform_coupling); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1288,9 +1251,8 @@ namespace nidmm_grpc { auto status = library_->Control(vi, control_action); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1311,9 +1273,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1335,10 +1296,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 size = status; std::string configuration(size, '\0'); @@ -1347,10 +1307,9 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_configuration(configuration); return ::grpc::Status::OK; @@ -1374,9 +1333,8 @@ namespace nidmm_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1414,9 +1372,8 @@ namespace nidmm_grpc { ViReal64 reading {}; auto status = library_->Fetch(vi, maximum_time, &reading); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_reading(reading); return ::grpc::Status::OK; @@ -1458,9 +1415,8 @@ namespace nidmm_grpc { ViInt32 actual_number_of_points {}; auto status = library_->FetchMultiPoint(vi, maximum_time, array_size, reading_array, &actual_number_of_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; @@ -1502,9 +1458,8 @@ namespace nidmm_grpc { ViInt32 actual_number_of_points {}; auto status = library_->FetchWaveform(vi, maximum_time, array_size, waveform_array, &actual_number_of_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; @@ -1528,9 +1483,8 @@ namespace nidmm_grpc { ViInt32 aperture_time_units {}; auto status = library_->GetApertureTimeInfo(vi, &aperture_time, &aperture_time_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); if(aperture_time == (int)aperture_time) { response->set_aperture_time(static_cast(static_cast(aperture_time))); @@ -1560,9 +1514,8 @@ namespace nidmm_grpc { ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -1587,9 +1540,8 @@ namespace nidmm_grpc { ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -1614,9 +1566,8 @@ namespace nidmm_grpc { ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -1641,9 +1592,8 @@ namespace nidmm_grpc { ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); @@ -1669,10 +1619,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string attribute_value; @@ -1684,10 +1633,9 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); @@ -1712,9 +1660,8 @@ namespace nidmm_grpc { ViReal64 actual_range {}; auto status = library_->GetAutoRangeValue(vi, &actual_range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_range(actual_range); return ::grpc::Status::OK; @@ -1757,9 +1704,8 @@ namespace nidmm_grpc { ViInt32 minute {}; auto status = library_->GetCalDateAndTime(vi, cal_type, &month, &day, &year, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_month(month); response->set_day(day); @@ -1787,10 +1733,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string channel_string; @@ -1802,10 +1747,9 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_channel_string(channel_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); @@ -1831,9 +1775,8 @@ namespace nidmm_grpc { ViReal64 temperature {}; auto status = library_->GetDevTemp(vi, options, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -1856,10 +1799,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; ViStatus error_code {}; @@ -1867,15 +1809,14 @@ namespace nidmm_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &error_code, buffer_size, description.data()); + status = library_->GetError(vi, &error_code, buffer_size, (ViChar*)description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_code(error_code); response->set_description(description); @@ -1902,10 +1843,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetErrorMessage(vi, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string error_message; @@ -1917,10 +1857,9 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -1945,9 +1884,8 @@ namespace nidmm_grpc { ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_months(months); return ::grpc::Status::OK; @@ -1986,9 +1924,8 @@ namespace nidmm_grpc { ViReal64 temperature {}; auto status = library_->GetLastCalTemp(vi, cal_type, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -2011,9 +1948,8 @@ namespace nidmm_grpc { ViReal64 period {}; auto status = library_->GetMeasurementPeriod(vi, &period); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_period(period); return ::grpc::Status::OK; @@ -2036,10 +1972,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string coercion_record; @@ -2051,10 +1986,9 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); @@ -2079,10 +2013,9 @@ namespace nidmm_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string interchange_warning; @@ -2094,10 +2027,9 @@ namespace nidmm_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); @@ -2122,9 +2054,8 @@ namespace nidmm_grpc { ViBoolean self_cal_supported {}; auto status = library_->GetSelfCalSupported(vi, &self_cal_supported); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_cal_supported(self_cal_supported); return ::grpc::Status::OK; @@ -2148,9 +2079,8 @@ namespace nidmm_grpc { ViInt8* configuration = (ViInt8*)request->configuration().c_str(); auto status = library_->ImportAttributeConfigurationBuffer(vi, size, configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2172,9 +2102,8 @@ namespace nidmm_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2205,9 +2134,8 @@ namespace nidmm_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2243,9 +2171,8 @@ namespace nidmm_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2270,9 +2197,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2293,9 +2219,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2318,9 +2243,8 @@ namespace nidmm_grpc { ViBoolean is_over_range {}; auto status = library_->IsOverRange(vi, measurement_value, &is_over_range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_is_over_range(is_over_range); return ::grpc::Status::OK; @@ -2344,9 +2268,8 @@ namespace nidmm_grpc { ViBoolean is_under_range {}; auto status = library_->IsUnderRange(vi, measurement_value, &is_under_range); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_is_under_range(is_under_range); return ::grpc::Status::OK; @@ -2370,9 +2293,8 @@ namespace nidmm_grpc { ViReal64 susceptance {}; auto status = library_->PerformOpenCableComp(vi, &conductance, &susceptance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_conductance(conductance); response->set_susceptance(susceptance); @@ -2397,9 +2319,8 @@ namespace nidmm_grpc { ViReal64 reactance {}; auto status = library_->PerformShortCableComp(vi, &resistance, &reactance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_resistance(resistance); response->set_reactance(reactance); @@ -2439,9 +2360,8 @@ namespace nidmm_grpc { ViReal64 reading {}; auto status = library_->Read(vi, maximum_time, &reading); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_reading(reading); return ::grpc::Status::OK; @@ -2483,9 +2403,8 @@ namespace nidmm_grpc { ViInt32 actual_number_of_points {}; auto status = library_->ReadMultiPoint(vi, maximum_time, array_size, reading_array, &actual_number_of_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; @@ -2509,9 +2428,8 @@ namespace nidmm_grpc { ViInt16 acquisition_status {}; auto status = library_->ReadStatus(vi, &acquisition_backlog, &acquisition_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_acquisition_backlog(acquisition_backlog); response->set_acquisition_status(static_cast(acquisition_status)); @@ -2555,9 +2473,8 @@ namespace nidmm_grpc { ViInt32 actual_number_of_points {}; auto status = library_->ReadWaveform(vi, maximum_time, array_size, waveform_array, &actual_number_of_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; @@ -2579,9 +2496,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2602,9 +2518,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2625,9 +2540,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2650,9 +2564,8 @@ namespace nidmm_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); @@ -2677,9 +2590,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2702,9 +2614,8 @@ namespace nidmm_grpc { std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -2728,9 +2639,8 @@ namespace nidmm_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SendSoftwareTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2754,9 +2664,8 @@ namespace nidmm_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2795,9 +2704,8 @@ namespace nidmm_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2836,9 +2744,8 @@ namespace nidmm_grpc { auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2863,9 +2770,8 @@ namespace nidmm_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2889,9 +2795,8 @@ namespace nidmm_grpc { ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifake/nifake_service.cpp b/generated/nifake/nifake_service.cpp index 12819bdc9..c53e9b388 100644 --- a/generated/nifake/nifake_service.cpp +++ b/generated/nifake/nifake_service.cpp @@ -66,9 +66,8 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -91,9 +90,8 @@ namespace nifake_grpc { auto delays = const_cast(request->delays().data()); auto status = library_->AcceptListOfDurationsInSeconds(vi, count, delays); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -120,9 +118,8 @@ namespace nifake_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); auto status = library_->AcceptViSessionArray(session_count, session_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -145,9 +142,8 @@ namespace nifake_grpc { auto u_int32_array = const_cast(reinterpret_cast(request->u_int32_array().data())); auto status = library_->AcceptViUInt32Array(vi, array_len, u_int32_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -170,9 +166,8 @@ namespace nifake_grpc { std::vector an_array(number_of_elements, ViBoolean()); auto status = library_->BoolArrayOutputFunction(vi, number_of_elements, an_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(an_array, response->mutable_an_array()); return ::grpc::Status::OK; @@ -196,9 +191,8 @@ namespace nifake_grpc { auto an_array = convert_from_grpc(request->an_array()); auto status = library_->BoolArrayInputFunction(vi, number_of_elements, an_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -220,9 +214,8 @@ namespace nifake_grpc { auto reserved = nullptr; auto status = library_->CommandWithReservedParam(vi, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -243,9 +236,8 @@ namespace nifake_grpc { auto list_attribute_ids = const_cast(reinterpret_cast(request->list_attribute_ids().data())); auto status = library_->CreateConfigurationList(number_of_list_attributes, list_attribute_ids); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -268,9 +260,8 @@ namespace nifake_grpc { auto numbers = const_cast(request->numbers().data()); auto status = library_->DoubleAllTheNums(vi, number_count, numbers); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -322,9 +313,8 @@ namespace nifake_grpc { auto status = library_->EnumInputFunctionWithDefaults(vi, a_turtle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -346,10 +336,9 @@ namespace nifake_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 size_in_bytes = status; std::string configuration(size_in_bytes, '\0'); @@ -358,10 +347,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_configuration(configuration); return ::grpc::Status::OK; @@ -388,9 +376,8 @@ namespace nifake_grpc { ViInt32 actual_number_of_samples {}; auto status = library_->FetchWaveform(vi, number_of_samples, waveform_data, &actual_number_of_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_number_of_samples(actual_number_of_samples); return ::grpc::Status::OK; @@ -413,9 +400,8 @@ namespace nifake_grpc { ViBoolean a_boolean {}; auto status = library_->GetABoolean(vi, &a_boolean); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_a_boolean(a_boolean); return ::grpc::Status::OK; @@ -438,9 +424,8 @@ namespace nifake_grpc { ViInt16 a_number {}; auto status = library_->GetANumber(vi, &a_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_a_number(a_number); return ::grpc::Status::OK; @@ -463,9 +448,8 @@ namespace nifake_grpc { std::string a_string(256 - 1, '\0'); auto status = library_->GetAStringOfFixedMaximumSize(vi, (ViChar*)a_string.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_a_string(a_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); @@ -487,9 +471,8 @@ namespace nifake_grpc { ViInt64 flags {}; auto status = library_->GetBitfieldAsEnumArray(&flags); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); if (flags & 0x1) response->add_flags_array(Bitfield::BITFIELD_FLAG_A); @@ -520,10 +503,9 @@ namespace nifake_grpc { while (true) { auto status = library_->GetAnIviDanceString(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string a_string; @@ -535,10 +517,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_a_string(a_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); @@ -571,9 +552,8 @@ namespace nifake_grpc { ViInt32 array_size = static_cast(request->array_lengths().size()); auto status = library_->UseATwoDimensionParameter(vi, array, array_lengths, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -596,10 +576,9 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistArray(vi, a_string, 0, nullptr, &actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_array_out()->Resize(actual_size, 0); ViInt32* array_out = reinterpret_cast(response->mutable_array_out()->mutable_data()); auto buffer_size = actual_size; @@ -608,10 +587,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_array_out()->Resize(actual_size, 0); response->set_actual_size(actual_size); @@ -636,10 +614,9 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistArrayOfCustomType(vi, 0, nullptr, &actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::vector array_out(actual_size, CustomStruct()); auto buffer_size = actual_size; status = library_->GetAnIviDanceWithATwistArrayOfCustomType(vi, buffer_size, array_out.data(), &actual_size); @@ -647,10 +624,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); convert_to_grpc(array_out, response->mutable_array_out()); { @@ -682,10 +658,9 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistArrayWithInputArray(data_in, array_size_in, 0, nullptr, &actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } response->mutable_array_out()->Resize(actual_size, 0); ViInt32* array_out = reinterpret_cast(response->mutable_array_out()->mutable_data()); auto buffer_size = actual_size; @@ -694,10 +669,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->mutable_array_out()->Resize(actual_size, 0); response->set_actual_size(actual_size); @@ -720,10 +694,9 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistByteArray(0, nullptr, &actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } std::string array_out(actual_size, '\0'); auto buffer_size = actual_size; status = library_->GetAnIviDanceWithATwistByteArray(buffer_size, (ViInt8*)array_out.data(), &actual_size); @@ -731,10 +704,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->set_array_out(array_out); response->mutable_array_out()->resize(actual_size); @@ -758,10 +730,9 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistString(0, nullptr, &actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } std::string array_out; if (actual_size > 0) { array_out.resize(actual_size - 1); @@ -772,10 +743,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->set_array_out(array_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_array_out())); @@ -799,10 +769,9 @@ namespace nifake_grpc { ViInt32 actual_size {}; while (true) { auto status = library_->GetAnIviDanceWithATwistStringStrlenBug(0, nullptr, &actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } std::string string_out; if (actual_size > 0) { string_out.resize(actual_size /* Workaround: strlen-bug */); @@ -813,10 +782,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->set_string_out(string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); @@ -842,9 +810,8 @@ namespace nifake_grpc { ViInt32 size_out {}; auto status = library_->GetArraySizeForCustomCode(vi, &size_out); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_size_out(size_out); return ::grpc::Status::OK; @@ -867,10 +834,9 @@ namespace nifake_grpc { while (true) { auto status = library_->GetArrayUsingIviDance(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 array_size = status; response->mutable_array_out()->Resize(array_size, 0); @@ -880,10 +846,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); return ::grpc::Status::OK; } @@ -907,9 +872,8 @@ namespace nifake_grpc { std::string u_int8_enum_array(array_len, '\0'); auto status = library_->GetArrayViUInt8WithEnum(vi, array_len, (ViUInt8*)u_int8_enum_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); CopyBytesToEnums(u_int8_enum_array, response->mutable_u_int8_enum_array()); response->set_u_int8_enum_array_raw(u_int8_enum_array); @@ -935,9 +899,8 @@ namespace nifake_grpc { ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -962,9 +925,8 @@ namespace nifake_grpc { ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -989,9 +951,8 @@ namespace nifake_grpc { ViInt64 attribute_value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -1016,9 +977,8 @@ namespace nifake_grpc { ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -1042,9 +1002,8 @@ namespace nifake_grpc { ViSession session_out {}; auto status = library_->GetAttributeViSession(vi, attribute_id, &session_out); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(session_out); response->mutable_session_out()->set_id(session_id); @@ -1070,10 +1029,9 @@ namespace nifake_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string attribute_value; @@ -1085,10 +1043,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); @@ -1118,9 +1075,8 @@ namespace nifake_grpc { ViInt32 minute {}; auto status = library_->GetCalDateAndTime(vi, cal_type, &month, &day, &year, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_month(month); response->set_day(day); @@ -1147,9 +1103,8 @@ namespace nifake_grpc { ViInt32 months {}; auto status = library_->GetCalInterval(vi, &months); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_months(months); return ::grpc::Status::OK; @@ -1172,9 +1127,8 @@ namespace nifake_grpc { CustomStruct cs {}; auto status = library_->GetCustomType(vi, &cs); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(cs, response->mutable_cs()); return ::grpc::Status::OK; @@ -1198,9 +1152,8 @@ namespace nifake_grpc { std::vector cs(number_of_elements, CustomStruct()); auto status = library_->GetCustomTypeArray(vi, number_of_elements, cs.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(cs, response->mutable_cs()); return ::grpc::Status::OK; @@ -1224,9 +1177,8 @@ namespace nifake_grpc { ViInt16 a_turtle {}; auto status = library_->GetEnumValue(vi, &a_quantity, &a_turtle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_a_quantity(a_quantity); response->set_a_turtle(static_cast(a_turtle)); @@ -1251,9 +1203,8 @@ namespace nifake_grpc { ViUInt8 a_uint8_number {}; auto status = library_->GetViUInt8(vi, &a_uint8_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_a_uint8_number(a_uint8_number); return ::grpc::Status::OK; @@ -1278,9 +1229,8 @@ namespace nifake_grpc { ViInt32* int32_array = reinterpret_cast(response->mutable_int32_array()->mutable_data()); auto status = library_->GetViInt32Array(vi, array_len, int32_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1304,9 +1254,8 @@ namespace nifake_grpc { ViUInt32* u_int32_array = reinterpret_cast(response->mutable_u_int32_array()->mutable_data()); auto status = library_->GetViUInt32Array(vi, array_len, u_int32_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1329,9 +1278,8 @@ namespace nifake_grpc { ViInt8* configuration = (ViInt8*)request->configuration().c_str(); auto status = library_->ImportAttributeConfigurationBuffer(vi, size_in_bytes, configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1363,9 +1311,8 @@ namespace nifake_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1399,9 +1346,8 @@ namespace nifake_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->CloseExtCal(id, 0); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1454,9 +1400,8 @@ namespace nifake_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1506,9 +1451,8 @@ namespace nifake_grpc { ViReal64* output_array_of_fixed_length = response->mutable_output_array_of_fixed_length()->mutable_data(); auto status = library_->MultipleArrayTypes(vi, output_array_size, output_array, output_array_of_fixed_length, input_array_sizes, input_array_of_floats, input_array_of_integers.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1547,9 +1491,8 @@ namespace nifake_grpc { auto status = library_->MultipleArraysSameSize(vi, values1, values2, values3, values4, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1598,9 +1541,8 @@ namespace nifake_grpc { auto status = library_->MultipleArraysSameSizeWithOptional(vi, values1, values2, values3, values4, values5.data(), size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1622,9 +1564,8 @@ namespace nifake_grpc { ViInt32 a_number = request->a_number(); auto status = library_->OneInputFunction(vi, a_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1687,9 +1628,8 @@ namespace nifake_grpc { auto a_string = request->a_string().c_str(); auto status = library_->ParametersAreMultipleTypes(vi, a_boolean, an_int32, an_int64, an_int_enum, a_float, a_float_enum, string_size, a_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1710,9 +1650,8 @@ namespace nifake_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PoorlyNamedSimpleFunction(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1735,9 +1674,8 @@ namespace nifake_grpc { ViReal64 reading {}; auto status = library_->Read(vi, maximum_time, &reading); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_reading(reading); return ::grpc::Status::OK; @@ -1758,10 +1696,9 @@ namespace nifake_grpc { ViInt32 buffer_size {}; while (true) { auto status = library_->ReadDataWithInOutIviTwist(nullptr, &buffer_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } response->mutable_data()->Resize(buffer_size, 0); ViInt32* data = reinterpret_cast(response->mutable_data()->mutable_data()); status = library_->ReadDataWithInOutIviTwist(data, &buffer_size); @@ -1769,10 +1706,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->mutable_data()->Resize(buffer_size, 0); response->set_buffer_size(buffer_size); @@ -1796,10 +1732,9 @@ namespace nifake_grpc { ViInt32 other_actual_size {}; while (true) { auto status = library_->ReadDataWithMultpleIviTwistParamSets(0, nullptr, &actual_size, 0, nullptr, &other_actual_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } response->mutable_array_out()->Resize(actual_size, 0); ViInt32* array_out = reinterpret_cast(response->mutable_array_out()->mutable_data()); response->mutable_other_array_out()->Resize(other_actual_size, 0); @@ -1811,10 +1746,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->mutable_array_out()->Resize(actual_size, 0); response->set_actual_size(actual_size); @@ -1843,9 +1777,8 @@ namespace nifake_grpc { ViReal64 reading {}; auto status = library_->ReadFromChannel(vi, channel_name, maximum_time, &reading); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_reading(reading); return ::grpc::Status::OK; @@ -1869,9 +1802,8 @@ namespace nifake_grpc { std::string a_string(256 - 1, '\0'); auto status = library_->ReturnANumberAndAString(vi, &a_number, (ViChar*)a_string.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_a_number(a_number); response->set_a_string(a_string); @@ -1896,9 +1828,8 @@ namespace nifake_grpc { ViReal64 timedelta {}; auto status = library_->ReturnDurationInSeconds(vi, &timedelta); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_timedelta(timedelta); return ::grpc::Status::OK; @@ -1923,9 +1854,8 @@ namespace nifake_grpc { ViReal64* timedeltas = response->mutable_timedeltas()->mutable_data(); auto status = library_->ReturnListOfDurationsInSeconds(vi, number_of_elements, timedeltas); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1948,10 +1878,9 @@ namespace nifake_grpc { while (true) { auto status = library_->ReturnMultipleTypes(vi, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 string_size = status; ViBoolean a_boolean {}; @@ -1971,10 +1900,9 @@ namespace nifake_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_a_boolean(a_boolean); response->set_an_int32(an_int32); @@ -2010,9 +1938,8 @@ namespace nifake_grpc { auto cs = convert_from_grpc(request->cs()); auto status = library_->SetCustomType(vi, cs); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2035,9 +1962,8 @@ namespace nifake_grpc { auto cs = convert_from_grpc(request->cs()); auto status = library_->SetCustomTypeArray(vi, number_of_elements, cs.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2078,9 +2004,8 @@ namespace nifake_grpc { auto status = library_->StringValuedEnumInputFunctionWithDefaults(vi, a_mobile_os_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2103,9 +2028,8 @@ namespace nifake_grpc { ViString a_string = (ViString)request->a_string().c_str(); auto status = library_->TwoInputFunction(vi, a_number, a_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2128,9 +2052,8 @@ namespace nifake_grpc { ViInt64 output {}; auto status = library_->Use64BitNumber(vi, input, &output); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_output(output); return ::grpc::Status::OK; @@ -2154,9 +2077,8 @@ namespace nifake_grpc { auto waveform = const_cast(request->waveform().data()); auto status = library_->WriteWaveform(vi, number_of_samples, waveform); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2178,9 +2100,8 @@ namespace nifake_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2203,9 +2124,8 @@ namespace nifake_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->CloseExtCal(vi, action); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2228,9 +2148,8 @@ namespace nifake_grpc { ViUInt8* an_array = (ViUInt8*)request->an_array().c_str(); auto status = library_->ViUInt8ArrayInputFunction(vi, number_of_elements, an_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2253,9 +2172,8 @@ namespace nifake_grpc { std::string an_array(number_of_elements, '\0'); auto status = library_->ViUInt8ArrayOutputFunction(vi, number_of_elements, (ViUInt8*)an_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_an_array(an_array); return ::grpc::Status::OK; @@ -2285,9 +2203,8 @@ namespace nifake_grpc { [](auto x) { return (ViInt16)x; }); auto status = library_->ViInt16ArrayInputFunction(vi, number_of_elements, an_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifake_extension/nifake_extension_service.cpp b/generated/nifake_extension/nifake_extension_service.cpp index d9f81b9e8..a8e555f2c 100644 --- a/generated/nifake_extension/nifake_extension_service.cpp +++ b/generated/nifake_extension/nifake_extension_service.cpp @@ -54,9 +54,8 @@ namespace nifake_extension_grpc { ViInt32 param = request->param(); auto status = library_->AddCoolFunctionality(vi, param); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifake_non_ivi/nifake_non_ivi_service.cpp b/generated/nifake_non_ivi/nifake_non_ivi_service.cpp index 30a27115d..359ee79e8 100644 --- a/generated/nifake_non_ivi/nifake_non_ivi_service.cpp +++ b/generated/nifake_non_ivi/nifake_non_ivi_service.cpp @@ -64,9 +64,8 @@ namespace nifake_non_ivi_grpc { session_repository_->remove_session(handle_grpc_session.id(), handle_grpc_session.name()); auto status = library_->Close(handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); return ::grpc::Status::OK; } @@ -88,9 +87,8 @@ namespace nifake_non_ivi_grpc { secondary_session_handle_resource_repository_->remove_session(secondary_session_handle_grpc_session.id(), secondary_session_handle_grpc_session.name()); auto status = library_->CloseSecondarySession(secondary_session_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForSecondarySessionHandle(status, secondary_session_handle); + return ConvertApiErrorStatusForSecondarySessionHandle(status, secondary_session_handle); } - response->set_status(status); return ::grpc::Status::OK; } @@ -144,10 +142,9 @@ namespace nifake_non_ivi_grpc { while (true) { auto status = library_->GetLatestErrorMessage(nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForFakeHandle(status, 0); - } - + } uInt32 size = status; std::string message; @@ -159,10 +156,9 @@ namespace nifake_non_ivi_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForFakeHandle(status, 0); + } response->set_status(status); response->set_message(message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_message())); @@ -186,9 +182,8 @@ namespace nifake_non_ivi_grpc { auto string_out = library_->GetStringAsReturnedValue((char*)buf.data()); auto status = string_out ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->set_string_out(string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); @@ -231,9 +226,8 @@ namespace nifake_non_ivi_grpc { double value {}; auto status = library_->GetMarbleAttributeDouble(handle, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -275,9 +269,8 @@ namespace nifake_non_ivi_grpc { int32 value {}; auto status = library_->GetMarbleAttributeInt32(handle, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); @@ -326,9 +319,8 @@ namespace nifake_non_ivi_grpc { int32* value = reinterpret_cast(response->mutable_value_raw()->mutable_data()); auto status = library_->GetMarbleAttributeInt32Array(handle, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); auto checked_convert_value = [](auto raw_value) { bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); @@ -371,9 +363,8 @@ namespace nifake_non_ivi_grpc { auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; @@ -407,9 +398,8 @@ namespace nifake_non_ivi_grpc { auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; @@ -449,9 +439,8 @@ namespace nifake_non_ivi_grpc { auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; @@ -483,9 +472,8 @@ namespace nifake_non_ivi_grpc { auto cleanup_lambda = [&] (SecondarySessionHandle id) { library_->CloseSecondarySession(id); }; int status = secondary_session_handle_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_secondary_session_handle()->set_id(session_id); return ::grpc::Status::OK; @@ -518,9 +506,8 @@ namespace nifake_non_ivi_grpc { auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; @@ -553,9 +540,8 @@ namespace nifake_non_ivi_grpc { auto cleanup_lambda = [&] (FakeHandle id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; @@ -632,9 +618,8 @@ namespace nifake_non_ivi_grpc { auto status = library_->InputArraysWithNarrowIntegerTypes(u16_array.data(), i16_array.data(), i8_array.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -660,9 +645,8 @@ namespace nifake_non_ivi_grpc { int32* data = reinterpret_cast(response->mutable_data()->mutable_data()); auto status = library_->IotaWithCustomSize(size_one, size_two, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -687,9 +671,8 @@ namespace nifake_non_ivi_grpc { std::vector i8_data(number_of_i8_samples); auto status = library_->OutputArraysWithNarrowIntegerTypes(number_of_u16_samples, u16_data.data(), number_of_i16_samples, i16_data.data(), number_of_i8_samples, i8_data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_u16_data()->Clear(); response->mutable_u16_data()->Reserve(number_of_u16_samples); @@ -736,9 +719,8 @@ namespace nifake_non_ivi_grpc { const myUInt8* u8_array = (const myUInt8*)request->u8_array().c_str(); auto status = library_->InputArrayOfBytes(u8_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -759,9 +741,8 @@ namespace nifake_non_ivi_grpc { std::string u8_data(number_of_u8_samples, '\0'); auto status = library_->OutputArrayOfBytes(number_of_u8_samples, (myUInt8*)u8_data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->set_u8_data(u8_data); return ::grpc::Status::OK; @@ -785,9 +766,8 @@ namespace nifake_non_ivi_grpc { std::vector u16_data(array_size_copy); auto status = library_->OutputArraysWithPassedInByPtrMechanism(i32_data, u16_data.data(), &array_size_copy); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); response->mutable_i32_data()->Resize(array_size_copy, 0); response->mutable_u16_data()->Clear(); @@ -871,9 +851,8 @@ namespace nifake_non_ivi_grpc { auto when = convert_from_grpc(request->when()); auto status = library_->InputTimestamp(when); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -893,9 +872,8 @@ namespace nifake_non_ivi_grpc { CVIAbsoluteTime when {}; auto status = library_->OutputTimestamp(&when); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); convert_to_grpc(when, response->mutable_when()); return ::grpc::Status::OK; @@ -942,9 +920,8 @@ namespace nifake_non_ivi_grpc { auto status = library_->InputVarArgs(input_name, get_channelName_if(string_and_enums, 0), get_color_if(string_and_enums, 0), get_powerUpState_if(string_and_enums, 0), get_channelName_if(string_and_enums, 1), get_color_if(string_and_enums, 1), get_powerUpState_if(string_and_enums, 1), get_channelName_if(string_and_enums, 2), get_color_if(string_and_enums, 2), get_powerUpState_if(string_and_enums, 2), get_channelName_if(string_and_enums, 3), get_color_if(string_and_enums, 3), get_powerUpState_if(string_and_enums, 3)); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -986,9 +963,8 @@ namespace nifake_non_ivi_grpc { colorVector.resize(channel_names.size()); auto status = library_->OutputVarArgs(input_name, get_channelName_if(channel_names, 0), get_color_if(colorVector, 0), get_channelName_if(channel_names, 1), get_color_if(colorVector, 1), get_channelName_if(channel_names, 2), get_color_if(colorVector, 2), get_channelName_if(channel_names, 3), get_color_if(colorVector, 3)); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); for (int i = 0; i < colorVector.size(); ++i) { response->add_colors(static_cast(colorVector[i])); @@ -1031,9 +1007,8 @@ namespace nifake_non_ivi_grpc { auto status = library_->ResetMarbleAttribute(handle, attribute); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1082,9 +1057,8 @@ namespace nifake_non_ivi_grpc { auto status = library_->ScalarsWithNarrowIntegerTypes(u16, i16, i8); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1128,9 +1102,8 @@ namespace nifake_non_ivi_grpc { double value = request->value(); auto status = library_->SetMarbleAttributeDouble(handle, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1186,9 +1159,8 @@ namespace nifake_non_ivi_grpc { auto status = library_->SetMarbleAttributeInt32(handle, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, handle); + return ConvertApiErrorStatusForFakeHandle(status, handle); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1217,9 +1189,8 @@ namespace nifake_non_ivi_grpc { int32 size = request->size(); auto status = library_->SetColors(colors, size); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1240,9 +1211,8 @@ namespace nifake_non_ivi_grpc { std::vector structs(number_of_structs, StructWithCoercion_struct()); auto status = library_->GetStructsWithCoercion(number_of_structs, structs.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); convert_to_grpc(structs, response->mutable_structs()); return ::grpc::Status::OK; @@ -1263,9 +1233,8 @@ namespace nifake_non_ivi_grpc { auto structs = convert_from_grpc(request->structs()); auto status = library_->SetStructsWithCoercion(structs.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1307,9 +1276,8 @@ namespace nifake_non_ivi_grpc { auto status = library_->InputStringValuedEnum(a_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1330,9 +1298,8 @@ namespace nifake_non_ivi_grpc { int32 size = static_cast(request->bools().size()); auto status = library_->WriteBooleanArray(bools.data(), size); if (!status_ok(status)) { - return ConvertApiErrorStatusForFakeHandle(status, 0); + return ConvertApiErrorStatusForFakeHandle(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nifgen/nifgen_service.cpp b/generated/nifgen/nifgen_service.cpp index 975eaa258..d529d310e 100644 --- a/generated/nifgen/nifgen_service.cpp +++ b/generated/nifgen/nifgen_service.cpp @@ -57,9 +57,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AbortGeneration(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -81,9 +80,8 @@ namespace nifgen_grpc { ViReal64 adjustment_time = request->adjustment_time(); auto status = library_->AdjustSampleClockRelativeDelay(vi, adjustment_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -107,9 +105,8 @@ namespace nifgen_grpc { ViInt32 waveform_size = request->waveform_size(); auto status = library_->AllocateNamedWaveform(vi, channel_name, waveform_name, waveform_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -133,9 +130,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->AllocateWaveform(vi, channel_name, waveform_size, &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -160,9 +156,8 @@ namespace nifgen_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -201,9 +196,8 @@ namespace nifgen_grpc { auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -227,9 +221,8 @@ namespace nifgen_grpc { ViInt64 attribute_value = request->attribute_value_raw(); auto status = library_->CheckAttributeViInt64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -268,9 +261,8 @@ namespace nifgen_grpc { auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -295,9 +287,8 @@ namespace nifgen_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -321,9 +312,8 @@ namespace nifgen_grpc { auto attribute_value = request->attribute_value_raw().c_str(); auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -344,9 +334,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearArbMemory(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -383,9 +372,8 @@ namespace nifgen_grpc { auto status = library_->ClearArbSequence(vi, sequence_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -422,9 +410,8 @@ namespace nifgen_grpc { auto status = library_->ClearArbWaveform(vi, waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -445,9 +432,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -484,9 +470,8 @@ namespace nifgen_grpc { auto status = library_->ClearFreqList(vi, frequency_list_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -507,9 +492,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -531,9 +515,8 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->ClearUserStandardWaveform(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -555,9 +538,8 @@ namespace nifgen_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -578,9 +560,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -603,9 +584,8 @@ namespace nifgen_grpc { ViReal64 amplitude = request->amplitude(); auto status = library_->ConfigureAmplitude(vi, channel_name, amplitude); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -630,9 +610,8 @@ namespace nifgen_grpc { ViReal64 offset = request->offset(); auto status = library_->ConfigureArbSequence(vi, channel_name, sequence_handle, gain, offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -657,9 +636,8 @@ namespace nifgen_grpc { ViReal64 offset = request->offset(); auto status = library_->ConfigureArbWaveform(vi, channel_name, waveform_handle, gain, offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -681,9 +659,8 @@ namespace nifgen_grpc { auto channels = request->channels().c_str(); auto status = library_->ConfigureChannels(vi, channels); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -720,9 +697,8 @@ namespace nifgen_grpc { auto status = library_->ConfigureClockMode(vi, clock_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -746,9 +722,8 @@ namespace nifgen_grpc { auto coefficients_array = const_cast(request->coefficients_array().data()); auto status = library_->ConfigureCustomFIRFilterCoefficients(vi, channel_name, number_of_coefficients, coefficients_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -772,9 +747,8 @@ namespace nifgen_grpc { ViInt32 edge = request->edge(); auto status = library_->ConfigureDigitalEdgeScriptTrigger(vi, trigger_id, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -797,9 +771,8 @@ namespace nifgen_grpc { ViInt32 edge = request->edge(); auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -838,9 +811,8 @@ namespace nifgen_grpc { auto status = library_->ConfigureDigitalLevelScriptTrigger(vi, trigger_id, source, trigger_when); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -866,9 +838,8 @@ namespace nifgen_grpc { ViReal64 start_phase = request->start_phase(); auto status = library_->ConfigureFreqList(vi, channel_name, frequency_list_handle, amplitude, dc_offset, start_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -891,9 +862,8 @@ namespace nifgen_grpc { ViReal64 frequency = request->frequency(); auto status = library_->ConfigureFrequency(vi, channel_name, frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -916,9 +886,8 @@ namespace nifgen_grpc { ViInt32 operation_mode = request->operation_mode(); auto status = library_->ConfigureOperationMode(vi, channel_name, operation_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -941,9 +910,8 @@ namespace nifgen_grpc { ViBoolean enabled = request->enabled(); auto status = library_->ConfigureOutputEnabled(vi, channel_name, enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -966,9 +934,8 @@ namespace nifgen_grpc { ViReal64 impedance = request->impedance(); auto status = library_->ConfigureOutputImpedance(vi, channel_name, impedance); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1005,9 +972,8 @@ namespace nifgen_grpc { auto status = library_->ConfigureOutputMode(vi, output_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1029,9 +995,8 @@ namespace nifgen_grpc { ViInt32 p2p_endpoint_fullness_level = request->p2p_endpoint_fullness_level(); auto status = library_->ConfigureP2PEndpointFullnessStartTrigger(vi, p2p_endpoint_fullness_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1054,9 +1019,8 @@ namespace nifgen_grpc { ViReal64 reference_clock_frequency = request->reference_clock_frequency(); auto status = library_->ConfigureReferenceClock(vi, reference_clock_source, reference_clock_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1078,9 +1042,8 @@ namespace nifgen_grpc { auto sample_clock_source = request->sample_clock_source().c_str(); auto status = library_->ConfigureSampleClockSource(vi, sample_clock_source); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1102,9 +1065,8 @@ namespace nifgen_grpc { ViReal64 sample_rate = request->sample_rate(); auto status = library_->ConfigureSampleRate(vi, sample_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1126,9 +1088,8 @@ namespace nifgen_grpc { auto trigger_id = request->trigger_id().c_str(); auto status = library_->ConfigureSoftwareEdgeScriptTrigger(vi, trigger_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1149,9 +1110,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1193,9 +1153,8 @@ namespace nifgen_grpc { ViReal64 start_phase = request->start_phase(); auto status = library_->ConfigureStandardWaveform(vi, channel_name, waveform, amplitude, dc_offset, frequency, start_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1218,9 +1177,8 @@ namespace nifgen_grpc { ViInt32 synchronization_source = request->synchronization_source(); auto status = library_->ConfigureSynchronization(vi, channel_name, synchronization_source); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1258,9 +1216,8 @@ namespace nifgen_grpc { auto status = library_->ConfigureTriggerMode(vi, channel_name, trigger_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1296,9 +1253,8 @@ namespace nifgen_grpc { ViInt32 sequence_handle {}; auto status = library_->CreateArbSequence(vi, sequence_length, waveform_handles_array, loop_counts_array, &sequence_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_sequence_handle(sequence_handle); return ::grpc::Status::OK; @@ -1351,9 +1307,8 @@ namespace nifgen_grpc { ViInt32 frequency_list_handle {}; auto status = library_->CreateFreqList(vi, waveform, frequency_list_length, frequency_array, duration_array, &frequency_list_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_frequency_list_handle(frequency_list_handle); return ::grpc::Status::OK; @@ -1379,9 +1334,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformComplexF64(vi, channel_name, number_of_samples, waveform_data_array.data(), &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -1407,9 +1361,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformF64(vi, channel_name, waveform_size, waveform_data_array, &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -1450,9 +1403,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformFromFileF64(vi, channel_name, file_name, byte_order, &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -1479,9 +1431,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformFromFileHWS(vi, channel_name, file_name, use_rate_from_waveform, use_gain_and_offset_from_waveform, &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -1513,9 +1464,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformI16(vi, channel_name, waveform_size, waveform_data_array.data(), &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -1556,9 +1506,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle {}; auto status = library_->CreateWaveformFromFileI16(vi, channel_name, file_name, byte_order, &waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; @@ -1583,9 +1532,8 @@ namespace nifgen_grpc { auto waveform_data_array = const_cast(request->waveform_data_array().data()); auto status = library_->DefineUserStandardWaveform(vi, channel_name, waveform_size, waveform_data_array); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1608,9 +1556,8 @@ namespace nifgen_grpc { auto waveform_name = request->waveform_name().c_str(); auto status = library_->DeleteNamedWaveform(vi, channel_name, waveform_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1633,9 +1580,8 @@ namespace nifgen_grpc { auto script_name = request->script_name().c_str(); auto status = library_->DeleteScript(vi, channel_name, script_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1656,9 +1602,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1680,9 +1625,8 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableAnalogFilter(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1704,9 +1648,8 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableDigitalFilter(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1728,9 +1671,8 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->DisableDigitalPatterning(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1752,9 +1694,8 @@ namespace nifgen_grpc { auto trigger_id = request->trigger_id().c_str(); auto status = library_->DisableScriptTrigger(vi, trigger_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1775,9 +1716,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1800,9 +1740,8 @@ namespace nifgen_grpc { ViReal64 filter_correction_frequency = request->filter_correction_frequency(); auto status = library_->EnableAnalogFilter(vi, channel_name, filter_correction_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1824,9 +1763,8 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->EnableDigitalFilter(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1848,9 +1786,8 @@ namespace nifgen_grpc { auto channel_name = request->channel_name().c_str(); auto status = library_->EnableDigitalPatterning(vi, channel_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1873,9 +1810,8 @@ namespace nifgen_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorHandler(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -1900,9 +1836,8 @@ namespace nifgen_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -1927,9 +1862,8 @@ namespace nifgen_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_code(error_code); response->set_error_message(error_message); @@ -1954,10 +1888,9 @@ namespace nifgen_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 size_in_bytes = status; response->mutable_configuration()->Resize(size_in_bytes, 0); @@ -1967,10 +1900,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); return ::grpc::Status::OK; } @@ -1993,9 +1925,8 @@ namespace nifgen_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2034,9 +1965,8 @@ namespace nifgen_grpc { auto output_terminal = request->output_terminal().c_str(); auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2060,9 +1990,8 @@ namespace nifgen_grpc { ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2087,9 +2016,8 @@ namespace nifgen_grpc { ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2114,9 +2042,8 @@ namespace nifgen_grpc { ViInt64 attribute_value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2141,9 +2068,8 @@ namespace nifgen_grpc { ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -2168,9 +2094,8 @@ namespace nifgen_grpc { ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); @@ -2196,10 +2121,9 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 array_size = status; std::string attribute_value; @@ -2211,10 +2135,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); @@ -2240,10 +2163,9 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string channel_string; @@ -2255,10 +2177,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_channel_string(channel_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); @@ -2283,10 +2204,9 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -2299,10 +2219,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -2332,9 +2251,8 @@ namespace nifgen_grpc { ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -2361,9 +2279,8 @@ namespace nifgen_grpc { ViReal64 temperature {}; auto status = library_->GetExtCalLastTemp(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -2386,9 +2303,8 @@ namespace nifgen_grpc { ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_months(months); return ::grpc::Status::OK; @@ -2412,10 +2328,9 @@ namespace nifgen_grpc { ViInt32 number_of_coefficients_read {}; while (true) { auto status = library_->GetFIRFilterCoefficients(vi, channel_name, 0, nullptr, &number_of_coefficients_read); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_coefficients_array()->Resize(number_of_coefficients_read, 0); ViReal64* coefficients_array = response->mutable_coefficients_array()->mutable_data(); auto array_size = number_of_coefficients_read; @@ -2424,10 +2339,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_coefficients_array()->Resize(number_of_coefficients_read, 0); response->set_number_of_coefficients_read(number_of_coefficients_read); @@ -2452,9 +2366,8 @@ namespace nifgen_grpc { ViInt32 state {}; auto status = library_->GetHardwareState(vi, &state); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_state(static_cast(state)); response->set_state_raw(state); @@ -2478,10 +2391,9 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string coercion_record; @@ -2493,10 +2405,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); @@ -2521,10 +2432,9 @@ namespace nifgen_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string interchange_warning; @@ -2536,10 +2446,9 @@ namespace nifgen_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); @@ -2568,9 +2477,8 @@ namespace nifgen_grpc { ViInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -2597,9 +2505,8 @@ namespace nifgen_grpc { ViReal64 temperature {}; auto status = library_->GetSelfCalLastTemp(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -2622,9 +2529,8 @@ namespace nifgen_grpc { ViBoolean self_cal_supported {}; auto status = library_->GetSelfCalSupported(vi, &self_cal_supported); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_cal_supported(self_cal_supported); return ::grpc::Status::OK; @@ -2648,9 +2554,8 @@ namespace nifgen_grpc { ViUInt32 reader_handle {}; auto status = library_->GetStreamEndpointHandle(vi, stream_endpoint, &reader_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_reader_handle(reader_handle); return ::grpc::Status::OK; @@ -2674,9 +2579,8 @@ namespace nifgen_grpc { auto configuration = const_cast(reinterpret_cast(request->configuration().data())); auto status = library_->ImportAttributeConfigurationBuffer(vi, size_in_bytes, configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2698,9 +2602,8 @@ namespace nifgen_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2731,9 +2634,8 @@ namespace nifgen_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2769,9 +2671,8 @@ namespace nifgen_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2807,9 +2708,8 @@ namespace nifgen_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2834,9 +2734,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InitiateGeneration(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2857,9 +2756,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2881,9 +2779,8 @@ namespace nifgen_grpc { ViBoolean done {}; auto status = library_->IsDone(vi, &done); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_done(done); return ::grpc::Status::OK; @@ -2906,9 +2803,8 @@ namespace nifgen_grpc { auto endpoint_name = request->endpoint_name().c_str(); auto status = library_->ManualEnableP2PStream(vi, endpoint_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2933,9 +2829,8 @@ namespace nifgen_grpc { ViInt32 maximum_loop_count {}; auto status = library_->QueryArbSeqCapabilities(vi, &maximum_number_of_sequences, &minimum_sequence_length, &maximum_sequence_length, &maximum_loop_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_maximum_number_of_sequences(maximum_number_of_sequences); response->set_minimum_sequence_length(minimum_sequence_length); @@ -2964,9 +2859,8 @@ namespace nifgen_grpc { ViInt32 maximum_waveform_size {}; auto status = library_->QueryArbWfmCapabilities(vi, &maximum_number_of_waveforms, &waveform_quantum, &minimum_waveform_size, &maximum_waveform_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_maximum_number_of_waveforms(maximum_number_of_waveforms); response->set_waveform_quantum(waveform_quantum); @@ -2997,9 +2891,8 @@ namespace nifgen_grpc { ViReal64 frequency_list_duration_quantum {}; auto status = library_->QueryFreqListCapabilities(vi, &maximum_number_of_freq_lists, &minimum_frequency_list_length, &maximum_frequency_list_length, &minimum_frequency_list_duration, &maximum_frequency_list_duration, &frequency_list_duration_quantum); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_maximum_number_of_freq_lists(maximum_number_of_freq_lists); response->set_minimum_frequency_list_length(minimum_frequency_list_length); @@ -3027,9 +2920,8 @@ namespace nifgen_grpc { ViReal64 temperature {}; auto status = library_->ReadCurrentTemperature(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -3051,9 +2943,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3076,9 +2967,8 @@ namespace nifgen_grpc { ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3099,9 +2989,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3122,9 +3011,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3145,9 +3033,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3170,9 +3057,8 @@ namespace nifgen_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); @@ -3230,9 +3116,8 @@ namespace nifgen_grpc { auto status = library_->RouteSignalOut(vi, channel_name, route_signal_from, route_signal_to); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3253,9 +3138,8 @@ namespace nifgen_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3278,9 +3162,8 @@ namespace nifgen_grpc { std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -3321,9 +3204,8 @@ namespace nifgen_grpc { ViString trigger_id = (ViString)request->trigger_id().c_str(); auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3347,9 +3229,8 @@ namespace nifgen_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3388,9 +3269,8 @@ namespace nifgen_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3414,9 +3294,8 @@ namespace nifgen_grpc { ViInt64 attribute_value = request->attribute_value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3455,9 +3334,8 @@ namespace nifgen_grpc { auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3482,9 +3360,8 @@ namespace nifgen_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3508,9 +3385,8 @@ namespace nifgen_grpc { auto attribute_value = request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3550,9 +3426,8 @@ namespace nifgen_grpc { ViInt32 offset = request->offset(); auto status = library_->SetNamedWaveformNextWritePosition(vi, channel_name, waveform_name, relative_to, offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3592,9 +3467,8 @@ namespace nifgen_grpc { ViInt32 offset = request->offset(); auto status = library_->SetWaveformNextWritePosition(vi, channel_name, waveform_handle, relative_to, offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3616,9 +3490,8 @@ namespace nifgen_grpc { ViInt32 max_time = request->max_time(); auto status = library_->WaitUntilDone(vi, max_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3649,9 +3522,8 @@ namespace nifgen_grpc { [](auto x) { return (ViInt16)x; }); auto status = library_->WriteBinary16Waveform(vi, channel_name, waveform_handle, size, data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3676,9 +3548,8 @@ namespace nifgen_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->WriteComplexBinary16Waveform(vi, channel_name, waveform_handle, size, data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3703,9 +3574,8 @@ namespace nifgen_grpc { auto data = const_cast(request->data().data()); auto status = library_->WriteNamedWaveformF64(vi, channel_name, waveform_name, size, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3736,9 +3606,8 @@ namespace nifgen_grpc { [](auto x) { return (ViInt16)x; }); auto status = library_->WriteNamedWaveformI16(vi, channel_name, waveform_name, size, data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3768,9 +3637,8 @@ namespace nifgen_grpc { [](auto x) { return (ViInt16)x; }); auto status = library_->WriteP2PEndpointI16(vi, endpoint_name, number_of_samples, endpoint_data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3793,9 +3661,8 @@ namespace nifgen_grpc { auto script = request->script().c_str(); auto status = library_->WriteScript(vi, channel_name, script); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3820,9 +3687,8 @@ namespace nifgen_grpc { auto data = const_cast(request->data().data()); auto status = library_->WriteWaveform(vi, channel_name, waveform_handle, size, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3847,9 +3713,8 @@ namespace nifgen_grpc { ViInt32 waveform_handle = request->waveform_handle(); auto status = library_->WriteWaveformComplexF64(vi, channel_name, number_of_samples, data.data(), waveform_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3874,9 +3739,8 @@ namespace nifgen_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->WriteNamedWaveformComplexF64(vi, channel_name, waveform_name, size, data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3901,9 +3765,8 @@ namespace nifgen_grpc { auto data = convert_from_grpc(request->data()); auto status = library_->WriteNamedWaveformComplexI16(vi, channel_name, waveform_name, size, data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp b/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp index 22f1f4d53..4b11302e8 100644 --- a/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp +++ b/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp @@ -77,9 +77,8 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -117,9 +116,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->ACPCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -142,9 +140,8 @@ namespace nirfmxbluetooth_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->ACPCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -182,9 +179,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->ACPCfgOffsetChannelMode(instrument, selector_string, offset_channel_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -210,10 +206,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_power()->Resize(actual_array_size, 0); float32* absolute_power = response->mutable_absolute_power()->mutable_data(); auto array_size = actual_array_size; @@ -222,10 +217,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -256,10 +250,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_limit_with_exception_mask()->Resize(actual_array_size, 0); float32* limit_with_exception_mask = response->mutable_limit_with_exception_mask()->mutable_data(); response->mutable_limit_without_exception_mask()->Resize(actual_array_size, 0); @@ -270,10 +263,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -303,9 +295,8 @@ namespace nirfmxbluetooth_grpc { int32 measurement_status {}; auto status = library_->ACPFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -336,9 +327,8 @@ namespace nirfmxbluetooth_grpc { float64 upper_margin {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_absolute_power, &upper_absolute_power, &lower_relative_power, &upper_relative_power, &lower_margin, &upper_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_lower_absolute_power(lower_absolute_power); response->set_upper_absolute_power(upper_absolute_power); @@ -368,10 +358,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); float64* lower_absolute_power = response->mutable_lower_absolute_power()->mutable_data(); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); @@ -390,10 +379,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); @@ -425,9 +413,8 @@ namespace nirfmxbluetooth_grpc { float64 reference_channel_power {}; auto status = library_->ACPFetchReferenceChannelPower(instrument, selector_string, timeout, &reference_channel_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_channel_power(reference_channel_power); return ::grpc::Status::OK; @@ -454,10 +441,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -466,10 +452,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -496,9 +481,8 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -527,9 +511,8 @@ namespace nirfmxbluetooth_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -552,9 +535,8 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); auto status = library_->AutoDetectSignal(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -578,9 +560,8 @@ namespace nirfmxbluetooth_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_level(reference_level); return ::grpc::Status::OK; @@ -603,10 +584,9 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -618,10 +598,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -646,10 +625,9 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -661,10 +639,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -689,10 +666,9 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildSlotString(selector_string, slot_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -704,10 +680,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -733,9 +708,8 @@ namespace nirfmxbluetooth_grpc { int32 channel_number = request->channel_number(); auto status = library_->CfgChannelNumber(instrument, selector_string, channel_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -758,9 +732,8 @@ namespace nirfmxbluetooth_grpc { int32 data_rate = request->data_rate(); auto status = library_->CfgDataRate(instrument, selector_string, data_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -801,9 +774,8 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -826,9 +798,8 @@ namespace nirfmxbluetooth_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -851,9 +822,8 @@ namespace nirfmxbluetooth_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -892,9 +862,8 @@ namespace nirfmxbluetooth_grpc { int32 channel_number = request->channel_number(); auto status = library_->CfgFrequencyChannelNumber(instrument, selector_string, standard, channel_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -937,9 +906,8 @@ namespace nirfmxbluetooth_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1014,9 +982,8 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1056,9 +1023,8 @@ namespace nirfmxbluetooth_grpc { float64 cte_slot_duration = request->cte_slot_duration(); auto status = library_->CfgLEDirectionFinding(instrument, selector_string, direction_finding_mode, cte_length, cte_slot_duration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1097,9 +1063,8 @@ namespace nirfmxbluetooth_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1137,9 +1102,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->CfgPacketType(instrument, selector_string, packet_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1177,9 +1141,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->CfgPayloadBitPattern(instrument, selector_string, payload_bit_pattern); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1218,9 +1181,8 @@ namespace nirfmxbluetooth_grpc { int32 payload_length = request->payload_length(); auto status = library_->CfgPayloadLength(instrument, selector_string, payload_length_mode, payload_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1245,9 +1207,8 @@ namespace nirfmxbluetooth_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1286,9 +1247,8 @@ namespace nirfmxbluetooth_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1311,9 +1271,8 @@ namespace nirfmxbluetooth_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1337,9 +1296,8 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1362,9 +1320,8 @@ namespace nirfmxbluetooth_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -1387,9 +1344,8 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1411,9 +1367,8 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1436,9 +1391,8 @@ namespace nirfmxbluetooth_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1461,9 +1415,8 @@ namespace nirfmxbluetooth_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1485,9 +1438,8 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1509,9 +1461,8 @@ namespace nirfmxbluetooth_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1533,9 +1484,8 @@ namespace nirfmxbluetooth_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1557,9 +1507,8 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1598,9 +1547,8 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->FrequencyRangeCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1623,9 +1571,8 @@ namespace nirfmxbluetooth_grpc { float64 span = request->span(); auto status = library_->FrequencyRangeCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1650,9 +1597,8 @@ namespace nirfmxbluetooth_grpc { float64 low_frequency {}; auto status = library_->FrequencyRangeFetchMeasurement(instrument, selector_string, timeout, &high_frequency, &low_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_high_frequency(high_frequency); response->set_low_frequency(low_frequency); @@ -1680,10 +1626,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FrequencyRangeFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1692,10 +1637,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1724,10 +1668,9 @@ namespace nirfmxbluetooth_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -1738,10 +1681,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); @@ -1770,9 +1712,8 @@ namespace nirfmxbluetooth_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1797,10 +1738,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -1809,10 +1749,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1839,9 +1778,8 @@ namespace nirfmxbluetooth_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1866,10 +1804,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -1878,10 +1815,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1908,9 +1844,8 @@ namespace nirfmxbluetooth_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1935,9 +1870,8 @@ namespace nirfmxbluetooth_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); @@ -1968,10 +1902,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -1980,10 +1913,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); @@ -2024,9 +1956,8 @@ namespace nirfmxbluetooth_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2051,10 +1982,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2063,10 +1993,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2093,9 +2022,8 @@ namespace nirfmxbluetooth_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2120,10 +2048,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2131,10 +2058,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); @@ -2170,10 +2096,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2181,10 +2106,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -2218,10 +2142,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2229,10 +2152,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -2266,10 +2188,9 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string attr_val; @@ -2281,10 +2202,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); @@ -2311,9 +2231,8 @@ namespace nirfmxbluetooth_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2338,9 +2257,8 @@ namespace nirfmxbluetooth_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2365,10 +2283,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2377,10 +2294,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2407,10 +2323,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2419,10 +2334,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2449,9 +2363,8 @@ namespace nirfmxbluetooth_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2476,10 +2389,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -2487,10 +2399,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); @@ -2516,10 +2427,9 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; int32 error_code {}; @@ -2532,10 +2442,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -2562,10 +2471,9 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; std::string error_description; @@ -2577,10 +2485,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -2614,9 +2521,8 @@ namespace nirfmxbluetooth_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXBT_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); @@ -2651,9 +2557,8 @@ namespace nirfmxbluetooth_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXBT_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -2680,9 +2585,8 @@ namespace nirfmxbluetooth_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2721,9 +2625,8 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2761,9 +2664,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->ModAccCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2787,10 +2689,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchConstellationTrace(instrument, selector_string, timeout, constellation.data(), array_size, &actual_array_size); @@ -2798,10 +2699,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(constellation, response->mutable_constellation()); { @@ -2837,9 +2737,8 @@ namespace nirfmxbluetooth_grpc { float64 ninetynine_percent_devm {}; auto status = library_->ModAccFetchDEVM(instrument, selector_string, timeout, &peak_rms_devm_maximum, &peak_devm_maximum, &ninetynine_percent_devm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_peak_rms_devm_maximum(peak_rms_devm_maximum); response->set_peak_devm_maximum(peak_devm_maximum); @@ -2867,9 +2766,8 @@ namespace nirfmxbluetooth_grpc { float64 peak_rms_magnitude_error_maximum {}; auto status = library_->ModAccFetchDEVMMagnitudeError(instrument, selector_string, timeout, &average_rms_magnitude_error_mean, &peak_rms_magnitude_error_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_rms_magnitude_error_mean(average_rms_magnitude_error_mean); response->set_peak_rms_magnitude_error_maximum(peak_rms_magnitude_error_maximum); @@ -2895,10 +2793,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDEVMPerSymbolTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); float32* devm_per_symbol = response->mutable_devm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -2907,10 +2804,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2938,9 +2834,8 @@ namespace nirfmxbluetooth_grpc { float64 peak_rms_phase_error_maximum {}; auto status = library_->ModAccFetchDEVMPhaseError(instrument, selector_string, timeout, &average_rms_phase_error_mean, &peak_rms_phase_error_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_rms_phase_error_mean(average_rms_phase_error_mean); response->set_peak_rms_phase_error_maximum(peak_rms_phase_error_maximum); @@ -2966,10 +2861,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDemodulatedBitTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector demodulated_bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchDemodulatedBitTrace(instrument, selector_string, timeout, demodulated_bits.data(), array_size, &actual_array_size); @@ -2977,10 +2871,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_demodulated_bits()->Clear(); response->mutable_demodulated_bits()->Reserve(actual_array_size); @@ -3017,9 +2910,8 @@ namespace nirfmxbluetooth_grpc { float64 df1avg_minimum {}; auto status = library_->ModAccFetchDf1(instrument, selector_string, timeout, &df1avg_maximum, &df1avg_minimum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_df1avg_maximum(df1avg_maximum); response->set_df1avg_minimum(df1avg_minimum); @@ -3045,10 +2937,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDf1maxTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_df1max()->Resize(actual_array_size, 0); @@ -3059,10 +2950,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_time()->Resize(actual_array_size, 0); response->mutable_df1max()->Resize(actual_array_size, 0); @@ -3091,9 +2981,8 @@ namespace nirfmxbluetooth_grpc { float64 percentage_of_symbols_above_df2max_threshold {}; auto status = library_->ModAccFetchDf2(instrument, selector_string, timeout, &df2avg_minimum, &percentage_of_symbols_above_df2max_threshold); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_df2avg_minimum(df2avg_minimum); response->set_percentage_of_symbols_above_df2max_threshold(percentage_of_symbols_above_df2max_threshold); @@ -3119,10 +3008,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDf2maxTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_df2max()->Resize(actual_array_size, 0); @@ -3133,10 +3021,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_time()->Resize(actual_array_size, 0); response->mutable_df2max()->Resize(actual_array_size, 0); @@ -3166,9 +3053,8 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_drift_rate_maximum {}; auto status = library_->ModAccFetchFrequencyErrorBR(instrument, selector_string, timeout, &initial_frequency_error_maximum, &peak_frequency_drift_maximum, &peak_frequency_drift_rate_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_initial_frequency_error_maximum(initial_frequency_error_maximum); response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); @@ -3197,9 +3083,8 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_error_w0_maximum {}; auto status = library_->ModAccFetchFrequencyErrorEDR(instrument, selector_string, timeout, &header_frequency_error_wi_maximum, &peak_frequency_error_wi_plus_w0_maximum, &peak_frequency_error_w0_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_header_frequency_error_wi_maximum(header_frequency_error_wi_maximum); response->set_peak_frequency_error_wi_plus_w0_maximum(peak_frequency_error_wi_plus_w0_maximum); @@ -3229,9 +3114,8 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_drift_rate_maximum {}; auto status = library_->ModAccFetchFrequencyErrorLE(instrument, selector_string, timeout, &peak_frequency_error_maximum, &initial_frequency_drift_maximum, &peak_frequency_drift_maximum, &peak_frequency_drift_rate_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_peak_frequency_error_maximum(peak_frequency_error_maximum); response->set_initial_frequency_drift_maximum(initial_frequency_drift_maximum); @@ -3259,10 +3143,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyErrorTraceBR(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_frequency_error()->Resize(actual_array_size, 0); @@ -3273,10 +3156,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_time()->Resize(actual_array_size, 0); response->mutable_frequency_error()->Resize(actual_array_size, 0); @@ -3304,10 +3186,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyErrorTraceLE(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_frequency_error()->Resize(actual_array_size, 0); @@ -3318,10 +3199,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_time()->Resize(actual_array_size, 0); response->mutable_frequency_error()->Resize(actual_array_size, 0); @@ -3349,10 +3229,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyErrorWiPlusW0TraceEDR(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); response->mutable_frequency_error_wi_plus_w0()->Resize(actual_array_size, 0); @@ -3363,10 +3242,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_time()->Resize(actual_array_size, 0); response->mutable_frequency_error_wi_plus_w0()->Resize(actual_array_size, 0); @@ -3396,10 +3274,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchFrequencyTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); auto array_size = actual_array_size; @@ -3408,10 +3285,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3440,10 +3316,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSDEVMTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_devm()->Resize(actual_array_size, 0); float32* rms_devm = response->mutable_rms_devm()->mutable_data(); auto array_size = actual_array_size; @@ -3452,10 +3327,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_rms_devm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -3481,9 +3355,8 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3505,9 +3378,8 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3546,9 +3418,8 @@ namespace nirfmxbluetooth_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3569,9 +3440,8 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3595,9 +3465,8 @@ namespace nirfmxbluetooth_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3622,9 +3491,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3648,9 +3516,8 @@ namespace nirfmxbluetooth_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3675,9 +3542,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3710,9 +3576,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3754,9 +3619,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3789,9 +3653,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3815,9 +3678,8 @@ namespace nirfmxbluetooth_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3842,9 +3704,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3877,9 +3738,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3924,9 +3784,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3954,9 +3813,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3981,9 +3839,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4026,9 +3883,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4061,9 +3917,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4090,9 +3945,8 @@ namespace nirfmxbluetooth_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4117,9 +3971,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4144,9 +3997,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4170,9 +4022,8 @@ namespace nirfmxbluetooth_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4197,9 +4048,8 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4238,9 +4088,8 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4278,9 +4127,8 @@ namespace nirfmxbluetooth_grpc { auto status = library_->TXPCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4306,9 +4154,8 @@ namespace nirfmxbluetooth_grpc { float64 edr_dpsk_gfsk_average_power_ratio_mean {}; auto status = library_->TXPFetchEDRPowers(instrument, selector_string, timeout, &edr_gfsk_average_power_mean, &edr_dpsk_average_power_mean, &edr_dpsk_gfsk_average_power_ratio_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_edr_gfsk_average_power_mean(edr_gfsk_average_power_mean); response->set_edr_dpsk_average_power_mean(edr_dpsk_average_power_mean); @@ -4336,9 +4183,8 @@ namespace nirfmxbluetooth_grpc { float64 reference_period_peak_absolute_power_deviation_maximum {}; auto status = library_->TXPFetchLECTEReferencePeriodPowers(instrument, selector_string, timeout, &reference_period_average_power_mean, &reference_period_peak_absolute_power_deviation_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_period_average_power_mean(reference_period_average_power_mean); response->set_reference_period_peak_absolute_power_deviation_maximum(reference_period_peak_absolute_power_deviation_maximum); @@ -4365,9 +4211,8 @@ namespace nirfmxbluetooth_grpc { float64 transmit_slot_peak_absolute_power_deviation_maximum {}; auto status = library_->TXPFetchLECTETransmitSlotPowers(instrument, selector_string, timeout, &transmit_slot_average_power_mean, &transmit_slot_peak_absolute_power_deviation_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_transmit_slot_average_power_mean(transmit_slot_average_power_mean); response->set_transmit_slot_peak_absolute_power_deviation_maximum(transmit_slot_peak_absolute_power_deviation_maximum); @@ -4393,10 +4238,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchLECTETransmitSlotPowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); float64* transmit_slot_average_power_mean = response->mutable_transmit_slot_average_power_mean()->mutable_data(); response->mutable_transmit_slot_peak_absolute_power_deviation_maximum()->Resize(actual_array_size, 0); @@ -4407,10 +4251,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); response->mutable_transmit_slot_peak_absolute_power_deviation_maximum()->Resize(actual_array_size, 0); @@ -4440,10 +4283,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -4452,10 +4294,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4487,9 +4328,8 @@ namespace nirfmxbluetooth_grpc { float64 peak_to_average_power_ratio_maximum {}; auto status = library_->TXPFetchPowers(instrument, selector_string, timeout, &average_power_mean, &average_power_maximum, &average_power_minimum, &peak_to_average_power_ratio_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_power_mean(average_power_mean); response->set_average_power_maximum(average_power_maximum); @@ -4532,9 +4372,8 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TwentydBBandwidthCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4561,9 +4400,8 @@ namespace nirfmxbluetooth_grpc { float64 low_frequency {}; auto status = library_->TwentydBBandwidthFetchMeasurement(instrument, selector_string, timeout, &peak_power, &bandwidth, &high_frequency, &low_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_peak_power(peak_power); response->set_bandwidth(bandwidth); @@ -4593,10 +4431,9 @@ namespace nirfmxbluetooth_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TwentydBBandwidthFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -4605,10 +4442,9 @@ namespace nirfmxbluetooth_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4635,9 +4471,8 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4660,9 +4495,8 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxinstr/nirfmxinstr_service.cpp b/generated/nirfmxinstr/nirfmxinstr_service.cpp index 13a1d6cd0..ce86897df 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_service.cpp @@ -59,10 +59,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildCalibrationPlaneString(calibration_plane_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -74,10 +73,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -102,10 +100,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildInstrumentString(selector_string, instrument_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -117,10 +114,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -145,10 +141,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildLOString(selector_string, lo_index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -160,10 +155,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -188,10 +182,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildModuleString(selector_string, module_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -203,10 +196,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -248,9 +240,8 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgExternalAttenuationInterpolationLinear(instrument, selector_string, table_name, format); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -273,9 +264,8 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->CfgExternalAttenuationInterpolationNearest(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -298,9 +288,8 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->CfgExternalAttenuationInterpolationSpline(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -342,9 +331,8 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgExternalAttenuationTable(instrument, selector_string, table_name, frequency, external_attenuation, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -387,9 +375,8 @@ namespace nirfmxinstr_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -428,9 +415,8 @@ namespace nirfmxinstr_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -469,9 +455,8 @@ namespace nirfmxinstr_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -515,9 +500,8 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgSParameterExternalAttenuationTable(instrument, selector_string, table_name, frequency, frequency_array_size, s_parameters.data(), s_parameter_table_size, number_of_ports, s_parameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -555,9 +539,8 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgSParameterExternalAttenuationType(instrument, selector_string, s_parameter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -579,9 +562,8 @@ namespace nirfmxinstr_grpc { int32 acquisition_done {}; auto status = library_->CheckAcquisitionStatus(instrument, &acquisition_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_acquisition_done(acquisition_done); return ::grpc::Status::OK; @@ -606,9 +588,8 @@ namespace nirfmxinstr_grpc { int32 personality {}; auto status = library_->CheckIfListExists(instrument, list_name, &list_exists, &personality); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_list_exists(list_exists); response->set_personality(static_cast(personality)); @@ -635,9 +616,8 @@ namespace nirfmxinstr_grpc { int32 personality {}; auto status = library_->CheckIfSignalConfigurationExists(instrument, signal_name, &signal_configuration_exists, &personality); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_signal_configuration_exists(signal_configuration_exists); response->set_personality(static_cast(personality)); @@ -663,9 +643,8 @@ namespace nirfmxinstr_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -687,9 +666,8 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DeleteAllExternalAttenuationTables(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -712,9 +690,8 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->DeleteExternalAttenuationTable(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -736,9 +713,8 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableCalibrationPlane(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -760,9 +736,8 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->EnableCalibrationPlane(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -819,9 +794,8 @@ namespace nirfmxinstr_grpc { auto status = library_->ExportSignal(instrument, export_signal_source, export_signal_output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -845,9 +819,8 @@ namespace nirfmxinstr_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -872,10 +845,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -884,10 +856,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -914,9 +885,8 @@ namespace nirfmxinstr_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -941,10 +911,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -953,10 +922,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -983,9 +951,8 @@ namespace nirfmxinstr_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1010,9 +977,8 @@ namespace nirfmxinstr_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); @@ -1043,10 +1009,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -1055,10 +1020,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); @@ -1099,9 +1063,8 @@ namespace nirfmxinstr_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1126,10 +1089,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1138,10 +1100,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1168,9 +1129,8 @@ namespace nirfmxinstr_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1195,10 +1155,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, channel_name, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1206,10 +1165,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); @@ -1245,10 +1203,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1256,10 +1213,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -1293,10 +1249,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -1304,10 +1259,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -1341,10 +1295,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeString(instrument, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string attr_val; @@ -1356,10 +1309,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); @@ -1386,9 +1338,8 @@ namespace nirfmxinstr_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1413,9 +1364,8 @@ namespace nirfmxinstr_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1440,10 +1390,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1452,10 +1401,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1482,10 +1430,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -1494,10 +1441,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1524,9 +1470,8 @@ namespace nirfmxinstr_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -1551,10 +1496,9 @@ namespace nirfmxinstr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, channel_name, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -1562,10 +1506,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); @@ -1592,10 +1535,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAvailablePorts(instrument, selector_string, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string available_ports; @@ -1607,10 +1549,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_available_ports(available_ports); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_available_ports())); @@ -1635,10 +1576,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; int32 error_code {}; @@ -1651,10 +1591,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -1681,10 +1620,9 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; std::string error_description; @@ -1696,10 +1634,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -1725,9 +1662,8 @@ namespace nirfmxinstr_grpc { float64 external_attenuation {}; auto status = library_->GetExternalAttenuationTableActualValue(instrument, selector_string, &external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_external_attenuation(external_attenuation); return ::grpc::Status::OK; @@ -1768,10 +1704,9 @@ namespace nirfmxinstr_grpc { int32 actual_personality_array_size {}; while (true) { auto status = library_->GetListNames(instrument, selector_string, personality_filter, nullptr, 0, &actual_list_names_size, nullptr, 0, &actual_personality_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string list_names; if (actual_list_names_size > 0) { list_names.resize(actual_list_names_size - 1); @@ -1785,10 +1720,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_list_names(list_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_list_names())); @@ -1859,11 +1793,12 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 s_parameter_type {}; auto status = library_->GetSParameterExternalAttenuationType(instrument, selector_string, &s_parameter_type); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); - if (status_ok(status)) { response->set_s_parameter_type(static_cast(s_parameter_type)); response->set_s_parameter_type_raw(s_parameter_type); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1901,9 +1836,8 @@ namespace nirfmxinstr_grpc { CVIAbsoluteTime timestamp {}; auto status = library_->GetSelfCalibrateLastDateAndTime(instrument, selector_string, self_calibrate_step, ×tamp); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); convert_to_grpc(timestamp, response->mutable_timestamp()); return ::grpc::Status::OK; @@ -1943,9 +1877,8 @@ namespace nirfmxinstr_grpc { float64 temperature {}; auto status = library_->GetSelfCalibrateLastTemperature(instrument, selector_string, self_calibrate_step, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -1986,10 +1919,9 @@ namespace nirfmxinstr_grpc { int32 actual_personality_array_size {}; while (true) { auto status = library_->GetSignalConfigurationNames(instrument, selector_string, personality_filter, nullptr, 0, &actual_signal_names_size, nullptr, 0, &actual_personality_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string signal_names; if (actual_signal_names_size > 0) { signal_names.resize(actual_signal_names_size - 1); @@ -2003,10 +1935,9 @@ namespace nirfmxinstr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_signal_names(signal_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); @@ -2043,9 +1974,8 @@ namespace nirfmxinstr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); @@ -2080,9 +2010,8 @@ namespace nirfmxinstr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -2122,9 +2051,8 @@ namespace nirfmxinstr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -2152,9 +2080,8 @@ namespace nirfmxinstr_grpc { int32 valid_steps {}; auto status = library_->IsSelfCalibrateValid(instrument, selector_string, &self_calibrate_valid, &valid_steps); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_self_calibrate_valid(self_calibrate_valid); if (valid_steps & 0x20) @@ -2199,9 +2126,8 @@ namespace nirfmxinstr_grpc { int32 load_rf_instr_configuration = request->load_rf_instr_configuration(); auto status = library_->LoadAllConfigurations(instrument, file_path, load_rf_instr_configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2241,9 +2167,8 @@ namespace nirfmxinstr_grpc { auto status = library_->LoadSParameterExternalAttenuationTableFromS2PFile(instrument, selector_string, table_name, s2p_file_path, s_parameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2266,9 +2191,8 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, channel_name, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2289,9 +2213,8 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetDriver(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2312,9 +2235,8 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetEntireSession(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2335,9 +2257,8 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetToDefault(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2359,9 +2280,8 @@ namespace nirfmxinstr_grpc { char* file_path = (char*)request->file_path().c_str(); auto status = library_->SaveAllConfigurations(instrument, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2384,9 +2304,8 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->SelectActiveExternalAttenuationTable(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2424,9 +2343,8 @@ namespace nirfmxinstr_grpc { auto status = library_->SelfCalibrate(instrument, selector_string, steps_to_omit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2468,9 +2386,8 @@ namespace nirfmxinstr_grpc { float64 maximum_reference_level = request->maximum_reference_level(); auto status = library_->SelfCalibrateRange(instrument, selector_string, steps_to_omit, minimum_frequency, maximum_frequency, minimum_reference_level, maximum_reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2491,9 +2408,8 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeAdvanceTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2514,9 +2430,8 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeStartTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2540,9 +2455,8 @@ namespace nirfmxinstr_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2567,9 +2481,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2593,9 +2506,8 @@ namespace nirfmxinstr_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2620,9 +2532,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2655,9 +2566,8 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeI16(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2699,9 +2609,8 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeI32(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2734,9 +2643,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2760,9 +2668,8 @@ namespace nirfmxinstr_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2787,9 +2694,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2822,9 +2728,8 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeI8(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2869,9 +2774,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, channel_name, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2899,9 +2803,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2926,9 +2829,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2971,9 +2873,8 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeString(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3006,9 +2907,8 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeU16(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3035,9 +2935,8 @@ namespace nirfmxinstr_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3062,9 +2961,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3089,9 +2987,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3115,9 +3012,8 @@ namespace nirfmxinstr_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3142,9 +3038,8 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3166,9 +3061,8 @@ namespace nirfmxinstr_grpc { CVIAbsoluteTime timestamp {}; auto status = library_->TimestampFromValues(seconds_since_1970, fractional_seconds, ×tamp); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); convert_to_grpc(timestamp, response->mutable_timestamp()); return ::grpc::Status::OK; @@ -3191,9 +3085,8 @@ namespace nirfmxinstr_grpc { float64 fractional_seconds {}; auto status = library_->ValuesFromTimestamp(timestamp, &seconds_since_1970, &fractional_seconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->set_seconds_since_1970(seconds_since_1970); response->set_fractional_seconds(fractional_seconds); @@ -3217,9 +3110,8 @@ namespace nirfmxinstr_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxlte/nirfmxlte_service.cpp b/generated/nirfmxlte/nirfmxlte_service.cpp index c61e97665..6dbdf6931 100644 --- a/generated/nirfmxlte/nirfmxlte_service.cpp +++ b/generated/nirfmxlte/nirfmxlte_service.cpp @@ -93,9 +93,8 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -133,9 +132,8 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgConfigurableNumberOfOffsetsEnabled(instrument, selector_string, configurable_number_of_offsets_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -173,9 +171,8 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -213,9 +210,8 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -238,9 +234,8 @@ namespace nirfmxlte_grpc { int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgNumberOfEUTRAOffsets(instrument, selector_string, number_of_eutra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -263,9 +258,8 @@ namespace nirfmxlte_grpc { int32 number_of_gsm_offsets = request->number_of_gsm_offsets(); auto status = library_->ACPCfgNumberOfGSMOffsets(instrument, selector_string, number_of_gsm_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -288,9 +282,8 @@ namespace nirfmxlte_grpc { int32 number_of_utra_offsets = request->number_of_utra_offsets(); auto status = library_->ACPCfgNumberOfUTRAOffsets(instrument, selector_string, number_of_utra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -328,9 +321,8 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -385,9 +377,8 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -426,9 +417,8 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -452,9 +442,8 @@ namespace nirfmxlte_grpc { int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgUTRAAndEUTRAOffsets(instrument, selector_string, number_of_utra_offsets, number_of_eutra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -481,10 +470,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -493,10 +481,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -526,9 +513,8 @@ namespace nirfmxlte_grpc { float64 relative_power {}; auto status = library_->ACPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); @@ -554,10 +540,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -568,10 +553,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -602,9 +586,8 @@ namespace nirfmxlte_grpc { float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); @@ -632,10 +615,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -650,10 +632,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_lower_relative_power()->Resize(actual_array_size, 0); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -686,10 +667,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -698,10 +678,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -732,10 +711,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -744,10 +722,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -778,9 +755,8 @@ namespace nirfmxlte_grpc { float64 frequency {}; auto status = library_->ACPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); @@ -807,9 +783,8 @@ namespace nirfmxlte_grpc { float64 total_aggregated_power {}; auto status = library_->ACPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; @@ -833,9 +808,8 @@ namespace nirfmxlte_grpc { int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -859,9 +833,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -890,9 +863,8 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -921,9 +893,8 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -947,9 +918,8 @@ namespace nirfmxlte_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_level(reference_level); return ::grpc::Status::OK; @@ -972,10 +942,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -987,10 +956,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1015,10 +983,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildClusterString(selector_string, cluster_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1030,10 +997,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1058,10 +1024,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1073,10 +1038,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1101,10 +1065,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildPDSCHString(selector_string, pdsch_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1116,10 +1079,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1144,10 +1106,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -1159,10 +1120,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -1187,10 +1147,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSubblockString(selector_string, subblock_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1202,10 +1161,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1230,10 +1188,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSubframeString(selector_string, subframe_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1245,10 +1202,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1306,9 +1262,8 @@ namespace nirfmxlte_grpc { auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1346,9 +1301,8 @@ namespace nirfmxlte_grpc { auto status = library_->CHPCfgIntegrationBandwidthType(instrument, selector_string, integration_bandwidth_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1403,9 +1357,8 @@ namespace nirfmxlte_grpc { auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1444,9 +1397,8 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1471,9 +1423,8 @@ namespace nirfmxlte_grpc { float64 relative_power {}; auto status = library_->CHPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); @@ -1499,10 +1450,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -1513,10 +1463,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -1546,10 +1495,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1558,10 +1506,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1592,9 +1539,8 @@ namespace nirfmxlte_grpc { float64 frequency {}; auto status = library_->CHPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); @@ -1621,9 +1567,8 @@ namespace nirfmxlte_grpc { float64 total_aggregated_power {}; auto status = library_->CHPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; @@ -1647,9 +1592,8 @@ namespace nirfmxlte_grpc { int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -1689,9 +1633,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgAutoDMRSDetectionEnabled(instrument, selector_string, auto_dmrs_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1729,9 +1672,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgAutoNPUSCHChannelDetectionEnabled(instrument, selector_string, auto_npusch_channel_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1769,9 +1711,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgAutoResourceBlockDetectionEnabled(instrument, selector_string, auto_resource_block_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1794,9 +1735,8 @@ namespace nirfmxlte_grpc { int32 band = request->band(); auto status = library_->CfgBand(instrument, selector_string, band); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1834,9 +1774,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgCellSpecificRatio(instrument, selector_string, cell_specific_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1861,9 +1800,8 @@ namespace nirfmxlte_grpc { int32 cell_id = request->cell_id(); auto status = library_->CfgComponentCarrier(instrument, selector_string, component_carrier_bandwidth, component_carrier_frequency, cell_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1907,9 +1845,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgComponentCarrierArray(instrument, selector_string, component_carrier_bandwidth, component_carrier_frequency, cell_id, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1948,9 +1885,8 @@ namespace nirfmxlte_grpc { int32 component_carrier_at_center_frequency = request->component_carrier_at_center_frequency(); auto status = library_->CfgComponentCarrierSpacing(instrument, selector_string, component_carrier_spacing_type, component_carrier_at_center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2010,9 +1946,8 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2050,9 +1985,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDownlinkAutoCellIDDetectionEnabled(instrument, selector_string, auto_cell_id_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2123,9 +2057,8 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->CfgDownlinkAutoChannelDetection(instrument, selector_string, auto_pdsch_channel_detection_enabled, auto_control_channel_power_detection_enabled, auto_pcfich_cfi_detection_enabled, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2163,9 +2096,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDownlinkChannelConfigurationMode(instrument, selector_string, channel_configuration_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2188,9 +2120,8 @@ namespace nirfmxlte_grpc { int32 number_of_subframes = request->number_of_subframes(); auto status = library_->CfgDownlinkNumberOfSubframes(instrument, selector_string, number_of_subframes); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2214,9 +2145,8 @@ namespace nirfmxlte_grpc { float64 sss_power = request->sss_power(); auto status = library_->CfgDownlinkSynchronizationSignal(instrument, selector_string, pss_power, sss_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2254,9 +2184,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDownlinkTestModel(instrument, selector_string, downlink_test_model); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2288,9 +2217,8 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->downlink_test_model().size()); auto status = library_->CfgDownlinkTestModelArray(instrument, selector_string, downlink_test_model, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2344,9 +2272,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDuplexScheme(instrument, selector_string, duplex_scheme, uplink_downlink_configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2384,9 +2311,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgEMTCAnalysisEnabled(instrument, selector_string, emtc_analysis_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2409,9 +2335,8 @@ namespace nirfmxlte_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2434,9 +2359,8 @@ namespace nirfmxlte_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2476,9 +2400,8 @@ namespace nirfmxlte_grpc { int32 earfcn = request->earfcn(); auto status = library_->CfgFrequencyEARFCN(instrument, selector_string, link_direction, band, earfcn); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2521,9 +2444,8 @@ namespace nirfmxlte_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2598,9 +2520,8 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2638,9 +2559,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgLinkDirection(instrument, selector_string, link_direction); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2679,9 +2599,8 @@ namespace nirfmxlte_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2720,9 +2639,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgNBIoTComponentCarrier(instrument, selector_string, n_cell_id, uplink_subcarrier_spacing); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2779,9 +2697,8 @@ namespace nirfmxlte_grpc { int32 npusch_dmrs_delta_ss = request->npusch_dmrs_delta_ss(); auto status = library_->CfgNPUSCHDMRS(instrument, selector_string, npusch_dmrs_base_sequence_mode, npusch_dmrs_base_sequence_index, npusch_dmrs_cyclic_shift, npusch_dmrs_group_hopping_enabled, npusch_dmrs_delta_ss); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2804,9 +2721,8 @@ namespace nirfmxlte_grpc { int32 format = request->format(); auto status = library_->CfgNPUSCHFormat(instrument, selector_string, format); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2829,9 +2745,8 @@ namespace nirfmxlte_grpc { int32 starting_slot = request->starting_slot(); auto status = library_->CfgNPUSCHStartingSlot(instrument, selector_string, starting_slot); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2871,9 +2786,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgNPUSCHTones(instrument, selector_string, tone_offset, number_of_tones, modulation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2896,9 +2810,8 @@ namespace nirfmxlte_grpc { int32 number_of_component_carriers = request->number_of_component_carriers(); auto status = library_->CfgNumberOfComponentCarriers(instrument, selector_string, number_of_component_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2921,9 +2834,8 @@ namespace nirfmxlte_grpc { int32 number_of_dut_antennas = request->number_of_dut_antennas(); auto status = library_->CfgNumberOfDUTAntennas(instrument, selector_string, number_of_dut_antennas); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2946,9 +2858,8 @@ namespace nirfmxlte_grpc { int32 number_of_pdsch_channels = request->number_of_pdsch_channels(); auto status = library_->CfgNumberOfPDSCHChannels(instrument, selector_string, number_of_pdsch_channels); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2971,9 +2882,8 @@ namespace nirfmxlte_grpc { int32 number_of_resource_block_clusters = request->number_of_resource_block_clusters(); auto status = library_->CfgNumberOfPUSCHResourceBlockClusters(instrument, selector_string, number_of_resource_block_clusters); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2996,9 +2906,8 @@ namespace nirfmxlte_grpc { int32 number_of_subblocks = request->number_of_subblocks(); auto status = library_->CfgNumberOfSubblocks(instrument, selector_string, number_of_subblocks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3021,9 +2930,8 @@ namespace nirfmxlte_grpc { float64 pbch_power = request->pbch_power(); auto status = library_->CfgPBCH(instrument, selector_string, pbch_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3047,9 +2955,8 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPCFICH(instrument, selector_string, cfi, power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3072,9 +2979,8 @@ namespace nirfmxlte_grpc { float64 pdcch_power = request->pdcch_power(); auto status = library_->CfgPDCCH(instrument, selector_string, pdcch_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3114,9 +3020,8 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPDSCH(instrument, selector_string, cw0_modulation_type, resource_block_allocation, power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3171,9 +3076,8 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPHICH(instrument, selector_string, resource, duration, power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3196,9 +3100,8 @@ namespace nirfmxlte_grpc { int32 modulation_type = request->modulation_type(); auto status = library_->CfgPSSCHModulationType(instrument, selector_string, modulation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3222,9 +3125,8 @@ namespace nirfmxlte_grpc { int32 number_of_resource_blocks = request->number_of_resource_blocks(); auto status = library_->CfgPSSCHResourceBlocks(instrument, selector_string, resource_block_offset, number_of_resource_blocks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3262,9 +3164,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgPUSCHModulationType(instrument, selector_string, modulation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3288,9 +3189,8 @@ namespace nirfmxlte_grpc { int32 number_of_resource_blocks = request->number_of_resource_blocks(); auto status = library_->CfgPUSCHResourceBlocks(instrument, selector_string, resource_block_offset, number_of_resource_blocks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3315,9 +3215,8 @@ namespace nirfmxlte_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3356,9 +3255,8 @@ namespace nirfmxlte_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3381,9 +3279,8 @@ namespace nirfmxlte_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3407,9 +3304,8 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3432,9 +3328,8 @@ namespace nirfmxlte_grpc { int32 transmit_antenna_to_analyze = request->transmit_antenna_to_analyze(); auto status = library_->CfgTransmitAntennaToAnalyze(instrument, selector_string, transmit_antenna_to_analyze); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3472,9 +3367,8 @@ namespace nirfmxlte_grpc { auto status = library_->CfgeNodeBCategory(instrument, selector_string, enodeb_category); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3497,9 +3391,8 @@ namespace nirfmxlte_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -3522,9 +3415,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3546,9 +3438,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3570,9 +3461,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3595,9 +3485,8 @@ namespace nirfmxlte_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3620,9 +3509,8 @@ namespace nirfmxlte_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3644,9 +3532,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3668,9 +3555,8 @@ namespace nirfmxlte_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3692,9 +3578,8 @@ namespace nirfmxlte_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3716,9 +3601,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3742,10 +3626,9 @@ namespace nirfmxlte_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -3756,10 +3639,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); @@ -3788,9 +3670,8 @@ namespace nirfmxlte_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3815,10 +3696,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -3827,10 +3707,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -3857,9 +3736,8 @@ namespace nirfmxlte_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3884,10 +3762,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -3896,10 +3773,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -3926,9 +3802,8 @@ namespace nirfmxlte_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3953,9 +3828,8 @@ namespace nirfmxlte_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); @@ -3986,10 +3860,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -3998,10 +3871,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); @@ -4042,9 +3914,8 @@ namespace nirfmxlte_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -4069,10 +3940,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -4081,10 +3951,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4111,9 +3980,8 @@ namespace nirfmxlte_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -4138,10 +4006,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -4149,10 +4016,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); @@ -4188,10 +4054,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -4199,10 +4064,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -4236,10 +4100,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -4247,10 +4110,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -4284,10 +4146,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string attr_val; @@ -4299,10 +4160,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); @@ -4329,9 +4189,8 @@ namespace nirfmxlte_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -4356,9 +4215,8 @@ namespace nirfmxlte_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -4383,10 +4241,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -4395,10 +4252,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4425,10 +4281,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -4437,10 +4292,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4467,9 +4321,8 @@ namespace nirfmxlte_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -4494,10 +4347,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -4505,10 +4357,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); @@ -4534,10 +4385,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; int32 error_code {}; @@ -4550,10 +4400,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -4580,10 +4429,9 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; std::string error_description; @@ -4595,10 +4443,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -4632,9 +4479,8 @@ namespace nirfmxlte_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXLTE_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); @@ -4669,9 +4515,8 @@ namespace nirfmxlte_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXLTE_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -4698,9 +4543,8 @@ namespace nirfmxlte_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4739,9 +4583,8 @@ namespace nirfmxlte_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4779,9 +4622,8 @@ namespace nirfmxlte_grpc { auto status = library_->ModAccCfgCommonClockSourceEnabled(instrument, selector_string, common_clock_source_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4819,9 +4661,8 @@ namespace nirfmxlte_grpc { auto status = library_->ModAccCfgEVMUnit(instrument, selector_string, evm_unit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4844,9 +4685,8 @@ namespace nirfmxlte_grpc { float64 fft_window_offset = request->fft_window_offset(); auto status = library_->ModAccCfgFFTWindowOffset(instrument, selector_string, fft_window_offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4886,9 +4726,8 @@ namespace nirfmxlte_grpc { float64 fft_window_length = request->fft_window_length(); auto status = library_->ModAccCfgFFTWindowPosition(instrument, selector_string, fft_window_type, fft_window_offset, fft_window_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4926,9 +4765,8 @@ namespace nirfmxlte_grpc { auto status = library_->ModAccCfgInBandEmissionMaskType(instrument, selector_string, in_band_emission_mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4968,9 +4806,8 @@ namespace nirfmxlte_grpc { int32 measurement_length = request->measurement_length(); auto status = library_->ModAccCfgSynchronizationModeAndInterval(instrument, selector_string, synchronization_mode, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4994,10 +4831,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCSRSConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector csrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchCSRSConstellation(instrument, selector_string, timeout, csrs_constellation.data(), array_size, &actual_array_size); @@ -5005,10 +4841,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(csrs_constellation, response->mutable_csrs_constellation()); { @@ -5042,9 +4877,8 @@ namespace nirfmxlte_grpc { float64 mean_rms_csrs_evm {}; auto status = library_->ModAccFetchCSRSEVM(instrument, selector_string, timeout, &mean_rms_csrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_csrs_evm(mean_rms_csrs_evm); return ::grpc::Status::OK; @@ -5069,10 +4903,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCSRSEVMArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); float64* mean_rms_csrs_evm = response->mutable_mean_rms_csrs_evm()->mutable_data(); auto array_size = actual_array_size; @@ -5081,10 +4914,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -5116,9 +4948,8 @@ namespace nirfmxlte_grpc { int32 peak_composite_evm_slot_index {}; auto status = library_->ModAccFetchCompositeEVM(instrument, selector_string, timeout, &mean_rms_composite_evm, &maximum_peak_composite_evm, &mean_frequency_error, &peak_composite_evm_symbol_index, &peak_composite_evm_subcarrier_index, &peak_composite_evm_slot_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_composite_evm(mean_rms_composite_evm); response->set_maximum_peak_composite_evm(maximum_peak_composite_evm); @@ -5148,10 +4979,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCompositeEVMArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); float64* mean_rms_composite_evm = response->mutable_mean_rms_composite_evm()->mutable_data(); response->mutable_maximum_peak_composite_evm()->Resize(actual_array_size, 0); @@ -5170,10 +5000,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); response->mutable_maximum_peak_composite_evm()->Resize(actual_array_size, 0); @@ -5208,9 +5037,8 @@ namespace nirfmxlte_grpc { float64 max_peak_composite_phase_error {}; auto status = library_->ModAccFetchCompositeMagnitudeAndPhaseError(instrument, selector_string, timeout, &mean_rms_composite_magnitude_error, &max_peak_composite_magnitude_error, &mean_rms_composite_phase_error, &max_peak_composite_phase_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_composite_magnitude_error(mean_rms_composite_magnitude_error); response->set_max_peak_composite_magnitude_error(max_peak_composite_magnitude_error); @@ -5238,10 +5066,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchCompositeMagnitudeAndPhaseErrorArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); float64* mean_rms_composite_magnitude_error = response->mutable_mean_rms_composite_magnitude_error()->mutable_data(); response->mutable_maximum_peak_composite_magnitude_error()->Resize(actual_array_size, 0); @@ -5256,10 +5083,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); response->mutable_maximum_peak_composite_magnitude_error()->Resize(actual_array_size, 0); @@ -5289,9 +5115,8 @@ namespace nirfmxlte_grpc { int32 detected_cell_id {}; auto status = library_->ModAccFetchDownlinkDetectedCellID(instrument, selector_string, timeout, &detected_cell_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_detected_cell_id(detected_cell_id); return ::grpc::Status::OK; @@ -5316,10 +5141,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkDetectedCellIDArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_detected_cell_id()->Resize(actual_array_size, 0); int32* detected_cell_id = reinterpret_cast(response->mutable_detected_cell_id()->mutable_data()); auto array_size = actual_array_size; @@ -5328,10 +5152,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_detected_cell_id()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -5358,10 +5181,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPBCHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pbch_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPBCHConstellation(instrument, selector_string, timeout, pbch_constellation.data(), array_size, &actual_array_size); @@ -5369,10 +5191,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pbch_constellation, response->mutable_pbch_constellation()); { @@ -5406,10 +5227,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPCFICHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pcfich_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPCFICHConstellation(instrument, selector_string, timeout, pcfich_constellation.data(), array_size, &actual_array_size); @@ -5417,10 +5237,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pcfich_constellation, response->mutable_pcfich_constellation()); { @@ -5454,10 +5273,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPDCCHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pdcch_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPDCCHConstellation(instrument, selector_string, timeout, pdcch_constellation.data(), array_size, &actual_array_size); @@ -5465,10 +5283,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pdcch_constellation, response->mutable_pdcch_constellation()); { @@ -5502,10 +5319,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkPHICHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector phich_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchDownlinkPHICHConstellation(instrument, selector_string, timeout, phich_constellation.data(), array_size, &actual_array_size); @@ -5513,10 +5329,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(phich_constellation, response->mutable_phich_constellation()); { @@ -5553,9 +5368,8 @@ namespace nirfmxlte_grpc { float64 ofdm_symbol_transmit_power {}; auto status = library_->ModAccFetchDownlinkTransmitPower(instrument, selector_string, timeout, &rs_transmit_power, &ofdm_symbol_transmit_power, reserved1, reserved2); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_rs_transmit_power(rs_transmit_power); response->set_ofdm_symbol_transmit_power(ofdm_symbol_transmit_power); @@ -5583,10 +5397,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchDownlinkTransmitPowerArray(instrument, selector_string, timeout, nullptr, nullptr, reserved1, reserved2, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); float64* rs_transmit_power = response->mutable_rs_transmit_power()->mutable_data(); response->mutable_ofdm_symbol_transmit_power()->Resize(actual_array_size, 0); @@ -5597,10 +5410,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); response->mutable_ofdm_symbol_transmit_power()->Resize(actual_array_size, 0); @@ -5630,10 +5442,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMHighPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_evm_high_per_symbol()->Resize(actual_array_size, 0); float32* evm_high_per_symbol = response->mutable_evm_high_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5642,10 +5453,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5676,10 +5486,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMLowPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_evm_low_per_symbol()->Resize(actual_array_size, 0); float32* evm_low_per_symbol = response->mutable_evm_low_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5688,10 +5497,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5722,10 +5530,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMPerSlotTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_per_slot()->Resize(actual_array_size, 0); float32* rms_evm_per_slot = response->mutable_rms_evm_per_slot()->mutable_data(); auto array_size = actual_array_size; @@ -5734,10 +5541,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5768,10 +5574,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMPerSubcarrierTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* mean_rms_evm_per_subcarrier = response->mutable_mean_rms_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5780,10 +5585,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5814,10 +5618,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchEVMPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_per_symbol()->Resize(actual_array_size, 0); float32* rms_evm_per_symbol = response->mutable_rms_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5826,10 +5629,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5860,9 +5662,8 @@ namespace nirfmxlte_grpc { float64 mean_iq_quadrature_error {}; auto status = library_->ModAccFetchIQImpairments(instrument, selector_string, timeout, &mean_iq_origin_offset, &mean_iq_gain_imbalance, &mean_iq_quadrature_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_iq_origin_offset(mean_iq_origin_offset); response->set_mean_iq_gain_imbalance(mean_iq_gain_imbalance); @@ -5889,10 +5690,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchIQImpairmentsArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); float64* mean_iq_origin_offset = response->mutable_mean_iq_origin_offset()->mutable_data(); response->mutable_mean_iq_gain_imbalance()->Resize(actual_array_size, 0); @@ -5905,10 +5705,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); response->mutable_mean_iq_gain_imbalance()->Resize(actual_array_size, 0); @@ -5937,9 +5736,8 @@ namespace nirfmxlte_grpc { float64 in_band_emission_margin {}; auto status = library_->ModAccFetchInBandEmissionMargin(instrument, selector_string, timeout, &in_band_emission_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_in_band_emission_margin(in_band_emission_margin); return ::grpc::Status::OK; @@ -5964,10 +5762,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchInBandEmissionMarginArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); float64* in_band_emission_margin = response->mutable_in_band_emission_margin()->mutable_data(); auto array_size = actual_array_size; @@ -5976,10 +5773,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6008,10 +5804,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchInBandEmissionTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_in_band_emission()->Resize(actual_array_size, 0); float32* in_band_emission = response->mutable_in_band_emission()->mutable_data(); response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -6022,10 +5817,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6057,10 +5851,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumEVMPerSlotTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_maximum_evm_per_slot()->Resize(actual_array_size, 0); float32* maximum_evm_per_slot = response->mutable_maximum_evm_per_slot()->mutable_data(); auto array_size = actual_array_size; @@ -6069,10 +5862,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6103,10 +5895,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumEVMPerSubcarrierTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_maximum_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* maximum_evm_per_subcarrier = response->mutable_maximum_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -6115,10 +5906,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6149,10 +5939,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumEVMPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_maximum_evm_per_symbol()->Resize(actual_array_size, 0); float32* maximum_evm_per_symbol = response->mutable_maximum_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -6161,10 +5950,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6195,10 +5983,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumMagnitudeErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_maximum_magnitude_error_per_symbol()->Resize(actual_array_size, 0); float32* maximum_magnitude_error_per_symbol = response->mutable_maximum_magnitude_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -6207,10 +5994,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6241,10 +6027,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchMaximumPhaseErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_maximum_phase_error_per_symbol()->Resize(actual_array_size, 0); float32* maximum_phase_error_per_symbol = response->mutable_maximum_phase_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -6253,10 +6038,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6286,10 +6070,9 @@ namespace nirfmxlte_grpc { int32 dmrs_constellation_actual_array_size {}; while (true) { auto status = library_->ModAccFetchNPUSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); auto data_constellation_array_size = data_constellation_actual_array_size; @@ -6299,10 +6082,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(data_constellation, response->mutable_data_constellation()); { @@ -6346,9 +6128,8 @@ namespace nirfmxlte_grpc { float64 npusch_maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchNPUSCHDMRSEVM(instrument, selector_string, timeout, &npusch_mean_rms_dmrs_evm, &npusch_maximum_peak_dmrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_npusch_mean_rms_dmrs_evm(npusch_mean_rms_dmrs_evm); response->set_npusch_maximum_peak_dmrs_evm(npusch_maximum_peak_dmrs_evm); @@ -6375,9 +6156,8 @@ namespace nirfmxlte_grpc { float64 npusch_maximum_peak_data_evm {}; auto status = library_->ModAccFetchNPUSCHDataEVM(instrument, selector_string, timeout, &npusch_mean_rms_data_evm, &npusch_maximum_peak_data_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_npusch_mean_rms_data_evm(npusch_mean_rms_data_evm); response->set_npusch_maximum_peak_data_evm(npusch_maximum_peak_data_evm); @@ -6404,9 +6184,8 @@ namespace nirfmxlte_grpc { float64 npusch_mean_dmrs_power {}; auto status = library_->ModAccFetchNPUSCHSymbolPower(instrument, selector_string, timeout, &npusch_mean_data_power, &npusch_mean_dmrs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_npusch_mean_data_power(npusch_mean_data_power); response->set_npusch_mean_dmrs_power(npusch_mean_dmrs_power); @@ -6432,10 +6211,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH1024QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam1024_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH1024QAMConstellation(instrument, selector_string, timeout, qam1024_constellation.data(), array_size, &actual_array_size); @@ -6443,10 +6221,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); { @@ -6480,9 +6257,8 @@ namespace nirfmxlte_grpc { float64 mean_rms_1024qam_evm {}; auto status = library_->ModAccFetchPDSCH1024QAMEVM(instrument, selector_string, timeout, &mean_rms_1024qam_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_1024qam_evm(mean_rms_1024qam_evm); return ::grpc::Status::OK; @@ -6507,10 +6283,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH1024QAMEVMArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); float64* mean_rms_1024qam_evm = response->mutable_mean_rms_1024qam_evm()->mutable_data(); auto array_size = actual_array_size; @@ -6519,10 +6294,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6549,10 +6323,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH16QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam16_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH16QAMConstellation(instrument, selector_string, timeout, qam16_constellation.data(), array_size, &actual_array_size); @@ -6560,10 +6333,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); { @@ -6597,10 +6369,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH256QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam256_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH256QAMConstellation(instrument, selector_string, timeout, qam256_constellation.data(), array_size, &actual_array_size); @@ -6608,10 +6379,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); { @@ -6645,10 +6415,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH64QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam64_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH64QAMConstellation(instrument, selector_string, timeout, qam64_constellation.data(), array_size, &actual_array_size); @@ -6656,10 +6425,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); { @@ -6697,9 +6465,8 @@ namespace nirfmxlte_grpc { float64 mean_rms_256qam_evm {}; auto status = library_->ModAccFetchPDSCHEVM(instrument, selector_string, timeout, &mean_rms_evm, &mean_rms_qpsk_evm, &mean_rms_16qam_evm, &mean_rms_64qam_evm, &mean_rms_256qam_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_evm(mean_rms_evm); response->set_mean_rms_qpsk_evm(mean_rms_qpsk_evm); @@ -6728,10 +6495,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHEVMArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); float64* mean_rms_evm = response->mutable_mean_rms_evm()->mutable_data(); response->mutable_mean_rms_qpsk_evm()->Resize(actual_array_size, 0); @@ -6748,10 +6514,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_qpsk_evm()->Resize(actual_array_size, 0); @@ -6782,10 +6547,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHQPSKConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qpsk_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHQPSKConstellation(instrument, selector_string, timeout, qpsk_constellation.data(), array_size, &actual_array_size); @@ -6793,10 +6557,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); { @@ -6831,10 +6594,9 @@ namespace nirfmxlte_grpc { int32 dmrs_constellation_actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); auto data_constellation_array_size = data_constellation_actual_array_size; @@ -6844,10 +6606,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(data_constellation, response->mutable_data_constellation()); { @@ -6891,9 +6652,8 @@ namespace nirfmxlte_grpc { float64 pssch_maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchPSSCHDMRSEVM(instrument, selector_string, timeout, &pssch_mean_rms_dmrs_evm, &pssch_maximum_peak_dmrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pssch_mean_rms_dmrs_evm(pssch_mean_rms_dmrs_evm); response->set_pssch_maximum_peak_dmrs_evm(pssch_maximum_peak_dmrs_evm); @@ -6919,10 +6679,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHDMRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); float64* pssch_mean_rms_dmrs_evm = response->mutable_pssch_mean_rms_dmrs_evm()->mutable_data(); response->mutable_pssch_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); @@ -6933,10 +6692,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); response->mutable_pssch_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); @@ -6965,9 +6723,8 @@ namespace nirfmxlte_grpc { float64 pssch_maximum_peak_data_evm {}; auto status = library_->ModAccFetchPSSCHDataEVM(instrument, selector_string, timeout, &pssch_mean_rms_data_evm, &pssch_maximum_peak_data_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pssch_mean_rms_data_evm(pssch_mean_rms_data_evm); response->set_pssch_maximum_peak_data_evm(pssch_maximum_peak_data_evm); @@ -6993,10 +6750,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHDataEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); float64* pssch_mean_rms_data_evm = response->mutable_pssch_mean_rms_data_evm()->mutable_data(); response->mutable_pssch_maximum_peak_data_evm()->Resize(actual_array_size, 0); @@ -7007,10 +6763,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); response->mutable_pssch_maximum_peak_data_evm()->Resize(actual_array_size, 0); @@ -7039,9 +6794,8 @@ namespace nirfmxlte_grpc { float64 pssch_mean_dmrs_power {}; auto status = library_->ModAccFetchPSSCHSymbolPower(instrument, selector_string, timeout, &pssch_mean_data_power, &pssch_mean_dmrs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pssch_mean_data_power(pssch_mean_data_power); response->set_pssch_mean_dmrs_power(pssch_mean_dmrs_power); @@ -7067,10 +6821,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSCHSymbolPowerArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); float64* pssch_mean_data_power = response->mutable_pssch_mean_data_power()->mutable_data(); response->mutable_pssch_mean_dmrs_power()->Resize(actual_array_size, 0); @@ -7081,10 +6834,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); response->mutable_pssch_mean_dmrs_power()->Resize(actual_array_size, 0); @@ -7113,10 +6865,9 @@ namespace nirfmxlte_grpc { int32 dmrs_constellation_actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); auto data_constellation_array_size = data_constellation_actual_array_size; @@ -7126,10 +6877,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(data_constellation, response->mutable_data_constellation()); { @@ -7173,9 +6923,8 @@ namespace nirfmxlte_grpc { float64 maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchPUSCHDMRSEVM(instrument, selector_string, timeout, &mean_rms_dmrs_evm, &maximum_peak_dmrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_dmrs_evm(mean_rms_dmrs_evm); response->set_maximum_peak_dmrs_evm(maximum_peak_dmrs_evm); @@ -7201,10 +6950,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDMRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); float64* mean_rms_dmrs_evm = response->mutable_mean_rms_dmrs_evm()->mutable_data(); response->mutable_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); @@ -7215,10 +6963,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); response->mutable_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); @@ -7247,9 +6994,8 @@ namespace nirfmxlte_grpc { float64 maximum_peak_data_evm {}; auto status = library_->ModAccFetchPUSCHDataEVM(instrument, selector_string, timeout, &mean_rms_data_evm, &maximum_peak_data_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_data_evm(mean_rms_data_evm); response->set_maximum_peak_data_evm(maximum_peak_data_evm); @@ -7275,10 +7021,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDataEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); float64* mean_rms_data_evm = response->mutable_mean_rms_data_evm()->mutable_data(); response->mutable_maximum_peak_data_evm()->Resize(actual_array_size, 0); @@ -7289,10 +7034,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); response->mutable_maximum_peak_data_evm()->Resize(actual_array_size, 0); @@ -7320,10 +7064,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, bits.data(), array_size, &actual_array_size); @@ -7331,10 +7074,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_bits()->Clear(); response->mutable_bits()->Reserve(actual_array_size); @@ -7371,9 +7113,8 @@ namespace nirfmxlte_grpc { float64 pusch_mean_dmrs_power {}; auto status = library_->ModAccFetchPUSCHSymbolPower(instrument, selector_string, timeout, &pusch_mean_data_power, &pusch_mean_dmrs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pusch_mean_data_power(pusch_mean_data_power); response->set_pusch_mean_dmrs_power(pusch_mean_dmrs_power); @@ -7399,10 +7140,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHSymbolPowerArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); float64* pusch_mean_data_power = response->mutable_pusch_mean_data_power()->mutable_data(); response->mutable_pusch_mean_dmrs_power()->Resize(actual_array_size, 0); @@ -7413,10 +7153,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); response->mutable_pusch_mean_dmrs_power()->Resize(actual_array_size, 0); @@ -7446,10 +7185,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSMagnitudeErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_magnitude_error_per_symbol()->Resize(actual_array_size, 0); float32* rms_magnitude_error_per_symbol = response->mutable_rms_magnitude_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -7458,10 +7196,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -7492,10 +7229,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSPhaseErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_phase_error_per_symbol()->Resize(actual_array_size, 0); float32* rms_phase_error_per_symbol = response->mutable_rms_phase_error_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -7504,10 +7240,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -7536,10 +7271,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSRSConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector srs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchSRSConstellation(instrument, selector_string, timeout, srs_constellation.data(), array_size, &actual_array_size); @@ -7547,10 +7281,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(srs_constellation, response->mutable_srs_constellation()); { @@ -7585,9 +7318,8 @@ namespace nirfmxlte_grpc { float64 mean_srs_power {}; auto status = library_->ModAccFetchSRSEVM(instrument, selector_string, timeout, &mean_rms_srs_evm, &mean_srs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_srs_evm(mean_rms_srs_evm); response->set_mean_srs_power(mean_srs_power); @@ -7613,10 +7345,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); float64* mean_rms_srs_evm = response->mutable_mean_rms_srs_evm()->mutable_data(); response->mutable_mean_srs_power()->Resize(actual_array_size, 0); @@ -7627,10 +7358,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); response->mutable_mean_srs_power()->Resize(actual_array_size, 0); @@ -7661,9 +7391,8 @@ namespace nirfmxlte_grpc { float64 range2_maximum_to_range1_minimum {}; auto status = library_->ModAccFetchSpectralFlatness(instrument, selector_string, timeout, &range1_maximum_to_range1_minimum, &range2_maximum_to_range2_minimum, &range1_maximum_to_range2_minimum, &range2_maximum_to_range1_minimum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_range1_maximum_to_range1_minimum(range1_maximum_to_range1_minimum); response->set_range2_maximum_to_range2_minimum(range2_maximum_to_range2_minimum); @@ -7691,10 +7420,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSpectralFlatnessArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); float64* range1_maximum_to_range1_minimum = response->mutable_range1_maximum_to_range1_minimum()->mutable_data(); response->mutable_range2_maximum_to_range2_minimum()->Resize(actual_array_size, 0); @@ -7709,10 +7437,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); response->mutable_range2_maximum_to_range2_minimum()->Resize(actual_array_size, 0); @@ -7744,10 +7471,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSpectralFlatnessTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectral_flatness()->Resize(actual_array_size, 0); float32* spectral_flatness = response->mutable_spectral_flatness()->mutable_data(); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); @@ -7760,10 +7486,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -7796,9 +7521,8 @@ namespace nirfmxlte_grpc { float64 subblock_mean_iq_quadrature_error {}; auto status = library_->ModAccFetchSubblockIQImpairments(instrument, selector_string, timeout, &subblock_mean_iq_origin_offset, &subblock_mean_iq_gain_imbalance, &subblock_mean_iq_quadrature_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_mean_iq_origin_offset(subblock_mean_iq_origin_offset); response->set_subblock_mean_iq_gain_imbalance(subblock_mean_iq_gain_imbalance); @@ -7825,9 +7549,8 @@ namespace nirfmxlte_grpc { float64 subblock_in_band_emission_margin {}; auto status = library_->ModAccFetchSubblockInBandEmissionMargin(instrument, selector_string, timeout, &subblock_in_band_emission_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_in_band_emission_margin(subblock_in_band_emission_margin); return ::grpc::Status::OK; @@ -7852,10 +7575,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSubblockInBandEmissionTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); float64* subblock_in_band_emission = response->mutable_subblock_in_band_emission()->mutable_data(); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -7868,10 +7590,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -7900,10 +7621,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSynchronizationSignalConstellation(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector sss_constellation(actual_array_size, NIComplexSingle()); std::vector pss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -7912,10 +7632,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); { @@ -7958,9 +7677,8 @@ namespace nirfmxlte_grpc { float64 mean_rms_sss_evm {}; auto status = library_->ModAccFetchSynchronizationSignalEVM(instrument, selector_string, timeout, &mean_rms_pss_evm, &mean_rms_sss_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_rms_pss_evm(mean_rms_pss_evm); response->set_mean_rms_sss_evm(mean_rms_sss_evm); @@ -7986,10 +7704,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSynchronizationSignalEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); float64* mean_rms_pss_evm = response->mutable_mean_rms_pss_evm()->mutable_data(); response->mutable_mean_rms_sss_evm()->Resize(actual_array_size, 0); @@ -8000,10 +7717,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); response->mutable_mean_rms_sss_evm()->Resize(actual_array_size, 0); @@ -8062,9 +7778,8 @@ namespace nirfmxlte_grpc { auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8119,9 +7834,8 @@ namespace nirfmxlte_grpc { auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8160,9 +7874,8 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8189,9 +7902,8 @@ namespace nirfmxlte_grpc { float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &absolute_power, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_occupied_bandwidth(occupied_bandwidth); response->set_absolute_power(absolute_power); @@ -8221,10 +7933,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OBWFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -8233,10 +7944,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -8296,9 +8006,8 @@ namespace nirfmxlte_grpc { auto status = library_->PVTCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8336,9 +8045,8 @@ namespace nirfmxlte_grpc { auto status = library_->PVTCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8362,9 +8070,8 @@ namespace nirfmxlte_grpc { float64 off_power_exclusion_after = request->off_power_exclusion_after(); auto status = library_->PVTCfgOFFPowerExclusionPeriods(instrument, selector_string, off_power_exclusion_before, off_power_exclusion_after); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8392,9 +8099,8 @@ namespace nirfmxlte_grpc { float64 burst_width {}; auto status = library_->PVTFetchMeasurement(instrument, selector_string, timeout, &measurement_status, &mean_absolute_off_power_before, &mean_absolute_off_power_after, &mean_absolute_on_power, &burst_width); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -8424,10 +8130,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_mean_absolute_off_power_before()->Resize(actual_array_size, 0); @@ -8444,10 +8149,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -8489,10 +8193,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_signal_power()->Resize(actual_array_size, 0); float32* signal_power = response->mutable_signal_power()->mutable_data(); response->mutable_absolute_limit()->Resize(actual_array_size, 0); @@ -8503,10 +8206,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -8535,9 +8237,8 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8559,9 +8260,8 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8616,9 +8316,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8641,9 +8340,8 @@ namespace nirfmxlte_grpc { float64 component_carrier_maximum_output_power = request->component_carrier_maximum_output_power(); auto status = library_->SEMCfgComponentCarrierMaximumOutputPower(instrument, selector_string, component_carrier_maximum_output_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8667,9 +8365,8 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->component_carrier_maximum_output_power().size()); auto status = library_->SEMCfgComponentCarrierMaximumOutputPowerArray(instrument, selector_string, component_carrier_maximum_output_power, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8709,9 +8406,8 @@ namespace nirfmxlte_grpc { float64 aggregated_maximum_power = request->aggregated_maximum_power(); auto status = library_->SEMCfgDownlinkMask(instrument, selector_string, downlink_mask_type, delta_f_maximum, aggregated_maximum_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8734,9 +8430,8 @@ namespace nirfmxlte_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8760,9 +8455,8 @@ namespace nirfmxlte_grpc { float64 offset_absolute_limit_stop = request->offset_absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, offset_absolute_limit_start, offset_absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8803,9 +8497,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, offset_absolute_limit_start, offset_absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8828,9 +8521,8 @@ namespace nirfmxlte_grpc { int32 offset_bandwidth_integral = request->offset_bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, offset_bandwidth_integral); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8854,9 +8546,8 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->offset_bandwidth_integral().size()); auto status = library_->SEMCfgOffsetBandwidthIntegralArray(instrument, selector_string, offset_bandwidth_integral, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8896,9 +8587,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8950,9 +8640,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8990,9 +8679,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9024,9 +8712,8 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->limit_fail_mask().size()); auto status = library_->SEMCfgOffsetLimitFailMaskArray(instrument, selector_string, limit_fail_mask, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9065,9 +8752,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, offset_rbw, offset_rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9116,9 +8802,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, offset_rbw, offset_rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9142,9 +8827,8 @@ namespace nirfmxlte_grpc { float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_start, relative_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9185,9 +8869,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9226,9 +8909,8 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9266,9 +8948,8 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgUplinkMaskType(instrument, selector_string, uplink_mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9293,9 +8974,8 @@ namespace nirfmxlte_grpc { float64 relative_integrated_power {}; auto status = library_->SEMFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_integrated_power(absolute_integrated_power); response->set_relative_integrated_power(relative_integrated_power); @@ -9321,10 +9001,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9335,10 +9014,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9370,9 +9048,8 @@ namespace nirfmxlte_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -9402,10 +9079,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -9422,10 +9098,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -9469,9 +9144,8 @@ namespace nirfmxlte_grpc { float64 relative_peak_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power, &absolute_peak_power, &peak_frequency, &relative_peak_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_integrated_power(absolute_integrated_power); response->set_relative_integrated_power(relative_integrated_power); @@ -9500,10 +9174,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9520,10 +9193,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9554,9 +9226,8 @@ namespace nirfmxlte_grpc { int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -9584,10 +9255,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); response->mutable_composite_mask()->Resize(actual_array_size, 0); @@ -9598,10 +9268,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -9633,9 +9302,8 @@ namespace nirfmxlte_grpc { float64 frequency {}; auto status = library_->SEMFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); @@ -9662,9 +9330,8 @@ namespace nirfmxlte_grpc { float64 total_aggregated_power {}; auto status = library_->SEMFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; @@ -9693,9 +9360,8 @@ namespace nirfmxlte_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -9725,10 +9391,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -9745,10 +9410,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -9792,9 +9456,8 @@ namespace nirfmxlte_grpc { float64 relative_peak_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power, &absolute_peak_power, &peak_frequency, &relative_peak_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_integrated_power(absolute_integrated_power); response->set_relative_integrated_power(relative_integrated_power); @@ -9823,10 +9486,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9843,10 +9505,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); @@ -9892,9 +9553,8 @@ namespace nirfmxlte_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9915,9 +9575,8 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9941,9 +9600,8 @@ namespace nirfmxlte_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9968,9 +9626,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9994,9 +9651,8 @@ namespace nirfmxlte_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10021,9 +9677,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10056,9 +9711,8 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10100,9 +9754,8 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10135,9 +9788,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10161,9 +9813,8 @@ namespace nirfmxlte_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10188,9 +9839,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10223,9 +9873,8 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10270,9 +9919,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10300,9 +9948,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10327,9 +9974,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10372,9 +10018,8 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10407,9 +10052,8 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10436,9 +10080,8 @@ namespace nirfmxlte_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10463,9 +10106,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10490,9 +10132,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10516,9 +10157,8 @@ namespace nirfmxlte_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10543,9 +10183,8 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10585,9 +10224,8 @@ namespace nirfmxlte_grpc { int32 measurement_length = request->measurement_length(); auto status = library_->SlotPhaseCfgSynchronizationModeAndInterval(instrument, selector_string, synchronization_mode, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10611,9 +10249,8 @@ namespace nirfmxlte_grpc { float64 maximum_phase_discontinuity {}; auto status = library_->SlotPhaseFetchMaximumPhaseDiscontinuity(instrument, selector_string, timeout, &maximum_phase_discontinuity); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_maximum_phase_discontinuity(maximum_phase_discontinuity); return ::grpc::Status::OK; @@ -10638,10 +10275,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchMaximumPhaseDiscontinuityArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); float64* maximum_phase_discontinuity = response->mutable_maximum_phase_discontinuity()->mutable_data(); auto array_size = actual_array_size; @@ -10650,10 +10286,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -10680,10 +10315,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchPhaseDiscontinuities(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); float64* slot_phase_discontinuity = response->mutable_slot_phase_discontinuity()->mutable_data(); auto array_size = actual_array_size; @@ -10692,10 +10326,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -10724,10 +10357,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchSamplePhaseError(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_sample_phase_error()->Resize(actual_array_size, 0); float32* sample_phase_error = response->mutable_sample_phase_error()->mutable_data(); auto array_size = actual_array_size; @@ -10736,10 +10368,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -10770,10 +10401,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPhaseFetchSamplePhaseErrorLinearFitTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_sample_phase_error_linear_fit()->Resize(actual_array_size, 0); float32* sample_phase_error_linear_fit = response->mutable_sample_phase_error_linear_fit()->mutable_data(); auto array_size = actual_array_size; @@ -10782,10 +10412,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -10814,9 +10443,8 @@ namespace nirfmxlte_grpc { int32 measurement_length = request->measurement_length(); auto status = library_->SlotPowerCfgMeasurementInterval(instrument, selector_string, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10840,10 +10468,9 @@ namespace nirfmxlte_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SlotPowerFetchPowers(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_subframe_power()->Resize(actual_array_size, 0); float64* subframe_power = response->mutable_subframe_power()->mutable_data(); response->mutable_subframe_power_delta()->Resize(actual_array_size, 0); @@ -10854,10 +10481,9 @@ namespace nirfmxlte_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_subframe_power()->Resize(actual_array_size, 0); response->mutable_subframe_power_delta()->Resize(actual_array_size, 0); @@ -10883,9 +10509,8 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10908,9 +10533,8 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxnr/nirfmxnr_service.cpp b/generated/nirfmxnr/nirfmxnr_service.cpp index 6ca23b392..e91e1c363 100644 --- a/generated/nirfmxnr/nirfmxnr_service.cpp +++ b/generated/nirfmxnr/nirfmxnr_service.cpp @@ -93,9 +93,8 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -133,9 +132,8 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -173,9 +171,8 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -198,9 +195,8 @@ namespace nirfmxnr_grpc { int32 number_of_endc_offsets = request->number_of_endc_offsets(); auto status = library_->ACPCfgNumberOfENDCOffsets(instrument, selector_string, number_of_endc_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -223,9 +219,8 @@ namespace nirfmxnr_grpc { int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgNumberOfEUTRAOffsets(instrument, selector_string, number_of_eutra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -248,9 +243,8 @@ namespace nirfmxnr_grpc { int32 number_of_nr_offsets = request->number_of_nr_offsets(); auto status = library_->ACPCfgNumberOfNROffsets(instrument, selector_string, number_of_nr_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -273,9 +267,8 @@ namespace nirfmxnr_grpc { int32 number_of_utra_offsets = request->number_of_utra_offsets(); auto status = library_->ACPCfgNumberOfUTRAOffsets(instrument, selector_string, number_of_utra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -313,9 +306,8 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -370,9 +362,8 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -411,9 +402,8 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -440,10 +430,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -452,10 +441,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -485,9 +473,8 @@ namespace nirfmxnr_grpc { float64 relative_power {}; auto status = library_->ACPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); @@ -513,10 +500,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -527,10 +513,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -561,9 +546,8 @@ namespace nirfmxnr_grpc { float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); @@ -591,10 +575,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -609,10 +592,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_lower_relative_power()->Resize(actual_array_size, 0); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -645,10 +627,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -657,10 +638,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -691,10 +671,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -703,10 +682,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -737,9 +715,8 @@ namespace nirfmxnr_grpc { float64 frequency {}; auto status = library_->ACPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); @@ -766,9 +743,8 @@ namespace nirfmxnr_grpc { float64 total_aggregated_power {}; auto status = library_->ACPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; @@ -792,9 +768,8 @@ namespace nirfmxnr_grpc { int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -818,9 +793,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -849,9 +823,8 @@ namespace nirfmxnr_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -880,9 +853,8 @@ namespace nirfmxnr_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -906,9 +878,8 @@ namespace nirfmxnr_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_level(reference_level); return ::grpc::Status::OK; @@ -931,10 +902,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildBandwidthPartString(selector_string, bandwidth_part_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -946,10 +916,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -974,10 +943,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCORESETClusterString(selector_string, coreset_cluster_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -989,10 +957,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1017,10 +984,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCORESETString(selector_string, coreset_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1032,10 +998,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1060,10 +1025,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1075,10 +1039,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1104,10 +1067,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildListStepString(list_name, result_name, step_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -1119,10 +1081,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -1147,10 +1108,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildListString(list_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -1162,10 +1122,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -1190,10 +1149,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1205,10 +1163,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1233,10 +1190,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDCCHString(selector_string, pdcch_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1248,10 +1204,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1276,10 +1231,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDSCHClusterString(selector_string, pdsch_cluster_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1291,10 +1245,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1319,10 +1272,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDSCHString(selector_string, pdsch_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1334,10 +1286,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1362,10 +1313,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPUSCHClusterString(selector_string, pusch_cluster_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1377,10 +1327,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1405,10 +1354,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPUSCHString(selector_string, pusch_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1420,10 +1368,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1448,10 +1395,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -1463,10 +1409,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -1491,10 +1436,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildSubblockString(selector_string, subblock_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1506,10 +1450,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1534,10 +1477,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildUserString(selector_string, user_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -1549,10 +1491,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -1610,9 +1551,8 @@ namespace nirfmxnr_grpc { auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1667,9 +1607,8 @@ namespace nirfmxnr_grpc { auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1708,9 +1647,8 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1735,9 +1673,8 @@ namespace nirfmxnr_grpc { float64 relative_power {}; auto status = library_->CHPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); @@ -1763,10 +1700,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -1777,10 +1713,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_relative_power()->Resize(actual_array_size, 0); @@ -1810,10 +1745,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1822,10 +1756,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1854,9 +1787,8 @@ namespace nirfmxnr_grpc { float64 subblock_power {}; auto status = library_->CHPFetchSubblockPower(instrument, selector_string, timeout, &subblock_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_power(subblock_power); return ::grpc::Status::OK; @@ -1881,9 +1813,8 @@ namespace nirfmxnr_grpc { float64 total_aggregated_power {}; auto status = library_->CHPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; @@ -1907,9 +1838,8 @@ namespace nirfmxnr_grpc { int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -1971,9 +1901,8 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1996,9 +1925,8 @@ namespace nirfmxnr_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2021,9 +1949,8 @@ namespace nirfmxnr_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2066,9 +1993,8 @@ namespace nirfmxnr_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2143,9 +2069,8 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2184,9 +2109,8 @@ namespace nirfmxnr_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2211,9 +2135,8 @@ namespace nirfmxnr_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2252,9 +2175,8 @@ namespace nirfmxnr_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2277,9 +2199,8 @@ namespace nirfmxnr_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2303,9 +2224,8 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2343,9 +2263,8 @@ namespace nirfmxnr_grpc { auto status = library_->CfggNodeBCategory(instrument, selector_string, gnodeb_category); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2368,9 +2287,8 @@ namespace nirfmxnr_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -2393,9 +2311,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2417,9 +2334,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2441,9 +2357,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2466,9 +2381,8 @@ namespace nirfmxnr_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2491,9 +2405,8 @@ namespace nirfmxnr_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2515,9 +2428,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2539,9 +2451,8 @@ namespace nirfmxnr_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->CreateList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2564,9 +2475,8 @@ namespace nirfmxnr_grpc { int32 created_step_index {}; auto status = library_->CreateListStep(instrument, selector_string, &created_step_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_created_step_index(created_step_index); return ::grpc::Status::OK; @@ -2589,9 +2499,8 @@ namespace nirfmxnr_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2613,9 +2522,8 @@ namespace nirfmxnr_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->DeleteList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2637,9 +2545,8 @@ namespace nirfmxnr_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2661,9 +2568,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2687,10 +2593,9 @@ namespace nirfmxnr_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -2701,10 +2606,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); @@ -2733,9 +2637,8 @@ namespace nirfmxnr_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2760,10 +2663,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -2772,10 +2674,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2802,9 +2703,8 @@ namespace nirfmxnr_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2829,10 +2729,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -2841,10 +2740,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2871,9 +2769,8 @@ namespace nirfmxnr_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2898,9 +2795,8 @@ namespace nirfmxnr_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); @@ -2931,10 +2827,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -2943,10 +2838,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); @@ -2987,9 +2881,8 @@ namespace nirfmxnr_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3014,10 +2907,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -3026,10 +2918,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -3056,9 +2947,8 @@ namespace nirfmxnr_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3083,10 +2973,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -3094,10 +2983,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); @@ -3133,10 +3021,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -3144,10 +3031,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -3181,10 +3067,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -3192,10 +3077,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -3229,10 +3113,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string attr_val; @@ -3244,10 +3127,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); @@ -3274,9 +3156,8 @@ namespace nirfmxnr_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3301,9 +3182,8 @@ namespace nirfmxnr_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3328,10 +3208,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -3340,10 +3219,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -3370,10 +3248,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -3382,10 +3259,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -3412,9 +3288,8 @@ namespace nirfmxnr_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -3439,10 +3314,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -3450,10 +3324,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); @@ -3479,10 +3352,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; int32 error_code {}; @@ -3495,10 +3367,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -3525,10 +3396,9 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; std::string error_description; @@ -3540,10 +3410,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -3577,9 +3446,8 @@ namespace nirfmxnr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXNR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); @@ -3614,9 +3482,8 @@ namespace nirfmxnr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXNR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -3643,9 +3510,8 @@ namespace nirfmxnr_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3668,9 +3534,8 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); auto status = library_->ModAccAutoLevel(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3708,9 +3573,8 @@ namespace nirfmxnr_grpc { auto status = library_->ModAccCfgMeasurementMode(instrument, selector_string, measurement_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3748,9 +3612,8 @@ namespace nirfmxnr_grpc { auto status = library_->ModAccCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3776,9 +3639,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->reference_waveform().size()); auto status = library_->ModAccCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3799,9 +3661,8 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ModAccClearNoiseCalibrationDatabase(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3826,9 +3687,8 @@ namespace nirfmxnr_grpc { float64 composite_peak_evm_maximum {}; auto status = library_->ModAccFetchCompositeEVM(instrument, selector_string, timeout, &composite_rms_evm_mean, &composite_peak_evm_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_composite_rms_evm_mean(composite_rms_evm_mean); response->set_composite_peak_evm_maximum(composite_peak_evm_maximum); @@ -3854,9 +3714,8 @@ namespace nirfmxnr_grpc { float64 frequency_error_mean {}; auto status = library_->ModAccFetchFrequencyErrorMean(instrument, selector_string, timeout, &frequency_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_frequency_error_mean(frequency_error_mean); return ::grpc::Status::OK; @@ -3883,10 +3742,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchIQGainImbalancePerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_gain_imbalance_per_subcarrier_mean = response->mutable_iq_gain_imbalance_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3895,10 +3753,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3929,10 +3786,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_quadrature_error_per_subcarrier_mean = response->mutable_iq_quadrature_error_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3941,10 +3797,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3975,10 +3830,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchInBandEmissionTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_in_band_emission()->Resize(actual_array_size, 0); float32* in_band_emission = response->mutable_in_band_emission()->mutable_data(); response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -3989,10 +3843,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4022,10 +3875,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pbch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPBCHDMRSConstellationTrace(instrument, selector_string, timeout, pbch_dmrs_constellation.data(), array_size, &actual_array_size); @@ -4033,10 +3885,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pbch_dmrs_constellation, response->mutable_pbch_dmrs_constellation()); { @@ -4072,10 +3923,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pbch_dmrs_rms_evm_per_subcarrier_mean = response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4084,10 +3934,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4118,10 +3967,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pbch_dmrs_rms_evm_per_symbol_mean = response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4130,10 +3978,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4162,10 +4009,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pbch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPBCHDataConstellationTrace(instrument, selector_string, timeout, pbch_data_constellation.data(), array_size, &actual_array_size); @@ -4173,10 +4019,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pbch_data_constellation, response->mutable_pbch_data_constellation()); { @@ -4212,10 +4057,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pbch_data_rms_evm_per_subcarrier_mean = response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4224,10 +4068,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4258,10 +4101,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPBCHDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pbch_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pbch_data_rms_evm_per_symbol_mean = response->mutable_pbch_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4270,10 +4112,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4302,10 +4143,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH1024QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam1024_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH1024QAMConstellationTrace(instrument, selector_string, timeout, qam1024_constellation.data(), array_size, &actual_array_size); @@ -4313,10 +4153,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); { @@ -4350,10 +4189,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH16QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam16_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH16QAMConstellationTrace(instrument, selector_string, timeout, qam16_constellation.data(), array_size, &actual_array_size); @@ -4361,10 +4199,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); { @@ -4398,10 +4235,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH256QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam256_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH256QAMConstellationTrace(instrument, selector_string, timeout, qam256_constellation.data(), array_size, &actual_array_size); @@ -4409,10 +4245,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); { @@ -4446,10 +4281,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH64QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qam64_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH64QAMConstellationTrace(instrument, selector_string, timeout, qam64_constellation.data(), array_size, &actual_array_size); @@ -4457,10 +4291,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); { @@ -4494,10 +4327,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCH8PSKConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector psk8_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCH8PSKConstellationTrace(instrument, selector_string, timeout, psk8_constellation.data(), array_size, &actual_array_size); @@ -4505,10 +4337,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(psk8_constellation, response->mutable_psk8_constellation()); { @@ -4542,10 +4373,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pdsch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHDMRSConstellationTrace(instrument, selector_string, timeout, pdsch_dmrs_constellation.data(), array_size, &actual_array_size); @@ -4553,10 +4383,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pdsch_dmrs_constellation, response->mutable_pdsch_dmrs_constellation()); { @@ -4590,10 +4419,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pdsch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHDataConstellationTrace(instrument, selector_string, timeout, pdsch_data_constellation.data(), array_size, &actual_array_size); @@ -4601,10 +4429,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pdsch_data_constellation, response->mutable_pdsch_data_constellation()); { @@ -4638,10 +4465,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHDemodulatedBits(instrument, selector_string, timeout, bits.data(), array_size, &actual_array_size); @@ -4649,10 +4475,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_bits()->Clear(); response->mutable_bits()->Reserve(actual_array_size); @@ -4688,10 +4513,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHPTRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pdsch_ptrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHPTRSConstellationTrace(instrument, selector_string, timeout, pdsch_ptrs_constellation.data(), array_size, &actual_array_size); @@ -4699,10 +4523,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pdsch_ptrs_constellation, response->mutable_pdsch_ptrs_constellation()); { @@ -4736,10 +4559,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPDSCHQPSKConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector qpsk_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPDSCHQPSKConstellationTrace(instrument, selector_string, timeout, qpsk_constellation.data(), array_size, &actual_array_size); @@ -4747,10 +4569,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); { @@ -4784,10 +4605,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPSSConstellationTrace(instrument, selector_string, timeout, pss_constellation.data(), array_size, &actual_array_size); @@ -4795,10 +4615,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pss_constellation, response->mutable_pss_constellation()); { @@ -4834,10 +4653,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pss_rms_evm_per_subcarrier_mean = response->mutable_pss_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4846,10 +4664,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4880,10 +4697,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPSSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_pss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pss_rms_evm_per_symbol_mean = response->mutable_pss_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4892,10 +4708,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4924,10 +4739,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pusch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDMRSConstellationTrace(instrument, selector_string, timeout, pusch_dmrs_constellation.data(), array_size, &actual_array_size); @@ -4935,10 +4749,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pusch_dmrs_constellation, response->mutable_pusch_dmrs_constellation()); { @@ -4972,10 +4785,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pusch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDataConstellationTrace(instrument, selector_string, timeout, pusch_data_constellation.data(), array_size, &actual_array_size); @@ -4983,10 +4795,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pusch_data_constellation, response->mutable_pusch_data_constellation()); { @@ -5020,10 +4831,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector bits(actual_array_size); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, bits.data(), array_size, &actual_array_size); @@ -5031,10 +4841,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_bits()->Clear(); response->mutable_bits()->Reserve(actual_array_size); @@ -5070,10 +4879,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPUSCHPTRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pusch_ptrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchPUSCHPTRSConstellationTrace(instrument, selector_string, timeout, pusch_ptrs_constellation.data(), array_size, &actual_array_size); @@ -5081,10 +4889,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pusch_ptrs_constellation, response->mutable_pusch_ptrs_constellation()); { @@ -5120,10 +4927,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPeakEVMPerSlotMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_peak_evm_per_slot_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_slot_maximum = response->mutable_peak_evm_per_slot_maximum()->mutable_data(); auto array_size = actual_array_size; @@ -5132,10 +4938,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5166,10 +4971,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPeakEVMPerSubcarrierMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_peak_evm_per_subcarrier_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_subcarrier_maximum = response->mutable_peak_evm_per_subcarrier_maximum()->mutable_data(); auto array_size = actual_array_size; @@ -5178,10 +4982,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5212,10 +5015,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchPeakEVMPerSymbolMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_peak_evm_per_symbol_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_symbol_maximum = response->mutable_peak_evm_per_symbol_maximum()->mutable_data(); auto array_size = actual_array_size; @@ -5224,10 +5026,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5258,10 +5059,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMHighPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_high_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_high_per_symbol_mean = response->mutable_rms_evm_high_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5270,10 +5070,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5304,10 +5103,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMLowPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_low_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_low_per_symbol_mean = response->mutable_rms_evm_low_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5316,10 +5114,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5350,10 +5147,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMPerSlotMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_per_slot_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_slot_mean = response->mutable_rms_evm_per_slot_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5362,10 +5158,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5396,10 +5191,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_subcarrier_mean = response->mutable_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5408,10 +5202,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5442,10 +5235,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_symbol_mean = response->mutable_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5454,10 +5246,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5486,10 +5277,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSSSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector sss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->ModAccFetchSSSConstellationTrace(instrument, selector_string, timeout, sss_constellation.data(), array_size, &actual_array_size); @@ -5497,10 +5287,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); { @@ -5536,10 +5325,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSSSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_sss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* sss_rms_evm_per_subcarrier_mean = response->mutable_sss_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5548,10 +5336,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5582,10 +5369,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSSSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_sss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* sss_rms_evm_per_symbol_mean = response->mutable_sss_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5594,10 +5380,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5628,10 +5413,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSpectralFlatnessTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectral_flatness()->Resize(actual_array_size, 0); float32* spectral_flatness = response->mutable_spectral_flatness()->mutable_data(); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); @@ -5644,10 +5428,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5678,10 +5461,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ModAccFetchSubblockInBandEmissionTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); float64* subblock_in_band_emission = response->mutable_subblock_in_band_emission()->mutable_data(); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -5694,10 +5476,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); @@ -5725,9 +5506,8 @@ namespace nirfmxnr_grpc { int32 calibration_data_valid {}; auto status = library_->ModAccValidateCalibrationData(instrument, selector_string, &calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_calibration_data_valid(static_cast(calibration_data_valid)); response->set_calibration_data_valid_raw(calibration_data_valid); @@ -5784,9 +5564,8 @@ namespace nirfmxnr_grpc { auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5841,9 +5620,8 @@ namespace nirfmxnr_grpc { auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5882,9 +5660,8 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5911,9 +5688,8 @@ namespace nirfmxnr_grpc { float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &absolute_power, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_occupied_bandwidth(occupied_bandwidth); response->set_absolute_power(absolute_power); @@ -5943,10 +5719,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OBWFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -5955,10 +5730,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6018,9 +5792,8 @@ namespace nirfmxnr_grpc { auto status = library_->PVTCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6058,9 +5831,8 @@ namespace nirfmxnr_grpc { auto status = library_->PVTCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6084,9 +5856,8 @@ namespace nirfmxnr_grpc { float64 off_power_exclusion_after = request->off_power_exclusion_after(); auto status = library_->PVTCfgOFFPowerExclusionPeriods(instrument, selector_string, off_power_exclusion_before, off_power_exclusion_after); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6114,9 +5885,8 @@ namespace nirfmxnr_grpc { float64 burst_width {}; auto status = library_->PVTFetchMeasurement(instrument, selector_string, timeout, &measurement_status, &absolute_off_power_before, &absolute_off_power_after, &absolute_on_power, &burst_width); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -6146,10 +5916,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_absolute_off_power_before()->Resize(actual_array_size, 0); @@ -6166,10 +5935,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -6211,10 +5979,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_signal_power()->Resize(actual_array_size, 0); float32* signal_power = response->mutable_signal_power()->mutable_data(); response->mutable_absolute_limit()->Resize(actual_array_size, 0); @@ -6225,10 +5992,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6260,10 +6026,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PVTFetchWindowedSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_windowed_signal_power()->Resize(actual_array_size, 0); float32* windowed_signal_power = response->mutable_windowed_signal_power()->mutable_data(); auto array_size = actual_array_size; @@ -6272,10 +6037,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6303,9 +6067,8 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6327,9 +6090,8 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6384,9 +6146,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6409,9 +6170,8 @@ namespace nirfmxnr_grpc { float64 component_carrier_rated_output_power = request->component_carrier_rated_output_power(); auto status = library_->SEMCfgComponentCarrierRatedOutputPower(instrument, selector_string, component_carrier_rated_output_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6435,9 +6195,8 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->component_carrier_rated_output_power().size()); auto status = library_->SEMCfgComponentCarrierRatedOutputPowerArray(instrument, selector_string, component_carrier_rated_output_power, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6460,9 +6219,8 @@ namespace nirfmxnr_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6486,9 +6244,8 @@ namespace nirfmxnr_grpc { float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, absolute_limit_start, absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6529,9 +6286,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, absolute_limit_start, absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6554,9 +6310,8 @@ namespace nirfmxnr_grpc { int32 bandwidth_integral = request->bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, bandwidth_integral); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6580,9 +6335,8 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->bandwidth_integral().size()); auto status = library_->SEMCfgOffsetBandwidthIntegralArray(instrument, selector_string, bandwidth_integral, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6622,9 +6376,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6676,9 +6429,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6716,9 +6468,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6750,9 +6501,8 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->limit_fail_mask().size()); auto status = library_->SEMCfgOffsetLimitFailMaskArray(instrument, selector_string, limit_fail_mask, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6791,9 +6541,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, offset_rbw, offset_rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6842,9 +6591,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, offset_rbw, offset_rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6868,9 +6616,8 @@ namespace nirfmxnr_grpc { float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_start, relative_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6911,9 +6658,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6952,9 +6698,8 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6992,9 +6737,8 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgUplinkMaskType(instrument, selector_string, uplink_mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7021,9 +6765,8 @@ namespace nirfmxnr_grpc { float64 relative_power {}; auto status = library_->SEMFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &peak_absolute_power, &peak_frequency, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_peak_absolute_power(peak_absolute_power); @@ -7051,10 +6794,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); @@ -7069,10 +6811,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_absolute_power()->Resize(actual_array_size, 0); response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); @@ -7106,9 +6847,8 @@ namespace nirfmxnr_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -7138,10 +6878,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -7158,10 +6897,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -7205,9 +6943,8 @@ namespace nirfmxnr_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); @@ -7236,10 +6973,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7256,10 +6992,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7290,9 +7025,8 @@ namespace nirfmxnr_grpc { int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -7320,10 +7054,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); response->mutable_composite_mask()->Resize(actual_array_size, 0); @@ -7334,10 +7067,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -7369,9 +7101,8 @@ namespace nirfmxnr_grpc { float64 frequency {}; auto status = library_->SEMFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_subblock_power(subblock_power); response->set_integration_bandwidth(integration_bandwidth); @@ -7398,9 +7129,8 @@ namespace nirfmxnr_grpc { float64 total_aggregated_power {}; auto status = library_->SEMFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; @@ -7429,9 +7159,8 @@ namespace nirfmxnr_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -7461,10 +7190,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -7481,10 +7209,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -7528,9 +7255,8 @@ namespace nirfmxnr_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); @@ -7559,10 +7285,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7579,10 +7304,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7628,9 +7352,8 @@ namespace nirfmxnr_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7651,9 +7374,8 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7677,9 +7399,8 @@ namespace nirfmxnr_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7704,9 +7425,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7730,9 +7450,8 @@ namespace nirfmxnr_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7757,9 +7476,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7792,9 +7510,8 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7836,9 +7553,8 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7871,9 +7587,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7897,9 +7612,8 @@ namespace nirfmxnr_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7924,9 +7638,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7959,9 +7672,8 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8006,9 +7718,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8036,9 +7747,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8063,9 +7773,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8108,9 +7817,8 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8143,9 +7851,8 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8172,9 +7879,8 @@ namespace nirfmxnr_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8199,9 +7905,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8226,9 +7931,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8252,9 +7956,8 @@ namespace nirfmxnr_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8279,9 +7982,8 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8306,9 +8008,8 @@ namespace nirfmxnr_grpc { float64 peak_power_maximum {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_power_mean, &peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_power_mean(average_power_mean); response->set_peak_power_maximum(peak_power_maximum); @@ -8336,10 +8037,9 @@ namespace nirfmxnr_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -8348,10 +8048,9 @@ namespace nirfmxnr_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -8378,9 +8077,8 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8403,9 +8101,8 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxspecan/nirfmxspecan_service.cpp b/generated/nirfmxspecan/nirfmxspecan_service.cpp index 608b41562..1db0fb391 100644 --- a/generated/nirfmxspecan/nirfmxspecan_service.cpp +++ b/generated/nirfmxspecan/nirfmxspecan_service.cpp @@ -93,9 +93,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -120,9 +119,8 @@ namespace nirfmxspecan_grpc { float64 channel_spacing = request->channel_spacing(); auto status = library_->ACPCfgCarrierAndOffsets(instrument, selector_string, integration_bandwidth, number_of_offsets, channel_spacing); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -145,9 +143,8 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency = request->carrier_frequency(); auto status = library_->ACPCfgCarrierFrequency(instrument, selector_string, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -170,9 +167,8 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->ACPCfgCarrierIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -210,9 +206,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgCarrierMode(instrument, selector_string, carrier_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -251,9 +246,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->ACPCfgCarrierRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -292,9 +286,8 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->ACPCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -332,9 +325,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -372,9 +364,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -397,9 +388,8 @@ namespace nirfmxspecan_grpc { int32 number_of_carriers = request->number_of_carriers(); auto status = library_->ACPCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -422,9 +412,8 @@ namespace nirfmxspecan_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->ACPCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -479,9 +468,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffset(instrument, selector_string, offset_frequency, offset_sideband, offset_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -541,9 +529,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetArray(instrument, selector_string, offset_frequency, offset_sideband, offset_enabled, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -581,9 +568,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetFrequencyDefinition(instrument, selector_string, offset_frequency_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -606,9 +592,8 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->ACPCfgOffsetIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -632,9 +617,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->integration_bandwidth().size()); auto status = library_->ACPCfgOffsetIntegrationBandwidthArray(instrument, selector_string, integration_bandwidth, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -673,9 +657,8 @@ namespace nirfmxspecan_grpc { int32 offset_reference_specific = request->offset_reference_specific(); auto status = library_->ACPCfgOffsetPowerReference(instrument, selector_string, offset_reference_carrier, offset_reference_specific); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -724,9 +707,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetPowerReferenceArray(instrument, selector_string, offset_power_reference_carrier, offset_power_reference_specific, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -765,9 +747,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->ACPCfgOffsetRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -816,9 +797,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetRRCFilterArray(instrument, selector_string, rrc_filter_enabled, rrc_alpha, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -841,9 +821,8 @@ namespace nirfmxspecan_grpc { float64 relative_attenuation = request->relative_attenuation(); auto status = library_->ACPCfgOffsetRelativeAttenuation(instrument, selector_string, relative_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -867,9 +846,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->ACPCfgOffsetRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -907,9 +885,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -964,9 +941,8 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1005,9 +981,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1034,10 +1009,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -1046,10 +1020,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1081,9 +1054,8 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth {}; auto status = library_->ACPFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &total_relative_power, &carrier_offset, &integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_total_relative_power(total_relative_power); @@ -1111,9 +1083,8 @@ namespace nirfmxspecan_grpc { float64 frequency_resolution {}; auto status = library_->ACPFetchFrequencyResolution(instrument, selector_string, timeout, &frequency_resolution); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_frequency_resolution(frequency_resolution); return ::grpc::Status::OK; @@ -1141,9 +1112,8 @@ namespace nirfmxspecan_grpc { float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_lower_relative_power(lower_relative_power); response->set_upper_relative_power(upper_relative_power); @@ -1171,10 +1141,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -1189,10 +1158,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_lower_relative_power()->Resize(actual_array_size, 0); response->mutable_upper_relative_power()->Resize(actual_array_size, 0); @@ -1225,10 +1193,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); auto array_size = actual_array_size; @@ -1237,10 +1204,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1271,10 +1237,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -1283,10 +1248,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1315,9 +1279,8 @@ namespace nirfmxspecan_grpc { float64 total_carrier_power {}; auto status = library_->ACPFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_carrier_power(total_carrier_power); return ::grpc::Status::OK; @@ -1346,9 +1309,8 @@ namespace nirfmxspecan_grpc { float64 offset_ch1_upper_relative_power {}; auto status = library_->ACPRead(instrument, selector_string, timeout, &carrier_absolute_power, &offset_ch0_lower_relative_power, &offset_ch0_upper_relative_power, &offset_ch1_lower_relative_power, &offset_ch1_upper_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_carrier_absolute_power(carrier_absolute_power); response->set_offset_ch0_lower_relative_power(offset_ch0_lower_relative_power); @@ -1376,9 +1338,8 @@ namespace nirfmxspecan_grpc { int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -1419,9 +1380,8 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgAMToAMCurveFit(instrument, selector_string, am_to_am_curve_fit_order, am_to_am_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1460,9 +1420,8 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgAMToPMCurveFit(instrument, selector_string, am_to_pm_curve_fit_order, am_to_pm_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1501,9 +1460,8 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->AMPMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1543,9 +1501,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->compression_level().size()); auto status = library_->AMPMCfgCompressionPoints(instrument, selector_string, compression_point_enabled, compression_level, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1568,9 +1525,8 @@ namespace nirfmxspecan_grpc { float64 dut_average_input_power = request->dut_average_input_power(); auto status = library_->AMPMCfgDUTAverageInputPower(instrument, selector_string, dut_average_input_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1593,9 +1549,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->AMPMCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1634,9 +1589,8 @@ namespace nirfmxspecan_grpc { float64 sample_rate = request->sample_rate(); auto status = library_->AMPMCfgMeasurementSampleRate(instrument, selector_string, sample_rate_mode, sample_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1674,9 +1628,8 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgReferencePowerType(instrument, selector_string, reference_power_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1734,9 +1687,8 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size, idle_duration_present, signal_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1774,9 +1726,8 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgSynchronizationMethod(instrument, selector_string, synchronization_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1831,9 +1782,8 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1857,10 +1807,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchAMToAMTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_reference_powers()->Resize(actual_array_size, 0); float32* reference_powers = response->mutable_reference_powers()->mutable_data(); response->mutable_measured_am_to_am()->Resize(actual_array_size, 0); @@ -1873,10 +1822,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_reference_powers()->Resize(actual_array_size, 0); response->mutable_measured_am_to_am()->Resize(actual_array_size, 0); @@ -1905,10 +1853,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchAMToPMTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_reference_powers()->Resize(actual_array_size, 0); float32* reference_powers = response->mutable_reference_powers()->mutable_data(); response->mutable_measured_am_to_pm()->Resize(actual_array_size, 0); @@ -1921,10 +1868,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_reference_powers()->Resize(actual_array_size, 0); response->mutable_measured_am_to_pm()->Resize(actual_array_size, 0); @@ -1953,10 +1899,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchCompressionPoints(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_input_compression_point()->Resize(actual_array_size, 0); float64* input_compression_point = response->mutable_input_compression_point()->mutable_data(); response->mutable_output_compression_point()->Resize(actual_array_size, 0); @@ -1967,10 +1912,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_input_compression_point()->Resize(actual_array_size, 0); response->mutable_output_compression_point()->Resize(actual_array_size, 0); @@ -1998,10 +1942,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchCurveFitCoefficients(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); float32* am_to_am_coefficients = response->mutable_am_to_am_coefficients()->mutable_data(); response->mutable_am_to_pm_coefficients()->Resize(actual_array_size, 0); @@ -2012,10 +1955,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); response->mutable_am_to_pm_coefficients()->Resize(actual_array_size, 0); @@ -2044,9 +1986,8 @@ namespace nirfmxspecan_grpc { float64 am_to_pm_residual {}; auto status = library_->AMPMFetchCurveFitResidual(instrument, selector_string, timeout, &am_to_am_residual, &am_to_pm_residual); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_am_to_am_residual(am_to_am_residual); response->set_am_to_pm_residual(am_to_pm_residual); @@ -2074,9 +2015,8 @@ namespace nirfmxspecan_grpc { float64 mean_rms_evm {}; auto status = library_->AMPMFetchDUTCharacteristics(instrument, selector_string, timeout, &mean_linear_gain, &one_db_compression_point, &mean_rms_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_linear_gain(mean_linear_gain); response->set_one_db_compression_point(one_db_compression_point); @@ -2105,9 +2045,8 @@ namespace nirfmxspecan_grpc { float64 mean_phase_error {}; auto status = library_->AMPMFetchError(instrument, selector_string, timeout, &gain_error_range, &phase_error_range, &mean_phase_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_gain_error_range(gain_error_range); response->set_phase_error_range(phase_error_range); @@ -2136,10 +2075,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector processed_mean_acquired_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->AMPMFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, processed_mean_acquired_waveform.data(), array_size, &actual_array_size); @@ -2147,10 +2085,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -2188,10 +2125,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector processed_reference_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->AMPMFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, processed_reference_waveform.data(), array_size, &actual_array_size); @@ -2199,10 +2135,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -2240,10 +2175,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchRelativePhaseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_relative_phase()->Resize(actual_array_size, 0); float32* relative_phase = response->mutable_relative_phase()->mutable_data(); auto array_size = actual_array_size; @@ -2252,10 +2186,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -2286,10 +2219,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->AMPMFetchRelativePowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_relative_power()->Resize(actual_array_size, 0); float32* relative_power = response->mutable_relative_power()->mutable_data(); auto array_size = actual_array_size; @@ -2298,10 +2230,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -2328,9 +2259,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2359,9 +2289,8 @@ namespace nirfmxspecan_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2390,9 +2319,8 @@ namespace nirfmxspecan_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2417,9 +2345,8 @@ namespace nirfmxspecan_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, bandwidth, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_level(reference_level); return ::grpc::Status::OK; @@ -2442,10 +2369,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2457,10 +2383,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2485,10 +2410,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildHarmonicString(selector_string, harmonic_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2500,10 +2424,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2528,10 +2451,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildIntermodString(selector_string, intermod_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2543,10 +2465,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2572,10 +2493,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildListStepString(list_name, result_name, step_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -2587,10 +2507,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -2615,10 +2534,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildListString(list_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -2630,10 +2548,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -2658,10 +2575,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildMarkerString(selector_string, marker_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2673,10 +2589,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2701,10 +2616,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2716,10 +2630,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2746,10 +2659,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildRangeSpurString(signal_name, result_name, range_number, spur_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -2761,10 +2673,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -2789,10 +2700,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildRangeString(selector_string, range_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2804,10 +2714,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2832,10 +2741,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSegmentString(selector_string, segment_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2847,10 +2755,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2875,10 +2782,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -2890,10 +2796,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -2918,10 +2823,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSpurString(selector_string, spur_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -2933,10 +2837,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -2962,9 +2865,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->CCDFCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2987,9 +2889,8 @@ namespace nirfmxspecan_grpc { int32 number_of_records = request->number_of_records(); auto status = library_->CCDFCfgNumberOfRecords(instrument, selector_string, number_of_records); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3029,9 +2930,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->CCDFCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3086,9 +2986,8 @@ namespace nirfmxspecan_grpc { auto status = library_->CCDFCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3117,9 +3016,8 @@ namespace nirfmxspecan_grpc { float64 one_ten_thousandth_percent_power {}; auto status = library_->CCDFFetchBasicPowerProbabilities(instrument, selector_string, timeout, &ten_percent_power, &one_percent_power, &one_tenth_percent_power, &one_hundredth_percent_power, &one_thousandth_percent_power, &one_ten_thousandth_percent_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ten_percent_power(ten_percent_power); response->set_one_percent_power(one_percent_power); @@ -3151,10 +3049,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CCDFFetchGaussianProbabilitiesTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_gaussian_probabilities()->Resize(actual_array_size, 0); float32* gaussian_probabilities = response->mutable_gaussian_probabilities()->mutable_data(); auto array_size = actual_array_size; @@ -3163,10 +3060,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3198,9 +3094,8 @@ namespace nirfmxspecan_grpc { int32 measured_samples_count {}; auto status = library_->CCDFFetchPower(instrument, selector_string, timeout, &mean_power, &mean_power_percentile, &peak_power, &measured_samples_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_power(mean_power); response->set_mean_power_percentile(mean_power_percentile); @@ -3230,10 +3125,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CCDFFetchProbabilitiesTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_probabilities()->Resize(actual_array_size, 0); float32* probabilities = response->mutable_probabilities()->mutable_data(); auto array_size = actual_array_size; @@ -3242,10 +3136,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3277,9 +3170,8 @@ namespace nirfmxspecan_grpc { int32 measured_samples_count {}; auto status = library_->CCDFRead(instrument, selector_string, timeout, &mean_power, &mean_power_percentile, &peak_power, &measured_samples_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_power(mean_power); response->set_mean_power_percentile(mean_power_percentile); @@ -3338,9 +3230,8 @@ namespace nirfmxspecan_grpc { auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3363,9 +3254,8 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency = request->carrier_frequency(); auto status = library_->CHPCfgCarrierOffset(instrument, selector_string, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3404,9 +3294,8 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->CHPCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3429,9 +3318,8 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->CHPCfgIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3454,9 +3342,8 @@ namespace nirfmxspecan_grpc { int32 number_of_carriers = request->number_of_carriers(); auto status = library_->CHPCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3511,9 +3398,8 @@ namespace nirfmxspecan_grpc { auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3552,9 +3438,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->CHPCfgRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3577,9 +3462,8 @@ namespace nirfmxspecan_grpc { float64 span = request->span(); auto status = library_->CHPCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3618,9 +3502,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3646,9 +3529,8 @@ namespace nirfmxspecan_grpc { float64 relative_power {}; auto status = library_->CHPFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &psd, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_psd(psd); @@ -3677,10 +3559,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -3689,10 +3570,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3721,9 +3601,8 @@ namespace nirfmxspecan_grpc { float64 total_carrier_power {}; auto status = library_->CHPFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_carrier_power(total_carrier_power); return ::grpc::Status::OK; @@ -3749,9 +3628,8 @@ namespace nirfmxspecan_grpc { float64 psd {}; auto status = library_->CHPRead(instrument, selector_string, timeout, &absolute_power, &psd); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_psd(psd); @@ -3776,9 +3654,8 @@ namespace nirfmxspecan_grpc { int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -3840,9 +3717,8 @@ namespace nirfmxspecan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3865,9 +3741,8 @@ namespace nirfmxspecan_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3890,9 +3765,8 @@ namespace nirfmxspecan_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3935,9 +3809,8 @@ namespace nirfmxspecan_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3996,9 +3869,8 @@ namespace nirfmxspecan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_level, iq_power_edge_slope, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4037,9 +3909,8 @@ namespace nirfmxspecan_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4064,9 +3935,8 @@ namespace nirfmxspecan_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4105,9 +3975,8 @@ namespace nirfmxspecan_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4130,9 +3999,8 @@ namespace nirfmxspecan_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4156,9 +4024,8 @@ namespace nirfmxspecan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4181,9 +4048,8 @@ namespace nirfmxspecan_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -4206,9 +4072,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4230,9 +4095,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4254,9 +4118,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4279,9 +4142,8 @@ namespace nirfmxspecan_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4304,9 +4166,8 @@ namespace nirfmxspecan_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4328,9 +4189,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4352,9 +4212,8 @@ namespace nirfmxspecan_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->CreateList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4377,9 +4236,8 @@ namespace nirfmxspecan_grpc { int32 created_step_index {}; auto status = library_->CreateListStep(instrument, selector_string, &created_step_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_created_step_index(created_step_index); return ::grpc::Status::OK; @@ -4402,9 +4260,8 @@ namespace nirfmxspecan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4452,10 +4309,9 @@ namespace nirfmxspecan_grpc { float64 power_offset {}; while (true) { auto status = library_->DPDApplyDigitalPredistortion(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, measurement_timeout, &x0_out, &dx_out, nullptr, 0, &actual_array_size, &papr, &power_offset); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector waveform_out(actual_array_size, NIComplexSingle()); auto array_size_out = actual_array_size; status = library_->DPDApplyDigitalPredistortion(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, measurement_timeout, &x0_out, &dx_out, waveform_out.data(), array_size_out, &actual_array_size, &papr, &power_offset); @@ -4463,10 +4319,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0_out(x0_out); response->set_dx_out(dx_out); @@ -4526,10 +4381,9 @@ namespace nirfmxspecan_grpc { float64 papr {}; while (true) { auto status = library_->DPDApplyPreDPDSignalConditioning(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, &x0_out, &dx_out, nullptr, 0, &actual_array_size, &papr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector waveform_out(actual_array_size, NIComplexSingle()); auto array_size_out = actual_array_size; status = library_->DPDApplyPreDPDSignalConditioning(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, &x0_out, &dx_out, waveform_out.data(), array_size_out, &actual_array_size, &papr); @@ -4537,10 +4391,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0_out(x0_out); response->set_dx_out(dx_out); @@ -4591,9 +4444,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDConfigurationInput(instrument, selector_string, configuration_input); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4631,9 +4483,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDLookupTableCorrectionType(instrument, selector_string, lut_correction_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4671,9 +4522,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDMemoryModelCorrectionType(instrument, selector_string, memory_model_correction_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4697,9 +4547,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->dpd_polynomial().size()); auto status = library_->DPDCfgApplyDPDUserDPDPolynomial(instrument, selector_string, dpd_polynomial.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4740,9 +4589,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDUserLookupTable(instrument, selector_string, lut_input_powers, lut_complex_gains.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4781,9 +4629,8 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->DPDCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4821,9 +4668,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgDPDModel(instrument, selector_string, dpd_model); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4846,9 +4692,8 @@ namespace nirfmxspecan_grpc { float64 dut_average_input_power = request->dut_average_input_power(); auto status = library_->DPDCfgDUTAverageInputPower(instrument, selector_string, dut_average_input_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4876,9 +4721,8 @@ namespace nirfmxspecan_grpc { int32 memory_polynomial_maximum_lag = request->memory_polynomial_maximum_lag(); auto status = library_->DPDCfgGeneralizedMemoryPolynomialCrossTerms(instrument, selector_string, memory_polynomial_lead_order, memory_polynomial_lag_order, memory_polynomial_lead_memory_depth, memory_polynomial_lag_memory_depth, memory_polynomial_maximum_lead, memory_polynomial_maximum_lag); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4916,9 +4760,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgIterativeDPDEnabled(instrument, selector_string, iterative_dpd_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4957,9 +4800,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableAMToAMCurveFit(instrument, selector_string, am_to_am_curve_fit_order, am_to_am_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -4998,9 +4840,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableAMToPMCurveFit(instrument, selector_string, am_to_pm_curve_fit_order, am_to_pm_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5023,9 +4864,8 @@ namespace nirfmxspecan_grpc { float64 step_size = request->step_size(); auto status = library_->DPDCfgLookupTableStepSize(instrument, selector_string, step_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5080,9 +4920,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5120,9 +4959,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableType(instrument, selector_string, lookup_table_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5145,9 +4983,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->DPDCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5186,9 +5023,8 @@ namespace nirfmxspecan_grpc { float64 sample_rate = request->sample_rate(); auto status = library_->DPDCfgMeasurementSampleRate(instrument, selector_string, sample_rate_mode, sample_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5212,9 +5048,8 @@ namespace nirfmxspecan_grpc { int32 memory_polynomial_memory_depth = request->memory_polynomial_memory_depth(); auto status = library_->DPDCfgMemoryPolynomial(instrument, selector_string, memory_polynomial_order, memory_polynomial_memory_depth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5238,9 +5073,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->previous_dpd_polynomial().size()); auto status = library_->DPDCfgPreviousDPDPolynomial(instrument, selector_string, previous_dpd_polynomial.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5298,9 +5132,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size, idle_duration_present, signal_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5338,9 +5171,8 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgSynchronizationMethod(instrument, selector_string, synchronization_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5364,9 +5196,8 @@ namespace nirfmxspecan_grpc { float64 pre_cfr_papr {}; auto status = library_->DPDFetchApplyDPDPreCFRPAPR(instrument, selector_string, timeout, &pre_cfr_papr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pre_cfr_papr(pre_cfr_papr); return ::grpc::Status::OK; @@ -5391,9 +5222,8 @@ namespace nirfmxspecan_grpc { float64 average_gain {}; auto status = library_->DPDFetchAverageGain(instrument, selector_string, timeout, &average_gain); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_gain(average_gain); return ::grpc::Status::OK; @@ -5418,10 +5248,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchDPDPolynomial(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector dpd_polynomial(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DPDFetchDPDPolynomial(instrument, selector_string, timeout, dpd_polynomial.data(), array_size, &actual_array_size); @@ -5429,10 +5258,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(dpd_polynomial, response->mutable_dpd_polynomial()); { @@ -5466,10 +5294,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchLookupTable(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_input_powers()->Resize(actual_array_size, 0); float32* input_powers = response->mutable_input_powers()->mutable_data(); std::vector complex_gains(actual_array_size, NIComplexSingle()); @@ -5479,10 +5306,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_input_powers()->Resize(actual_array_size, 0); convert_to_grpc(complex_gains, response->mutable_complex_gains()); @@ -5517,9 +5343,8 @@ namespace nirfmxspecan_grpc { float64 nmse {}; auto status = library_->DPDFetchNMSE(instrument, selector_string, timeout, &nmse); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_nmse(nmse); return ::grpc::Status::OK; @@ -5546,10 +5371,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector processed_mean_acquired_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DPDFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, processed_mean_acquired_waveform.data(), array_size, &actual_array_size); @@ -5557,10 +5381,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5598,10 +5421,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DPDFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector processed_reference_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DPDFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, processed_reference_waveform.data(), array_size, &actual_array_size); @@ -5609,10 +5431,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5646,9 +5467,8 @@ namespace nirfmxspecan_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->DeleteList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5670,9 +5490,8 @@ namespace nirfmxspecan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5694,9 +5513,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5751,9 +5569,8 @@ namespace nirfmxspecan_grpc { auto status = library_->FCntCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5776,9 +5593,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->FCntCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5818,9 +5634,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->FCntCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5875,9 +5690,8 @@ namespace nirfmxspecan_grpc { auto status = library_->FCntCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -5901,9 +5715,8 @@ namespace nirfmxspecan_grpc { float64 allan_deviation {}; auto status = library_->FCntFetchAllanDeviation(instrument, selector_string, timeout, &allan_deviation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_allan_deviation(allan_deviation); return ::grpc::Status::OK; @@ -5930,10 +5743,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FCntFetchFrequencyTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_frequency_trace()->Resize(actual_array_size, 0); float32* frequency_trace = response->mutable_frequency_trace()->mutable_data(); auto array_size = actual_array_size; @@ -5942,10 +5754,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5976,9 +5787,8 @@ namespace nirfmxspecan_grpc { float64 mean_phase {}; auto status = library_->FCntFetchMeasurement(instrument, selector_string, timeout, &average_relative_frequency, &average_absolute_frequency, &mean_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_relative_frequency(average_relative_frequency); response->set_average_absolute_frequency(average_absolute_frequency); @@ -6007,10 +5817,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FCntFetchPhaseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_phase_trace()->Resize(actual_array_size, 0); float32* phase_trace = response->mutable_phase_trace()->mutable_data(); auto array_size = actual_array_size; @@ -6019,10 +5828,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6053,10 +5861,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->FCntFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power_trace()->Resize(actual_array_size, 0); float32* power_trace = response->mutable_power_trace()->mutable_data(); auto array_size = actual_array_size; @@ -6065,10 +5872,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6099,9 +5905,8 @@ namespace nirfmxspecan_grpc { float64 mean_phase {}; auto status = library_->FCntRead(instrument, selector_string, timeout, &average_relative_frequency, &average_absolute_frequency, &mean_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_relative_frequency(average_relative_frequency); response->set_average_absolute_frequency(average_absolute_frequency); @@ -6128,10 +5933,9 @@ namespace nirfmxspecan_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -6142,10 +5946,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); @@ -6174,9 +5977,8 @@ namespace nirfmxspecan_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6201,10 +6003,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -6213,10 +6014,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6243,9 +6043,8 @@ namespace nirfmxspecan_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6270,10 +6069,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -6282,10 +6080,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6312,9 +6109,8 @@ namespace nirfmxspecan_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6339,9 +6135,8 @@ namespace nirfmxspecan_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); @@ -6372,10 +6167,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -6384,10 +6178,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); @@ -6428,9 +6221,8 @@ namespace nirfmxspecan_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6455,10 +6247,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -6467,10 +6258,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6497,9 +6287,8 @@ namespace nirfmxspecan_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6524,10 +6313,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -6535,10 +6323,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); @@ -6574,10 +6361,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -6585,10 +6371,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -6622,10 +6407,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -6633,10 +6417,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -6670,10 +6453,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string attr_val; @@ -6685,10 +6467,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); @@ -6715,9 +6496,8 @@ namespace nirfmxspecan_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6742,9 +6522,8 @@ namespace nirfmxspecan_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6769,10 +6548,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -6781,10 +6559,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6811,10 +6588,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -6823,10 +6599,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6853,9 +6628,8 @@ namespace nirfmxspecan_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -6880,10 +6654,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -6891,10 +6664,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); @@ -6920,10 +6692,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; int32 error_code {}; @@ -6936,10 +6707,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -6966,10 +6736,9 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; std::string error_description; @@ -6981,10 +6750,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -7025,9 +6793,8 @@ namespace nirfmxspecan_grpc { auto status = library_->HarmCfgAutoHarmonics(instrument, selector_string, auto_harmonics_setup_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7082,9 +6849,8 @@ namespace nirfmxspecan_grpc { auto status = library_->HarmCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7107,9 +6873,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->HarmCfgFundamentalMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7149,9 +6914,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->HarmCfgFundamentalRBW(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7192,9 +6956,8 @@ namespace nirfmxspecan_grpc { float64 harmonic_measurement_interval = request->harmonic_measurement_interval(); auto status = library_->HarmCfgHarmonic(instrument, selector_string, harmonic_order, harmonic_bandwidth, harmonic_enabled, harmonic_measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7249,9 +7012,8 @@ namespace nirfmxspecan_grpc { auto status = library_->HarmCfgHarmonicArray(instrument, selector_string, harmonic_order, harmonic_bandwidth, harmonic_enabled, harmonic_measurement_interval, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7274,9 +7036,8 @@ namespace nirfmxspecan_grpc { int32 number_of_harmonics = request->number_of_harmonics(); auto status = library_->HarmCfgNumberOfHarmonics(instrument, selector_string, number_of_harmonics); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7303,9 +7064,8 @@ namespace nirfmxspecan_grpc { float64 frequency {}; auto status = library_->HarmFetchHarmonicMeasurement(instrument, selector_string, timeout, &average_relative_power, &average_absolute_power, &rbw, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_relative_power(average_relative_power); response->set_average_absolute_power(average_absolute_power); @@ -7333,10 +7093,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->HarmFetchHarmonicMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_average_relative_power()->Resize(actual_array_size, 0); float64* average_relative_power = response->mutable_average_relative_power()->mutable_data(); response->mutable_average_absolute_power()->Resize(actual_array_size, 0); @@ -7351,10 +7110,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_average_relative_power()->Resize(actual_array_size, 0); response->mutable_average_absolute_power()->Resize(actual_array_size, 0); @@ -7386,10 +7144,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->HarmFetchHarmonicPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -7398,10 +7155,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -7432,9 +7188,8 @@ namespace nirfmxspecan_grpc { float64 fundamental_frequency {}; auto status = library_->HarmFetchTHD(instrument, selector_string, timeout, &total_harmonic_distortion, &average_fundamental_power, &fundamental_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_harmonic_distortion(total_harmonic_distortion); response->set_average_fundamental_power(average_fundamental_power); @@ -7462,9 +7217,8 @@ namespace nirfmxspecan_grpc { float64 average_fundamental_power {}; auto status = library_->HarmRead(instrument, selector_string, timeout, &total_harmonic_distortion, &average_fundamental_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_harmonic_distortion(total_harmonic_distortion); response->set_average_fundamental_power(average_fundamental_power); @@ -7505,9 +7259,8 @@ namespace nirfmxspecan_grpc { int32 maximum_intermod_order = request->maximum_intermod_order(); auto status = library_->IMCfgAutoIntermodsSetup(instrument, selector_string, auto_intermods_setup_enabled, maximum_intermod_order); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7562,9 +7315,8 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7603,9 +7355,8 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->IMCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7643,9 +7394,8 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgFrequencyDefinition(instrument, selector_string, frequency_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7669,9 +7419,8 @@ namespace nirfmxspecan_grpc { float64 upper_tone_frequency = request->upper_tone_frequency(); auto status = library_->IMCfgFundamentalTones(instrument, selector_string, lower_tone_frequency, upper_tone_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7728,9 +7477,8 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgIntermod(instrument, selector_string, intermod_order, lower_intermod_frequency, upper_intermod_frequency, intermod_side, intermod_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7796,9 +7544,8 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgIntermodArray(instrument, selector_string, intermod_order, lower_intermod_frequency, upper_intermod_frequency, intermod_side, intermod_enabled, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7836,9 +7583,8 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7861,9 +7607,8 @@ namespace nirfmxspecan_grpc { int32 number_of_intermods = request->number_of_intermods(); auto status = library_->IMCfgNumberOfIntermods(instrument, selector_string, number_of_intermods); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7918,9 +7663,8 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7959,9 +7703,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->IMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7986,9 +7729,8 @@ namespace nirfmxspecan_grpc { float64 upper_tone_power {}; auto status = library_->IMFetchFundamentalMeasurement(instrument, selector_string, timeout, &lower_tone_power, &upper_tone_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_lower_tone_power(lower_tone_power); response->set_upper_tone_power(upper_tone_power); @@ -8017,9 +7759,8 @@ namespace nirfmxspecan_grpc { float64 upper_output_intercept_power {}; auto status = library_->IMFetchInterceptPower(instrument, selector_string, timeout, &intermod_order, &worst_case_output_intercept_power, &lower_output_intercept_power, &upper_output_intercept_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_intermod_order(intermod_order); response->set_worst_case_output_intercept_power(worst_case_output_intercept_power); @@ -8047,10 +7788,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IMFetchInterceptPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_intermod_order()->Resize(actual_array_size, 0); int32* intermod_order = reinterpret_cast(response->mutable_intermod_order()->mutable_data()); response->mutable_worst_case_output_intercept_power()->Resize(actual_array_size, 0); @@ -8065,10 +7805,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_intermod_order()->Resize(actual_array_size, 0); response->mutable_worst_case_output_intercept_power()->Resize(actual_array_size, 0); @@ -8100,9 +7839,8 @@ namespace nirfmxspecan_grpc { float64 upper_intermod_power {}; auto status = library_->IMFetchIntermodMeasurement(instrument, selector_string, timeout, &intermod_order, &lower_intermod_power, &upper_intermod_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_intermod_order(intermod_order); response->set_lower_intermod_power(lower_intermod_power); @@ -8129,10 +7867,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IMFetchIntermodMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_intermod_order()->Resize(actual_array_size, 0); int32* intermod_order = reinterpret_cast(response->mutable_intermod_order()->mutable_data()); response->mutable_lower_intermod_power()->Resize(actual_array_size, 0); @@ -8145,10 +7882,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_intermod_order()->Resize(actual_array_size, 0); response->mutable_lower_intermod_power()->Resize(actual_array_size, 0); @@ -8180,10 +7916,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IMFetchSpectrum(instrument, selector_string, timeout, spectrum_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -8192,10 +7927,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -8226,9 +7960,8 @@ namespace nirfmxspecan_grpc { float64 pretrigger_time = request->pretrigger_time(); auto status = library_->IQCfgAcquisition(instrument, selector_string, sample_rate, number_of_records, acquisition_time, pretrigger_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8267,9 +8000,8 @@ namespace nirfmxspecan_grpc { float64 bandwidth = request->bandwidth(); auto status = library_->IQCfgBandwidth(instrument, selector_string, bandwidth_auto, bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8297,10 +8029,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IQFetchData(instrument, selector_string, timeout, record_to_fetch, samples_to_read, &t0, &dt, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector data(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->IQFetchData(instrument, selector_string, timeout, record_to_fetch, samples_to_read, &t0, &dt, data.data(), array_size, &actual_array_size); @@ -8308,10 +8039,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_t0(t0); response->set_dt(dt); @@ -8346,9 +8076,8 @@ namespace nirfmxspecan_grpc { int32 records_done {}; auto status = library_->IQGetRecordsDone(instrument, selector_string, &records_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_records_done(records_done); return ::grpc::Status::OK; @@ -8380,9 +8109,8 @@ namespace nirfmxspecan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXSPECAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); @@ -8417,9 +8145,8 @@ namespace nirfmxspecan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXSPECAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -8446,9 +8173,8 @@ namespace nirfmxspecan_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8471,9 +8197,8 @@ namespace nirfmxspecan_grpc { int32 number_of_markers = request->number_of_markers(); auto status = library_->MarkerCfgNumberOfMarkers(instrument, selector_string, number_of_markers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8512,9 +8237,8 @@ namespace nirfmxspecan_grpc { float64 peak_excursion = request->peak_excursion(); auto status = library_->MarkerCfgPeakExcursion(instrument, selector_string, peak_excursion_enabled, peak_excursion); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8537,9 +8261,8 @@ namespace nirfmxspecan_grpc { int32 reference_marker = request->reference_marker(); auto status = library_->MarkerCfgReferenceMarker(instrument, selector_string, reference_marker); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8578,9 +8301,8 @@ namespace nirfmxspecan_grpc { float64 threshold = request->threshold(); auto status = library_->MarkerCfgThreshold(instrument, selector_string, threshold_enabled, threshold); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8618,9 +8340,8 @@ namespace nirfmxspecan_grpc { auto status = library_->MarkerCfgTrace(instrument, selector_string, trace); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8658,9 +8379,8 @@ namespace nirfmxspecan_grpc { auto status = library_->MarkerCfgType(instrument, selector_string, marker_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8683,9 +8403,8 @@ namespace nirfmxspecan_grpc { float64 marker_x_location = request->marker_x_location(); auto status = library_->MarkerCfgXLocation(instrument, selector_string, marker_x_location); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8709,9 +8428,8 @@ namespace nirfmxspecan_grpc { float64 marker_y_location {}; auto status = library_->MarkerFetchXY(instrument, selector_string, &marker_x_location, &marker_y_location); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_marker_x_location(marker_x_location); response->set_marker_y_location(marker_y_location); @@ -8752,9 +8470,8 @@ namespace nirfmxspecan_grpc { int32 next_peak_found {}; auto status = library_->MarkerNextPeak(instrument, selector_string, next_peak, &next_peak_found); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_next_peak_found(next_peak_found); return ::grpc::Status::OK; @@ -8778,9 +8495,8 @@ namespace nirfmxspecan_grpc { int32 number_of_peaks {}; auto status = library_->MarkerPeakSearch(instrument, selector_string, &number_of_peaks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_number_of_peaks(number_of_peaks); return ::grpc::Status::OK; @@ -8820,9 +8536,8 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->NFCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8880,9 +8595,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgCalibrationLoss(instrument, selector_string, calibration_loss_compensation_enabled, calibration_loss_frequency, calibration_loss, calibration_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8932,9 +8646,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgColdSourceDUTSParameters(instrument, selector_string, dut_s_parameters_frequency, dut_s21, dut_s12, dut_s11, dut_s22, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8976,9 +8689,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgColdSourceInputTermination(instrument, selector_string, termination_vswr, termination_vswr_frequency, termination_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9016,9 +8728,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgColdSourceMode(instrument, selector_string, cold_source_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9076,9 +8787,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgDUTInputLoss(instrument, selector_string, dut_input_loss_compensation_enabled, dut_input_loss_frequency, dut_input_loss, dut_input_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9136,9 +8846,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgDUTOutputLoss(instrument, selector_string, dut_output_loss_compensation_enabled, dut_output_loss_frequency, dut_output_loss, dut_output_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9162,9 +8871,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->frequency_list().size()); auto status = library_->NFCfgFrequencyList(instrument, selector_string, frequency_list, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9189,9 +8897,8 @@ namespace nirfmxspecan_grpc { int32 number_of_points = request->number_of_points(); auto status = library_->NFCfgFrequencyListStartStopPoints(instrument, selector_string, start_frequency, stop_frequency, number_of_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9216,9 +8923,8 @@ namespace nirfmxspecan_grpc { float64 step_size = request->step_size(); auto status = library_->NFCfgFrequencyListStartStopStep(instrument, selector_string, start_frequency, stop_frequency, step_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9241,9 +8947,8 @@ namespace nirfmxspecan_grpc { float64 measurement_bandwidth = request->measurement_bandwidth(); auto status = library_->NFCfgMeasurementBandwidth(instrument, selector_string, measurement_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9266,9 +8971,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->NFCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9306,9 +9010,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9346,9 +9049,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgYFactorMode(instrument, selector_string, y_factor_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9391,9 +9093,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgYFactorNoiseSourceENR(instrument, selector_string, enr_frequency, enr, cold_temperature, off_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9451,9 +9152,8 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgYFactorNoiseSourceLoss(instrument, selector_string, noise_source_loss_compensation_enabled, noise_source_loss_frequency, noise_source_loss, noise_source_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9476,9 +9176,8 @@ namespace nirfmxspecan_grpc { float64 settling_time = request->settling_time(); auto status = library_->NFCfgYFactorNoiseSourceSettlingTime(instrument, selector_string, settling_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9500,9 +9199,8 @@ namespace nirfmxspecan_grpc { char* calibration_setup_id = (char*)request->calibration_setup_id().c_str(); auto status = library_->NFClearCalibrationDatabase(instrument, calibration_setup_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9526,10 +9224,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchAnalyzerNoiseFigure(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); float64* analyzer_noise_figure = response->mutable_analyzer_noise_figure()->mutable_data(); auto array_size = actual_array_size; @@ -9538,10 +9235,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -9568,10 +9264,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchColdSourcePower(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_cold_source_power()->Resize(actual_array_size, 0); float64* cold_source_power = response->mutable_cold_source_power()->mutable_data(); auto array_size = actual_array_size; @@ -9580,10 +9275,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_cold_source_power()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -9610,10 +9304,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchDUTNoiseFigureAndGain(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); float64* dut_noise_figure = response->mutable_dut_noise_figure()->mutable_data(); response->mutable_dut_noise_temperature()->Resize(actual_array_size, 0); @@ -9626,10 +9319,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); response->mutable_dut_noise_temperature()->Resize(actual_array_size, 0); @@ -9658,10 +9350,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchYFactorPowers(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_hot_power()->Resize(actual_array_size, 0); float64* hot_power = response->mutable_hot_power()->mutable_data(); response->mutable_cold_power()->Resize(actual_array_size, 0); @@ -9672,10 +9363,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_hot_power()->Resize(actual_array_size, 0); response->mutable_cold_power()->Resize(actual_array_size, 0); @@ -9703,10 +9393,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->NFFetchYFactors(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); float64* measurement_y_factor = response->mutable_measurement_y_factor()->mutable_data(); response->mutable_calibration_y_factor()->Resize(actual_array_size, 0); @@ -9717,10 +9406,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); response->mutable_calibration_y_factor()->Resize(actual_array_size, 0); @@ -9749,9 +9437,8 @@ namespace nirfmxspecan_grpc { float64 reference_level {}; auto status = library_->NFRecommendReferenceLevel(instrument, selector_string, dut_max_gain, dut_max_noise_figure, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_reference_level(reference_level); return ::grpc::Status::OK; @@ -9775,9 +9462,8 @@ namespace nirfmxspecan_grpc { int32 calibration_data_valid {}; auto status = library_->NFValidateCalibrationData(instrument, selector_string, &calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_calibration_data_valid(static_cast(calibration_data_valid)); response->set_calibration_data_valid_raw(calibration_data_valid); @@ -9834,9 +9520,8 @@ namespace nirfmxspecan_grpc { auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9859,9 +9544,8 @@ namespace nirfmxspecan_grpc { float64 bandwidth_percentage = request->bandwidth_percentage(); auto status = library_->OBWCfgBandwidthPercentage(instrument, selector_string, bandwidth_percentage); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9900,9 +9584,8 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->OBWCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9940,9 +9623,8 @@ namespace nirfmxspecan_grpc { auto status = library_->OBWCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -9997,9 +9679,8 @@ namespace nirfmxspecan_grpc { auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10022,9 +9703,8 @@ namespace nirfmxspecan_grpc { float64 span = request->span(); auto status = library_->OBWCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10063,9 +9743,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10093,9 +9772,8 @@ namespace nirfmxspecan_grpc { float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &average_power, &frequency_resolution, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_occupied_bandwidth(occupied_bandwidth); response->set_average_power(average_power); @@ -10126,10 +9804,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OBWFetchSpectrumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -10138,10 +9815,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -10174,9 +9850,8 @@ namespace nirfmxspecan_grpc { float64 stop_frequency {}; auto status = library_->OBWRead(instrument, selector_string, timeout, &occupied_bandwidth, &average_power, &frequency_resolution, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_occupied_bandwidth(occupied_bandwidth); response->set_average_power(average_power); @@ -10204,9 +9879,8 @@ namespace nirfmxspecan_grpc { float64 measurement_bandwidth = request->measurement_bandwidth(); auto status = library_->PAVTCfgMeasurementBandwidth(instrument, selector_string, measurement_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10230,9 +9904,8 @@ namespace nirfmxspecan_grpc { float64 measurement_length = request->measurement_length(); auto status = library_->PAVTCfgMeasurementInterval(instrument, selector_string, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10270,9 +9943,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgMeasurementIntervalMode(instrument, selector_string, measurement_interval_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10310,9 +9982,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgMeasurementLocationType(instrument, selector_string, measurement_location_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10335,9 +10006,8 @@ namespace nirfmxspecan_grpc { int32 number_of_segments = request->number_of_segments(); auto status = library_->PAVTCfgNumberOfSegments(instrument, selector_string, number_of_segments); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10361,9 +10031,8 @@ namespace nirfmxspecan_grpc { float64 segment_measurement_length = request->segment_measurement_length(); auto status = library_->PAVTCfgSegmentMeasurementInterval(instrument, selector_string, segment_measurement_offset, segment_measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10404,9 +10073,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgSegmentMeasurementIntervalArray(instrument, selector_string, segment_measurement_offset, segment_measurement_length, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10430,9 +10098,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->segment_start_time().size()); auto status = library_->PAVTCfgSegmentStartTimeList(instrument, selector_string, segment_start_time, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10457,9 +10124,8 @@ namespace nirfmxspecan_grpc { float64 segment_interval = request->segment_interval(); auto status = library_->PAVTCfgSegmentStartTimeStep(instrument, selector_string, number_of_segments, segment0_start_time, segment_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10497,9 +10163,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgSegmentType(instrument, selector_string, segment_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10531,9 +10196,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->segment_type().size()); auto status = library_->PAVTCfgSegmentTypeArray(instrument, selector_string, segment_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10560,10 +10224,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PAVTFetchAmplitudeTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_amplitude()->Resize(actual_array_size, 0); float32* amplitude = response->mutable_amplitude()->mutable_data(); auto array_size = actual_array_size; @@ -10572,10 +10235,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -10607,9 +10269,8 @@ namespace nirfmxspecan_grpc { float64 mean_absolute_amplitude {}; auto status = library_->PAVTFetchPhaseAndAmplitude(instrument, selector_string, timeout, &mean_relative_phase, &mean_relative_amplitude, &mean_absolute_phase, &mean_absolute_amplitude); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mean_relative_phase(mean_relative_phase); response->set_mean_relative_amplitude(mean_relative_amplitude); @@ -10637,10 +10298,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PAVTFetchPhaseAndAmplitudeArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); float64* mean_relative_phase = response->mutable_mean_relative_phase()->mutable_data(); response->mutable_mean_relative_amplitude()->Resize(actual_array_size, 0); @@ -10655,10 +10315,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); response->mutable_mean_relative_amplitude()->Resize(actual_array_size, 0); @@ -10691,10 +10350,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PAVTFetchPhaseTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_phase()->Resize(actual_array_size, 0); float32* phase = response->mutable_phase()->mutable_data(); auto array_size = actual_array_size; @@ -10703,10 +10361,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -10736,9 +10393,8 @@ namespace nirfmxspecan_grpc { float64 rbw_percentage = request->rbw_percentage(); auto status = library_->PhaseNoiseCfgAutoRange(instrument, selector_string, start_frequency, stop_frequency, rbw_percentage); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10761,9 +10417,8 @@ namespace nirfmxspecan_grpc { int32 averaging_multiplier = request->averaging_multiplier(); auto status = library_->PhaseNoiseCfgAveragingMultiplier(instrument, selector_string, averaging_multiplier); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10821,9 +10476,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgCancellation(instrument, selector_string, cancellation_enabled, cancellation_threshold, frequency, reference_phase_noise, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10880,9 +10534,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgIntegratedNoise(instrument, selector_string, integrated_noise_range_definition, integrated_noise_start_frequency, integrated_noise_stop_frequency, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10905,9 +10558,8 @@ namespace nirfmxspecan_grpc { int32 number_of_ranges = request->number_of_ranges(); auto status = library_->PhaseNoiseCfgNumberOfRanges(instrument, selector_string, number_of_ranges); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10954,9 +10606,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgRangeArray(instrument, selector_string, range_start_frequency, range_stop_frequency, range_rbw_percentage, range_averaging_count, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -10994,9 +10645,8 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgRangeDefinition(instrument, selector_string, range_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11035,9 +10685,8 @@ namespace nirfmxspecan_grpc { float64 smoothing_percentage = request->smoothing_percentage(); auto status = library_->PhaseNoiseCfgSmoothing(instrument, selector_string, smoothing_type, smoothing_percentage); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11061,9 +10710,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->frequency_list().size()); auto status = library_->PhaseNoiseCfgSpotNoiseFrequencyList(instrument, selector_string, frequency_list, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11102,9 +10750,8 @@ namespace nirfmxspecan_grpc { float64 peak_excursion = request->peak_excursion(); auto status = library_->PhaseNoiseCfgSpurRemoval(instrument, selector_string, spur_removal_enabled, peak_excursion); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11129,9 +10776,8 @@ namespace nirfmxspecan_grpc { float64 carrier_power {}; auto status = library_->PhaseNoiseFetchCarrierMeasurement(instrument, selector_string, timeout, &carrier_frequency, &carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_carrier_frequency(carrier_frequency); response->set_carrier_power(carrier_power); @@ -11157,10 +10803,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchIntegratedNoise(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); float64* integrated_phase_noise = response->mutable_integrated_phase_noise()->mutable_data(); response->mutable_residual_pm_in_radian()->Resize(actual_array_size, 0); @@ -11177,10 +10822,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); response->mutable_residual_pm_in_radian()->Resize(actual_array_size, 0); @@ -11211,10 +10855,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchMeasuredLogPlotTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); response->mutable_measured_phase_noise()->Resize(actual_array_size, 0); @@ -11225,10 +10868,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_frequency()->Resize(actual_array_size, 0); response->mutable_measured_phase_noise()->Resize(actual_array_size, 0); @@ -11256,10 +10898,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchSmoothedLogPlotTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); response->mutable_smoothed_phase_noise()->Resize(actual_array_size, 0); @@ -11270,10 +10911,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_frequency()->Resize(actual_array_size, 0); response->mutable_smoothed_phase_noise()->Resize(actual_array_size, 0); @@ -11301,10 +10941,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PhaseNoiseFetchSpotNoise(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); float64* spot_phase_noise = response->mutable_spot_phase_noise()->mutable_data(); auto array_size = actual_array_size; @@ -11313,10 +10952,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -11342,9 +10980,8 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11366,9 +11003,8 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11423,9 +11059,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11448,9 +11083,8 @@ namespace nirfmxspecan_grpc { float64 carrier_channel_bandwidth = request->carrier_channel_bandwidth(); auto status = library_->SEMCfgCarrierChannelBandwidth(instrument, selector_string, carrier_channel_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11488,9 +11122,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgCarrierEnabled(instrument, selector_string, carrier_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11513,9 +11146,8 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency = request->carrier_frequency(); auto status = library_->SEMCfgCarrierFrequency(instrument, selector_string, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11538,9 +11170,8 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->SEMCfgCarrierIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11595,9 +11226,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgCarrierRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11636,9 +11266,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->SEMCfgCarrierRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11677,9 +11306,8 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->SEMCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11702,9 +11330,8 @@ namespace nirfmxspecan_grpc { int32 number_of_carriers = request->number_of_carriers(); auto status = library_->SEMCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11727,9 +11354,8 @@ namespace nirfmxspecan_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11769,9 +11395,8 @@ namespace nirfmxspecan_grpc { float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11823,9 +11448,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11848,9 +11472,8 @@ namespace nirfmxspecan_grpc { int32 bandwidth_integral = request->bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, bandwidth_integral); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11906,9 +11529,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_enabled, offset_sideband); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -11971,9 +11593,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_enabled, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12011,9 +11632,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetFrequencyDefinition(instrument, selector_string, offset_frequency_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12051,9 +11671,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12108,9 +11727,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12170,9 +11788,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, rbw_auto, rbw, rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12195,9 +11812,8 @@ namespace nirfmxspecan_grpc { float64 relative_attenuation = request->relative_attenuation(); auto status = library_->SEMCfgOffsetRelativeAttenuation(instrument, selector_string, relative_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12221,9 +11837,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->SEMCfgOffsetRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12263,9 +11878,8 @@ namespace nirfmxspecan_grpc { float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_mode, relative_limit_start, relative_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12317,9 +11931,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_mode, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12357,9 +11970,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12397,9 +12009,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgReferenceType(instrument, selector_string, reference_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12438,9 +12049,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -12466,10 +12076,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchAbsoluteMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_mask()->Resize(actual_array_size, 0); float32* absolute_mask = response->mutable_absolute_mask()->mutable_data(); auto array_size = actual_array_size; @@ -12478,10 +12087,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -12513,9 +12121,8 @@ namespace nirfmxspecan_grpc { float64 total_relative_power {}; auto status = library_->SEMFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &peak_absolute_power, &peak_frequency, &total_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_peak_absolute_power(peak_absolute_power); @@ -12543,9 +12150,8 @@ namespace nirfmxspecan_grpc { int32 composite_measurement_status {}; auto status = library_->SEMFetchCompositeMeasurementStatus(instrument, selector_string, timeout, &composite_measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_composite_measurement_status(static_cast(composite_measurement_status)); response->set_composite_measurement_status_raw(composite_measurement_status); @@ -12571,9 +12177,8 @@ namespace nirfmxspecan_grpc { float64 frequency_resolution {}; auto status = library_->SEMFetchFrequencyResolution(instrument, selector_string, timeout, &frequency_resolution); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_frequency_resolution(frequency_resolution); return ::grpc::Status::OK; @@ -12602,9 +12207,8 @@ namespace nirfmxspecan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -12634,10 +12238,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -12654,10 +12257,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -12701,9 +12303,8 @@ namespace nirfmxspecan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); @@ -12732,10 +12333,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -12752,10 +12352,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -12788,10 +12387,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchRelativeMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_relative_mask()->Resize(actual_array_size, 0); float32* relative_mask = response->mutable_relative_mask()->mutable_data(); auto array_size = actual_array_size; @@ -12800,10 +12398,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -12834,10 +12431,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -12846,10 +12442,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -12878,9 +12473,8 @@ namespace nirfmxspecan_grpc { float64 total_carrier_power {}; auto status = library_->SEMFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_carrier_power(total_carrier_power); return ::grpc::Status::OK; @@ -12909,9 +12503,8 @@ namespace nirfmxspecan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -12941,10 +12534,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -12961,10 +12553,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -13008,9 +12599,8 @@ namespace nirfmxspecan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); @@ -13039,10 +12629,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -13059,10 +12648,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -13108,9 +12696,8 @@ namespace nirfmxspecan_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13131,9 +12718,8 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13157,9 +12743,8 @@ namespace nirfmxspecan_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13184,9 +12769,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13210,9 +12794,8 @@ namespace nirfmxspecan_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13237,9 +12820,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13272,9 +12854,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13316,9 +12897,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13351,9 +12931,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13377,9 +12956,8 @@ namespace nirfmxspecan_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13404,9 +12982,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13439,9 +13016,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13486,9 +13062,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13516,9 +13091,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13543,9 +13117,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13588,9 +13161,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13623,9 +13195,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13652,9 +13223,8 @@ namespace nirfmxspecan_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13679,9 +13249,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13706,9 +13275,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13732,9 +13300,8 @@ namespace nirfmxspecan_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13759,9 +13326,8 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13816,9 +13382,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13857,9 +13422,8 @@ namespace nirfmxspecan_grpc { int32 detector_points = request->detector_points(); auto status = library_->SpectrumCfgDetector(instrument, selector_string, detector_type, detector_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13898,9 +13462,8 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->SpectrumCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13924,9 +13487,8 @@ namespace nirfmxspecan_grpc { float64 stop_frequency = request->stop_frequency(); auto status = library_->SpectrumCfgFrequencyStartStop(instrument, selector_string, start_frequency, stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -13964,9 +13526,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14004,9 +13565,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgPowerUnits(instrument, selector_string, spectrum_power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14061,9 +13621,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14086,9 +13645,8 @@ namespace nirfmxspecan_grpc { float64 span = request->span(); auto status = library_->SpectrumCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14127,9 +13685,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SpectrumCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14169,9 +13726,8 @@ namespace nirfmxspecan_grpc { float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->SpectrumCfgVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14197,9 +13753,8 @@ namespace nirfmxspecan_grpc { float64 frequency_resolution {}; auto status = library_->SpectrumFetchMeasurement(instrument, selector_string, timeout, &peak_amplitude, &peak_frequency, &frequency_resolution); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_peak_amplitude(peak_amplitude); response->set_peak_frequency(peak_frequency); @@ -14228,10 +13783,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpectrumFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -14240,10 +13794,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -14274,10 +13827,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpectrumFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -14286,10 +13838,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -14320,10 +13871,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpectrumRead(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -14332,10 +13882,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -14363,9 +13912,8 @@ namespace nirfmxspecan_grpc { int32 noise_calibration_data_valid {}; auto status = library_->SpectrumValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); @@ -14422,9 +13970,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14462,9 +14009,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgFFTWindowType(instrument, selector_string, fft_window); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14487,9 +14033,8 @@ namespace nirfmxspecan_grpc { int32 number_of_ranges = request->number_of_ranges(); auto status = library_->SpurCfgNumberOfRanges(instrument, selector_string, number_of_ranges); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14529,9 +14074,8 @@ namespace nirfmxspecan_grpc { float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SpurCfgRangeAbsoluteLimit(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14583,9 +14127,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeAbsoluteLimitArray(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14624,9 +14167,8 @@ namespace nirfmxspecan_grpc { int32 detector_points = request->detector_points(); auto status = library_->SpurCfgRangeDetector(instrument, selector_string, detector_type, detector_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14675,9 +14217,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeDetectorArray(instrument, selector_string, detector_type, detector_points, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14717,9 +14258,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeFrequency(instrument, selector_string, start_frequency, stop_frequency, range_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14771,9 +14311,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeFrequencyArray(instrument, selector_string, start_frequency, stop_frequency, range_enabled, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14796,9 +14335,8 @@ namespace nirfmxspecan_grpc { int32 number_of_spurs_to_report = request->number_of_spurs_to_report(); auto status = library_->SpurCfgRangeNumberOfSpursToReport(instrument, selector_string, number_of_spurs_to_report); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14822,9 +14360,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->number_of_spurs_to_report().size()); auto status = library_->SpurCfgRangeNumberOfSpursToReportArray(instrument, selector_string, number_of_spurs_to_report, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14848,9 +14385,8 @@ namespace nirfmxspecan_grpc { float64 excursion = request->excursion(); auto status = library_->SpurCfgRangePeakCriteria(instrument, selector_string, threshold, excursion); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14891,9 +14427,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangePeakCriteriaArray(instrument, selector_string, threshold, excursion, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -14953,9 +14488,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeRBWArray(instrument, selector_string, rbw_auto, rbw, rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15010,9 +14544,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15035,9 +14568,8 @@ namespace nirfmxspecan_grpc { float64 relative_attenuation = request->relative_attenuation(); auto status = library_->SpurCfgRangeRelativeAttenuation(instrument, selector_string, relative_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15061,9 +14593,8 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->SpurCfgRangeRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15102,9 +14633,8 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SpurCfgRangeSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15153,9 +14683,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeSweepTimeArray(instrument, selector_string, sweep_time_auto, sweep_time_interval, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15195,9 +14724,8 @@ namespace nirfmxspecan_grpc { float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->SpurCfgRangeVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15249,9 +14777,8 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeVBWFilterArray(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15274,9 +14801,8 @@ namespace nirfmxspecan_grpc { int32 trace_range_index = request->trace_range_index(); auto status = library_->SpurCfgTraceRangeIndex(instrument, selector_string, trace_range_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15300,10 +14826,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchAllSpurs(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spur_frequency()->Resize(actual_array_size, 0); float64* spur_frequency = response->mutable_spur_frequency()->mutable_data(); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); @@ -15320,10 +14845,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_spur_frequency()->Resize(actual_array_size, 0); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); @@ -15354,9 +14878,8 @@ namespace nirfmxspecan_grpc { int32 measurement_status {}; auto status = library_->SpurFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -15384,10 +14907,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchRangeAbsoluteLimitTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_absolute_limit()->Resize(actual_array_size, 0); float32* absolute_limit = response->mutable_absolute_limit()->mutable_data(); auto array_size = actual_array_size; @@ -15396,10 +14918,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -15430,10 +14951,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchRangeSpectrumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_range_spectrum()->Resize(actual_array_size, 0); float32* range_spectrum = response->mutable_range_spectrum()->mutable_data(); auto array_size = actual_array_size; @@ -15442,10 +14962,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -15475,9 +14994,8 @@ namespace nirfmxspecan_grpc { int32 detected_spurs {}; auto status = library_->SpurFetchRangeStatus(instrument, selector_string, timeout, &range_status, &detected_spurs); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_range_status(static_cast(range_status)); response->set_range_status_raw(range_status); @@ -15504,10 +15022,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchRangeStatusArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_range_status_raw()->Resize(actual_array_size, 0); int32* range_status = reinterpret_cast(response->mutable_range_status_raw()->mutable_data()); response->mutable_number_of_detected_spurs()->Resize(actual_array_size, 0); @@ -15518,10 +15035,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_range_status()->Clear(); response->mutable_range_status()->Reserve(actual_array_size); @@ -15561,9 +15077,8 @@ namespace nirfmxspecan_grpc { float64 spur_absolute_limit {}; auto status = library_->SpurFetchSpurMeasurement(instrument, selector_string, timeout, &spur_frequency, &spur_amplitude, &spur_margin, &spur_absolute_limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_spur_frequency(spur_frequency); response->set_spur_amplitude(spur_amplitude); @@ -15591,10 +15106,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SpurFetchSpurMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spur_frequency()->Resize(actual_array_size, 0); float64* spur_frequency = response->mutable_spur_frequency()->mutable_data(); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); @@ -15609,10 +15123,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_spur_frequency()->Resize(actual_array_size, 0); response->mutable_spur_amplitude()->Resize(actual_array_size, 0); @@ -15673,9 +15186,8 @@ namespace nirfmxspecan_grpc { auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15698,9 +15210,8 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->TXPCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15740,9 +15251,8 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->TXPCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15797,9 +15307,8 @@ namespace nirfmxspecan_grpc { auto status = library_->TXPCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15839,9 +15348,8 @@ namespace nirfmxspecan_grpc { float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->TXPCfgVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -15868,9 +15376,8 @@ namespace nirfmxspecan_grpc { float64 minimum_power {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_mean_power, &peak_to_average_ratio, &maximum_power, &minimum_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_mean_power(average_mean_power); response->set_peak_to_average_ratio(peak_to_average_ratio); @@ -15900,10 +15407,9 @@ namespace nirfmxspecan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -15912,10 +15418,9 @@ namespace nirfmxspecan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -15947,9 +15452,8 @@ namespace nirfmxspecan_grpc { float64 minimum_power {}; auto status = library_->TXPRead(instrument, selector_string, timeout, &average_mean_power, &peak_to_average_ratio, &maximum_power, &minimum_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_mean_power(average_mean_power); response->set_peak_to_average_ratio(peak_to_average_ratio); @@ -15975,9 +15479,8 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -16000,9 +15503,8 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp index 8983d3789..6ac3e5556 100644 --- a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp +++ b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp @@ -61,11 +61,12 @@ namespace nirfmxspecan_restricted_grpc { selector_string_out.resize(selector_string_out_size - 1); } auto status = library_->CacheResult(instrument, selector_string, selector_string_out_size, (char*)selector_string_out.data()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); - if (status_ok(status)) { response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); - } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -93,9 +94,8 @@ namespace nirfmxspecan_restricted_grpc { int32 actual_array_size {}; while (true) { auto status = library_->IQFetchDataOverrideBehavior(instrument, selector_string, timeout, record_to_fetch, samples_to_read, delete_on_fetch, &t0, &dt, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } std::vector data(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -104,8 +104,10 @@ namespace nirfmxspecan_restricted_grpc { // buffer is now too small, try again continue; } + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); - if (status_ok(status)) { response->set_t0(t0); response->set_dt(dt); convert_to_grpc(data, response->mutable_data()); @@ -117,7 +119,6 @@ namespace nirfmxspecan_restricted_grpc { } } response->set_actual_array_size(actual_array_size); - } return ::grpc::Status::OK; } } diff --git a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h index 476cf361b..d65cfba1d 100644 --- a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h +++ b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h @@ -46,6 +46,7 @@ class NiRFmxSpecAnRestrictedService final : public NiRFmxSpecAnRestricted::Servi private: NiRFmxSpecAnRestrictedLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); NiRFmxSpecAnRestrictedFeatureToggles feature_toggles_; }; diff --git a/generated/nirfmxwlan/nirfmxwlan_service.cpp b/generated/nirfmxwlan/nirfmxwlan_service.cpp index ad6983d15..3f933954c 100644 --- a/generated/nirfmxwlan/nirfmxwlan_service.cpp +++ b/generated/nirfmxwlan/nirfmxwlan_service.cpp @@ -61,9 +61,8 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -92,9 +91,8 @@ namespace nirfmxwlan_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -141,9 +139,8 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto status = library_->AnalyzeNWaveformsIQ(instrument, selector_string, result_name, x0, dx, iq.data(), iq_sizes, array_size, reset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -190,9 +187,8 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto status = library_->AnalyzeNWaveformsSpectrum(instrument, selector_string, result_name, x0, dx, spectrum, spectrum_sizes, array_size, reset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -221,9 +217,8 @@ namespace nirfmxwlan_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -246,9 +241,8 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->AutoDetectSignal(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -271,9 +265,8 @@ namespace nirfmxwlan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->AutoLevel(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -295,10 +288,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildChainString(selector_string, chain_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -310,10 +302,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -338,10 +329,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildGateString(selector_string, gate_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -353,10 +343,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -381,10 +370,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -396,10 +384,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -424,10 +411,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildSegmentString(selector_string, segment_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -439,10 +425,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -467,10 +452,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_length = status; std::string selector_string; @@ -482,10 +466,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string(selector_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); @@ -510,10 +493,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildStreamString(selector_string, stream_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -525,10 +507,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -553,10 +534,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildUserString(selector_string, user_number, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + } int32 selector_string_out_length = status; std::string selector_string_out; @@ -568,10 +548,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + } response->set_status(status); response->set_selector_string_out(selector_string_out); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); @@ -597,9 +576,8 @@ namespace nirfmxwlan_grpc { float64 channel_bandwidth = request->channel_bandwidth(); auto status = library_->CfgChannelBandwidth(instrument, selector_string, channel_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -640,9 +618,8 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -665,9 +642,8 @@ namespace nirfmxwlan_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -690,9 +666,8 @@ namespace nirfmxwlan_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -716,9 +691,8 @@ namespace nirfmxwlan_grpc { int32 number_of_elements = static_cast(request->center_frequency().size()); auto status = library_->CfgFrequencyArray(instrument, selector_string, center_frequency, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -761,9 +735,8 @@ namespace nirfmxwlan_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -838,9 +811,8 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -879,9 +851,8 @@ namespace nirfmxwlan_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -905,9 +876,8 @@ namespace nirfmxwlan_grpc { int32 number_of_receive_chains = request->number_of_receive_chains(); auto status = library_->CfgNumberOfFrequencySegmentsAndReceiveChains(instrument, selector_string, number_of_frequency_segments, number_of_receive_chains); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -946,9 +916,8 @@ namespace nirfmxwlan_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -971,9 +940,8 @@ namespace nirfmxwlan_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -996,9 +964,8 @@ namespace nirfmxwlan_grpc { char* selected_ports = (char*)request->selected_ports().c_str(); auto status = library_->CfgSelectedPortsMultiple(instrument, selector_string, selected_ports); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1022,9 +989,8 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1062,9 +1028,8 @@ namespace nirfmxwlan_grpc { auto status = library_->CfgStandard(instrument, selector_string, standard); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1087,9 +1052,8 @@ namespace nirfmxwlan_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -1112,9 +1076,8 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1136,9 +1099,8 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1161,9 +1123,8 @@ namespace nirfmxwlan_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1186,9 +1147,8 @@ namespace nirfmxwlan_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1210,9 +1170,8 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1234,9 +1193,8 @@ namespace nirfmxwlan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1275,9 +1233,8 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->DSSSModAccCfgAcquisitionLength(instrument, selector_string, acquisition_length_mode, acquisition_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1316,9 +1273,8 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->DSSSModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1356,9 +1312,8 @@ namespace nirfmxwlan_grpc { auto status = library_->DSSSModAccCfgEVMUnit(instrument, selector_string, evm_unit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1382,9 +1337,8 @@ namespace nirfmxwlan_grpc { int32 maximum_measurement_length = request->maximum_measurement_length(); auto status = library_->DSSSModAccCfgMeasurementLength(instrument, selector_string, measurement_offset, maximum_measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1425,9 +1379,8 @@ namespace nirfmxwlan_grpc { auto status = library_->DSSSModAccCfgPowerMeasurementCustomGateArray(instrument, selector_string, start_time, stop_time, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1465,9 +1418,8 @@ namespace nirfmxwlan_grpc { auto status = library_->DSSSModAccCfgPowerMeasurementEnabled(instrument, selector_string, power_measurement_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1490,9 +1442,8 @@ namespace nirfmxwlan_grpc { int32 number_of_custom_gates = request->number_of_custom_gates(); auto status = library_->DSSSModAccCfgPowerMeasurementNumberOfCustomGates(instrument, selector_string, number_of_custom_gates); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1519,9 +1470,8 @@ namespace nirfmxwlan_grpc { float64 ppdu_average_power_mean {}; auto status = library_->DSSSModAccFetchAveragePowers(instrument, selector_string, timeout, &preamble_average_power_mean, &header_average_power_mean, &data_average_power_mean, &ppdu_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_preamble_average_power_mean(preamble_average_power_mean); response->set_header_average_power_mean(header_average_power_mean); @@ -1549,10 +1499,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->DSSSModAccFetchConstellationTrace(instrument, selector_string, timeout, constellation.data(), array_size, &actual_array_size); @@ -1560,10 +1509,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(constellation, response->mutable_constellation()); { @@ -1597,10 +1545,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchCustomGatePowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_average_power_mean()->Resize(actual_array_size, 0); float64* average_power_mean = response->mutable_average_power_mean()->mutable_data(); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); @@ -1611,10 +1558,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_average_power_mean()->Resize(actual_array_size, 0); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); @@ -1642,10 +1588,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchDecodedHeaderBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); int32* decoded_header_bits = reinterpret_cast(response->mutable_decoded_header_bits()->mutable_data()); auto array_size = actual_array_size; @@ -1654,10 +1599,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1684,10 +1628,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchDecodedPSDUBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); int32* decoded_psdu_bits = reinterpret_cast(response->mutable_decoded_psdu_bits()->mutable_data()); auto array_size = actual_array_size; @@ -1696,10 +1639,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -1732,9 +1674,8 @@ namespace nirfmxwlan_grpc { int32 number_of_chips_used {}; auto status = library_->DSSSModAccFetchEVM(instrument, selector_string, timeout, &rms_evm_mean, &peak_evm_80211_2016_maximum, &peak_evm_80211_2007_maximum, &peak_evm_80211_1999_maximum, &frequency_error_mean, &chip_clock_error_mean, &number_of_chips_used); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_rms_evm_mean(rms_evm_mean); response->set_peak_evm_80211_2016_maximum(peak_evm_80211_2016_maximum); @@ -1767,10 +1708,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->DSSSModAccFetchEVMPerChipMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_evm_per_chip_mean()->Resize(actual_array_size, 0); float32* evm_per_chip_mean = response->mutable_evm_per_chip_mean()->mutable_data(); auto array_size = actual_array_size; @@ -1779,10 +1719,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -1813,9 +1752,8 @@ namespace nirfmxwlan_grpc { float64 iq_quadrature_error_mean {}; auto status = library_->DSSSModAccFetchIQImpairments(instrument, selector_string, timeout, &iq_origin_offset_mean, &iq_gain_imbalance_mean, &iq_quadrature_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_iq_origin_offset_mean(iq_origin_offset_mean); response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); @@ -1847,9 +1785,8 @@ namespace nirfmxwlan_grpc { int32 psdu_crc_status {}; auto status = library_->DSSSModAccFetchPPDUInformation(instrument, selector_string, timeout, &data_modulation_format, &payload_length, &preamble_type, &locked_clocks_bit, &header_crc_status, &psdu_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_data_modulation_format(static_cast(data_modulation_format)); response->set_data_modulation_format_raw(data_modulation_format); @@ -1886,9 +1823,8 @@ namespace nirfmxwlan_grpc { float64 ppdu_peak_power_maximum {}; auto status = library_->DSSSModAccFetchPeakPowers(instrument, selector_string, timeout, &preamble_peak_power_maximum, &header_peak_power_maximum, &data_peak_power_maximum, &ppdu_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_preamble_peak_power_maximum(preamble_peak_power_maximum); response->set_header_peak_power_maximum(header_peak_power_maximum); @@ -1914,9 +1850,8 @@ namespace nirfmxwlan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1938,9 +1873,8 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1964,10 +1898,9 @@ namespace nirfmxwlan_grpc { int32 default_result_exists {}; while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string result_names; if (actual_result_names_size > 0) { result_names.resize(actual_result_names_size - 1); @@ -1978,10 +1911,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_result_names(result_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); @@ -2010,9 +1942,8 @@ namespace nirfmxwlan_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2037,10 +1968,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -2049,10 +1979,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2079,9 +2008,8 @@ namespace nirfmxwlan_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2106,10 +2034,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); auto array_size = actual_array_size; @@ -2118,10 +2045,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2148,9 +2074,8 @@ namespace nirfmxwlan_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2175,9 +2100,8 @@ namespace nirfmxwlan_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); @@ -2208,10 +2132,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); auto array_size = actual_array_size; @@ -2220,10 +2143,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); auto checked_convert_attr_val = [](auto raw_value) { bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); @@ -2264,9 +2186,8 @@ namespace nirfmxwlan_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2291,10 +2212,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2303,10 +2223,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2333,9 +2252,8 @@ namespace nirfmxwlan_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2360,10 +2278,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2371,10 +2288,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); @@ -2410,10 +2326,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2421,10 +2336,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -2458,10 +2372,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size, &actual_array_size); @@ -2469,10 +2382,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(attr_val, response->mutable_attr_val()); { @@ -2506,10 +2418,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 array_size = status; std::string attr_val; @@ -2521,10 +2432,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); @@ -2551,9 +2461,8 @@ namespace nirfmxwlan_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2578,9 +2487,8 @@ namespace nirfmxwlan_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2605,10 +2513,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2617,10 +2524,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2647,10 +2553,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); auto array_size = actual_array_size; @@ -2659,10 +2564,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_attr_val()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -2689,9 +2593,8 @@ namespace nirfmxwlan_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_attr_val(attr_val); return ::grpc::Status::OK; @@ -2716,10 +2619,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, (uInt8*)attr_val.data(), array_size, &actual_array_size); @@ -2727,10 +2629,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_attr_val(attr_val); response->mutable_attr_val()->resize(actual_array_size); @@ -2756,10 +2657,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; int32 error_code {}; @@ -2772,10 +2672,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -2802,10 +2701,9 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } int32 error_description_buffer_size = status; std::string error_description; @@ -2817,10 +2715,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -2854,9 +2751,8 @@ namespace nirfmxwlan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXWLAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); response->set_is_new_session(is_new_session); @@ -2891,9 +2787,8 @@ namespace nirfmxwlan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXWLAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); } - response->set_status(status); response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; @@ -2920,9 +2815,8 @@ namespace nirfmxwlan_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2945,9 +2839,8 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->OFDMModAccAutoLevel(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2973,9 +2866,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->reference_waveform().size()); auto status = library_->OFDMModAccCfg1ReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3014,9 +2906,8 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->OFDMModAccCfgAcquisitionLength(instrument, selector_string, acquisition_length_mode, acquisition_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3054,9 +2945,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgAmplitudeTrackingEnabled(instrument, selector_string, amplitude_tracking_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3095,9 +2985,8 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->OFDMModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3135,9 +3024,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgChannelEstimationType(instrument, selector_string, channel_estimation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3175,9 +3063,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgCommonClockSourceEnabled(instrument, selector_string, common_clock_source_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3215,9 +3102,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgEVMUnit(instrument, selector_string, evm_unit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3255,9 +3141,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgFrequencyErrorEstimationMethod(instrument, selector_string, frequency_error_estimation_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3281,9 +3166,8 @@ namespace nirfmxwlan_grpc { int32 maximum_measurement_length = request->maximum_measurement_length(); auto status = library_->OFDMModAccCfgMeasurementLength(instrument, selector_string, measurement_offset, maximum_measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3321,9 +3205,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgMeasurementMode(instrument, selector_string, measurement_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3368,9 +3251,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgNReferenceWaveforms(instrument, selector_string, x0, dx, reference_waveform.data(), reference_waveform_sizes, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3408,9 +3290,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3449,9 +3330,8 @@ namespace nirfmxwlan_grpc { double optimize_dynamic_range_for_evm_margin = request->optimize_dynamic_range_for_evm_margin(); auto status = library_->OFDMModAccCfgOptimizeDynamicRangeForEVM(instrument, selector_string, optimize_dynamic_range_for_evm_enabled, optimize_dynamic_range_for_evm_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3489,9 +3369,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgPhaseTrackingEnabled(instrument, selector_string, phase_tracking_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3529,9 +3408,8 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgSymbolClockErrorCorrectionEnabled(instrument, selector_string, symbol_clock_error_correction_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3552,9 +3430,8 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->OFDMModAccClearNoiseCalibrationDatabase(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3580,10 +3457,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_chain_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_data_rms_evm_per_symbol_mean = response->mutable_chain_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3592,10 +3468,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3626,10 +3501,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_chain_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_pilot_rms_evm_per_symbol_mean = response->mutable_chain_pilot_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3638,10 +3512,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3672,9 +3545,8 @@ namespace nirfmxwlan_grpc { float64 chain_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchChainRMSEVM(instrument, selector_string, timeout, &chain_rms_evm_mean, &chain_data_rms_evm_mean, &chain_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_chain_rms_evm_mean(chain_rms_evm_mean); response->set_chain_data_rms_evm_mean(chain_data_rms_evm_mean); @@ -3703,10 +3575,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_chain_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* chain_rms_evm_per_subcarrier_mean = response->mutable_chain_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3715,10 +3586,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3749,10 +3619,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChainRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_chain_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_rms_evm_per_symbol_mean = response->mutable_chain_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -3761,10 +3630,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3795,10 +3663,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchChannelFrequencyResponseMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_channel_frequency_response_mean_magnitude()->Resize(actual_array_size, 0); float32* channel_frequency_response_mean_magnitude = response->mutable_channel_frequency_response_mean_magnitude()->mutable_data(); response->mutable_channel_frequency_response_mean_phase()->Resize(actual_array_size, 0); @@ -3809,10 +3676,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3844,10 +3710,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchCommonPilotErrorTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_common_pilot_error_magnitude()->Resize(actual_array_size, 0); float32* common_pilot_error_magnitude = response->mutable_common_pilot_error_magnitude()->mutable_data(); response->mutable_common_pilot_error_phase()->Resize(actual_array_size, 0); @@ -3858,10 +3723,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -3893,9 +3757,8 @@ namespace nirfmxwlan_grpc { float64 composite_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchCompositeRMSEVM(instrument, selector_string, timeout, &composite_rms_evm_mean, &composite_data_rms_evm_mean, &composite_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_composite_rms_evm_mean(composite_rms_evm_mean); response->set_composite_data_rms_evm_mean(composite_data_rms_evm_mean); @@ -3922,9 +3785,8 @@ namespace nirfmxwlan_grpc { float64 cross_power_mean {}; auto status = library_->OFDMModAccFetchCrossPower(instrument, selector_string, timeout, &cross_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_cross_power_mean(cross_power_mean); return ::grpc::Status::OK; @@ -3949,10 +3811,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchCustomGatePowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_average_power_mean()->Resize(actual_array_size, 0); float64* average_power_mean = response->mutable_average_power_mean()->mutable_data(); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); @@ -3963,10 +3824,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_average_power_mean()->Resize(actual_array_size, 0); response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); @@ -3994,9 +3854,8 @@ namespace nirfmxwlan_grpc { float64 data_average_power_mean {}; auto status = library_->OFDMModAccFetchDataAveragePower(instrument, selector_string, timeout, &data_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_data_average_power_mean(data_average_power_mean); return ::grpc::Status::OK; @@ -4021,10 +3880,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchDataConstellationTrace(instrument, selector_string, timeout, data_constellation.data(), array_size, &actual_array_size); @@ -4032,10 +3890,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(data_constellation, response->mutable_data_constellation()); { @@ -4069,9 +3926,8 @@ namespace nirfmxwlan_grpc { float64 data_peak_power_maximum {}; auto status = library_->OFDMModAccFetchDataPeakPower(instrument, selector_string, timeout, &data_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_data_peak_power_maximum(data_peak_power_maximum); return ::grpc::Status::OK; @@ -4096,10 +3952,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedEHTSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); int32* decoded_eht_sig_bits = reinterpret_cast(response->mutable_decoded_eht_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4108,10 +3963,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4138,10 +3992,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedLSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); int32* decoded_l_sig_bits = reinterpret_cast(response->mutable_decoded_l_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4150,10 +4003,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4180,10 +4032,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedPSDUBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); int32* decoded_psdu_bits = reinterpret_cast(response->mutable_decoded_psdu_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4192,10 +4043,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4222,10 +4072,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedSIGBBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); int32* decoded_sig_b_bits = reinterpret_cast(response->mutable_decoded_sig_b_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4234,10 +4083,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4264,10 +4112,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); int32* decoded_sig_bits = reinterpret_cast(response->mutable_decoded_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4276,10 +4123,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4306,10 +4152,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedServiceBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); int32* decoded_service_bits = reinterpret_cast(response->mutable_decoded_service_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4318,10 +4163,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4348,10 +4192,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchDecodedUSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); int32* decoded_u_sig_bits = reinterpret_cast(response->mutable_decoded_u_sig_bits()->mutable_data()); auto array_size = actual_array_size; @@ -4360,10 +4203,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4390,10 +4232,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchEVMSubcarrierIndices(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); int32* subcarrier_indices = reinterpret_cast(response->mutable_subcarrier_indices()->mutable_data()); auto array_size = actual_array_size; @@ -4402,10 +4243,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -4432,9 +4272,8 @@ namespace nirfmxwlan_grpc { float64 frequency_error_ccdf_10_percent {}; auto status = library_->OFDMModAccFetchFrequencyErrorCCDF10Percent(instrument, selector_string, timeout, &frequency_error_ccdf_10_percent); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_frequency_error_ccdf_10_percent(frequency_error_ccdf_10_percent); return ::grpc::Status::OK; @@ -4459,9 +4298,8 @@ namespace nirfmxwlan_grpc { float64 frequency_error_mean {}; auto status = library_->OFDMModAccFetchFrequencyErrorMean(instrument, selector_string, timeout, &frequency_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_frequency_error_mean(frequency_error_mean); return ::grpc::Status::OK; @@ -4488,10 +4326,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchGroupDelayMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_group_delay_mean()->Resize(actual_array_size, 0); float32* group_delay_mean = response->mutable_group_delay_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4500,10 +4337,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4532,9 +4368,8 @@ namespace nirfmxwlan_grpc { int32 guard_interval_type {}; auto status = library_->OFDMModAccFetchGuardIntervalType(instrument, selector_string, timeout, &guard_interval_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_guard_interval_type(static_cast(guard_interval_type)); response->set_guard_interval_type_raw(guard_interval_type); @@ -4562,10 +4397,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchIQGainImbalancePerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_gain_imbalance_per_subcarrier_mean = response->mutable_iq_gain_imbalance_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4574,10 +4408,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4610,9 +4443,8 @@ namespace nirfmxwlan_grpc { float64 iq_timing_skew_mean {}; auto status = library_->OFDMModAccFetchIQImpairments(instrument, selector_string, timeout, &relative_iq_origin_offset_mean, &iq_gain_imbalance_mean, &iq_quadrature_error_mean, &absolute_iq_origin_offset_mean, &iq_timing_skew_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_relative_iq_origin_offset_mean(relative_iq_origin_offset_mean); response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); @@ -4643,10 +4475,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_quadrature_error_per_subcarrier_mean = response->mutable_iq_quadrature_error_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -4655,10 +4486,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -4687,9 +4517,8 @@ namespace nirfmxwlan_grpc { int32 l_sig_parity_check_status {}; auto status = library_->OFDMModAccFetchLSIGParityCheckStatus(instrument, selector_string, timeout, &l_sig_parity_check_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_l_sig_parity_check_status(static_cast(l_sig_parity_check_status)); response->set_l_sig_parity_check_status_raw(l_sig_parity_check_status); @@ -4715,9 +4544,8 @@ namespace nirfmxwlan_grpc { int32 ltf_size {}; auto status = library_->OFDMModAccFetchLTFSize(instrument, selector_string, timeout, <f_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ltf_size(static_cast(ltf_size)); response->set_ltf_size_raw(ltf_size); @@ -4743,9 +4571,8 @@ namespace nirfmxwlan_grpc { int32 mcs_index {}; auto status = library_->OFDMModAccFetchMCSIndex(instrument, selector_string, timeout, &mcs_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_mcs_index(mcs_index); return ::grpc::Status::OK; @@ -4770,9 +4597,8 @@ namespace nirfmxwlan_grpc { int32 number_of_he_sig_b_symbols {}; auto status = library_->OFDMModAccFetchNumberOfHESIGBSymbols(instrument, selector_string, timeout, &number_of_he_sig_b_symbols); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_number_of_he_sig_b_symbols(number_of_he_sig_b_symbols); return ::grpc::Status::OK; @@ -4797,9 +4623,8 @@ namespace nirfmxwlan_grpc { int32 number_of_space_time_streams {}; auto status = library_->OFDMModAccFetchNumberOfSpaceTimeStreams(instrument, selector_string, timeout, &number_of_space_time_streams); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_number_of_space_time_streams(number_of_space_time_streams); return ::grpc::Status::OK; @@ -4824,9 +4649,8 @@ namespace nirfmxwlan_grpc { int32 number_of_users {}; auto status = library_->OFDMModAccFetchNumberOfUsers(instrument, selector_string, timeout, &number_of_users); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_number_of_users(number_of_users); return ::grpc::Status::OK; @@ -4851,9 +4675,8 @@ namespace nirfmxwlan_grpc { int32 number_of_symbols_used {}; auto status = library_->OFDMModAccFetchNumberofSymbolsUsed(instrument, selector_string, timeout, &number_of_symbols_used); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_number_of_symbols_used(number_of_symbols_used); return ::grpc::Status::OK; @@ -4878,9 +4701,8 @@ namespace nirfmxwlan_grpc { float64 pe_average_power_mean {}; auto status = library_->OFDMModAccFetchPEAveragePower(instrument, selector_string, timeout, &pe_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pe_average_power_mean(pe_average_power_mean); return ::grpc::Status::OK; @@ -4905,9 +4727,8 @@ namespace nirfmxwlan_grpc { float64 pe_duration {}; auto status = library_->OFDMModAccFetchPEDuration(instrument, selector_string, timeout, &pe_duration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pe_duration(pe_duration); return ::grpc::Status::OK; @@ -4932,9 +4753,8 @@ namespace nirfmxwlan_grpc { float64 pe_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPEPeakPower(instrument, selector_string, timeout, &pe_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_pe_peak_power_maximum(pe_peak_power_maximum); return ::grpc::Status::OK; @@ -4959,9 +4779,8 @@ namespace nirfmxwlan_grpc { float64 ppdu_average_power_mean {}; auto status = library_->OFDMModAccFetchPPDUAveragePower(instrument, selector_string, timeout, &ppdu_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ppdu_average_power_mean(ppdu_average_power_mean); return ::grpc::Status::OK; @@ -4986,9 +4805,8 @@ namespace nirfmxwlan_grpc { float64 ppdu_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPPDUPeakPower(instrument, selector_string, timeout, &ppdu_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); return ::grpc::Status::OK; @@ -5013,9 +4831,8 @@ namespace nirfmxwlan_grpc { int32 ppdu_type {}; auto status = library_->OFDMModAccFetchPPDUType(instrument, selector_string, timeout, &ppdu_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ppdu_type(static_cast(ppdu_type)); response->set_ppdu_type_raw(ppdu_type); @@ -5041,9 +4858,8 @@ namespace nirfmxwlan_grpc { int32 psdu_crc_status {}; auto status = library_->OFDMModAccFetchPSDUCRCStatus(instrument, selector_string, timeout, &psdu_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_psdu_crc_status(static_cast(psdu_crc_status)); response->set_psdu_crc_status_raw(psdu_crc_status); @@ -5069,10 +4885,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchPilotConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector pilot_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchPilotConstellationTrace(instrument, selector_string, timeout, pilot_constellation.data(), array_size, &actual_array_size); @@ -5080,10 +4895,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(pilot_constellation, response->mutable_pilot_constellation()); { @@ -5120,9 +4934,8 @@ namespace nirfmxwlan_grpc { float64 vht_sig_b_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211ac(instrument, selector_string, timeout, &vht_sig_a_average_power_mean, &vht_stf_average_power_mean, &vht_ltf_average_power_mean, &vht_sig_b_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_vht_sig_a_average_power_mean(vht_sig_a_average_power_mean); response->set_vht_stf_average_power_mean(vht_stf_average_power_mean); @@ -5154,9 +4967,8 @@ namespace nirfmxwlan_grpc { float64 he_ltf_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211ax(instrument, selector_string, timeout, &rl_sig_average_power_mean, &he_sig_a_average_power_mean, &he_sig_b_average_power_mean, &he_stf_average_power_mean, &he_ltf_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_rl_sig_average_power_mean(rl_sig_average_power_mean); response->set_he_sig_a_average_power_mean(he_sig_a_average_power_mean); @@ -5188,9 +5000,8 @@ namespace nirfmxwlan_grpc { float64 ht_eltf_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211n(instrument, selector_string, timeout, &ht_sig_average_power_mean, &ht_stf_average_power_mean, &ht_dltf_average_power_mean, &ht_eltf_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ht_sig_average_power_mean(ht_sig_average_power_mean); response->set_ht_stf_average_power_mean(ht_stf_average_power_mean); @@ -5220,9 +5031,8 @@ namespace nirfmxwlan_grpc { float64 l_sig_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowersCommon(instrument, selector_string, timeout, &l_stf_average_power_mean, &l_ltf_average_power_mean, &l_sig_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_l_stf_average_power_mean(l_stf_average_power_mean); response->set_l_ltf_average_power_mean(l_ltf_average_power_mean); @@ -5251,10 +5061,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchPreambleFrequencyErrorTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_preamble_frequency_error()->Resize(actual_array_size, 0); float32* preamble_frequency_error = response->mutable_preamble_frequency_error()->mutable_data(); auto array_size = actual_array_size; @@ -5263,10 +5072,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5298,9 +5106,8 @@ namespace nirfmxwlan_grpc { float64 vht_sig_b_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211ac(instrument, selector_string, timeout, &vht_sig_a_peak_power_maximum, &vht_stf_peak_power_maximum, &vht_ltf_peak_power_maximum, &vht_sig_b_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_vht_sig_a_peak_power_maximum(vht_sig_a_peak_power_maximum); response->set_vht_stf_peak_power_maximum(vht_stf_peak_power_maximum); @@ -5332,9 +5139,8 @@ namespace nirfmxwlan_grpc { float64 he_ltf_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211ax(instrument, selector_string, timeout, &rl_sig_peak_power_maximum, &he_sig_a_peak_power_maximum, &he_sig_b_peak_power_maximum, &he_stf_peak_power_maximum, &he_ltf_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_rl_sig_peak_power_maximum(rl_sig_peak_power_maximum); response->set_he_sig_a_peak_power_maximum(he_sig_a_peak_power_maximum); @@ -5366,9 +5172,8 @@ namespace nirfmxwlan_grpc { float64 ht_eltf_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211n(instrument, selector_string, timeout, &ht_sig_peak_power_maximum, &ht_stf_peak_power_maximum, &ht_dltf_peak_power_maximum, &ht_eltf_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ht_sig_peak_power_maximum(ht_sig_peak_power_maximum); response->set_ht_stf_peak_power_maximum(ht_stf_peak_power_maximum); @@ -5398,9 +5203,8 @@ namespace nirfmxwlan_grpc { float64 l_sig_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowersCommon(instrument, selector_string, timeout, &l_stf_peak_power_maximum, &l_ltf_peak_power_maximum, &l_sig_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_l_stf_peak_power_maximum(l_stf_peak_power_maximum); response->set_l_ltf_peak_power_maximum(l_ltf_peak_power_maximum); @@ -5428,9 +5232,8 @@ namespace nirfmxwlan_grpc { int32 ru_size {}; auto status = library_->OFDMModAccFetchRUOffsetAndSize(instrument, selector_string, timeout, &ru_offset, &ru_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_ru_offset(ru_offset); response->set_ru_size(ru_size); @@ -5456,9 +5259,8 @@ namespace nirfmxwlan_grpc { int32 sig_b_crc_status {}; auto status = library_->OFDMModAccFetchSIGBCRCStatus(instrument, selector_string, timeout, &sig_b_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_sig_b_crc_status(static_cast(sig_b_crc_status)); response->set_sig_b_crc_status_raw(sig_b_crc_status); @@ -5484,9 +5286,8 @@ namespace nirfmxwlan_grpc { int32 sig_crc_status {}; auto status = library_->OFDMModAccFetchSIGCRCStatus(instrument, selector_string, timeout, &sig_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_sig_crc_status(static_cast(sig_crc_status)); response->set_sig_crc_status_raw(sig_crc_status); @@ -5513,9 +5314,8 @@ namespace nirfmxwlan_grpc { int32 spectral_flatness_margin_subcarrier_index {}; auto status = library_->OFDMModAccFetchSpectralFlatness(instrument, selector_string, timeout, &spectral_flatness_margin, &spectral_flatness_margin_subcarrier_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_spectral_flatness_margin(spectral_flatness_margin); response->set_spectral_flatness_margin_subcarrier_index(spectral_flatness_margin_subcarrier_index); @@ -5543,10 +5343,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSpectralFlatnessMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectral_flatness_mean()->Resize(actual_array_size, 0); float32* spectral_flatness_mean = response->mutable_spectral_flatness_mean()->mutable_data(); response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); @@ -5559,10 +5358,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5595,10 +5393,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_data_rms_evm_per_symbol_mean = response->mutable_stream_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5607,10 +5404,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5641,10 +5437,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_pilot_rms_evm_per_symbol_mean = response->mutable_stream_pilot_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5653,10 +5448,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5687,9 +5481,8 @@ namespace nirfmxwlan_grpc { float64 stream_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchStreamRMSEVM(instrument, selector_string, timeout, &stream_rms_evm_mean, &stream_data_rms_evm_mean, &stream_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_stream_rms_evm_mean(stream_rms_evm_mean); response->set_stream_data_rms_evm_mean(stream_data_rms_evm_mean); @@ -5718,10 +5511,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* stream_rms_evm_per_subcarrier_mean = response->mutable_stream_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5730,10 +5522,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5764,10 +5555,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchStreamRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_rms_evm_per_symbol_mean = response->mutable_stream_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -5776,10 +5566,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5811,10 +5600,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSubcarrierChainEVMPerSymbolTrace(instrument, selector_string, timeout, subcarrier_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_subcarrier_chain_evm_per_symbol()->Resize(actual_array_size, 0); float32* subcarrier_chain_evm_per_symbol = response->mutable_subcarrier_chain_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5823,10 +5611,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5858,10 +5645,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSubcarrierStreamEVMPerSymbolTrace(instrument, selector_string, timeout, subcarrier_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_subcarrier_stream_evm_per_symbol()->Resize(actual_array_size, 0); float32* subcarrier_stream_evm_per_symbol = response->mutable_subcarrier_stream_evm_per_symbol()->mutable_data(); auto array_size = actual_array_size; @@ -5870,10 +5656,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5905,10 +5690,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSymbolChainEVMPerSubcarrierTrace(instrument, selector_string, timeout, symbol_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_symbol_chain_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* symbol_chain_evm_per_subcarrier = response->mutable_symbol_chain_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5917,10 +5701,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -5949,9 +5732,8 @@ namespace nirfmxwlan_grpc { float64 symbol_clock_error_mean {}; auto status = library_->OFDMModAccFetchSymbolClockErrorMean(instrument, selector_string, timeout, &symbol_clock_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_symbol_clock_error_mean(symbol_clock_error_mean); return ::grpc::Status::OK; @@ -5979,10 +5761,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchSymbolStreamEVMPerSubcarrierTrace(instrument, selector_string, timeout, symbol_index, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_symbol_stream_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* symbol_stream_evm_per_subcarrier = response->mutable_symbol_stream_evm_per_subcarrier()->mutable_data(); auto array_size = actual_array_size; @@ -5991,10 +5772,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6024,9 +5804,8 @@ namespace nirfmxwlan_grpc { int32 unused_tone_error_margin_ru_index {}; auto status = library_->OFDMModAccFetchUnusedToneError(instrument, selector_string, timeout, &unused_tone_error_margin, &unused_tone_error_margin_ru_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_unused_tone_error_margin(unused_tone_error_margin); response->set_unused_tone_error_margin_ru_index(unused_tone_error_margin_ru_index); @@ -6052,10 +5831,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUnusedToneErrorMarginPerRU(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); float64* unused_tone_error_margin_per_ru = response->mutable_unused_tone_error_margin_per_ru()->mutable_data(); auto array_size = actual_array_size; @@ -6064,10 +5842,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); response->set_actual_array_size(actual_array_size); @@ -6096,10 +5873,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUnusedToneErrorMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_unused_tone_error()->Resize(actual_array_size, 0); float32* unused_tone_error = response->mutable_unused_tone_error()->mutable_data(); response->mutable_unused_tone_error_mask()->Resize(actual_array_size, 0); @@ -6110,10 +5886,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6143,10 +5918,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector user_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchUserDataConstellationTrace(instrument, selector_string, timeout, user_data_constellation.data(), array_size, &actual_array_size); @@ -6154,10 +5928,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(user_data_constellation, response->mutable_user_data_constellation()); { @@ -6191,10 +5964,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserPilotConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } std::vector user_pilot_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; status = library_->OFDMModAccFetchUserPilotConstellationTrace(instrument, selector_string, timeout, user_pilot_constellation.data(), array_size, &actual_array_size); @@ -6202,10 +5974,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); convert_to_grpc(user_pilot_constellation, response->mutable_user_pilot_constellation()); { @@ -6239,9 +6010,8 @@ namespace nirfmxwlan_grpc { float64 user_power_mean {}; auto status = library_->OFDMModAccFetchUserPower(instrument, selector_string, timeout, &user_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_user_power_mean(user_power_mean); return ::grpc::Status::OK; @@ -6268,10 +6038,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_user_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_data_rms_evm_per_symbol_mean = response->mutable_user_stream_data_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -6280,10 +6049,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6314,10 +6082,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_pilot_rms_evm_per_symbol_mean = response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -6326,10 +6093,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6360,9 +6126,8 @@ namespace nirfmxwlan_grpc { float64 user_stream_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchUserStreamRMSEVM(instrument, selector_string, timeout, &user_stream_rms_evm_mean, &user_stream_data_rms_evm_mean, &user_stream_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_user_stream_rms_evm_mean(user_stream_rms_evm_mean); response->set_user_stream_data_rms_evm_mean(user_stream_data_rms_evm_mean); @@ -6391,10 +6156,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_user_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* user_stream_rms_evm_per_subcarrier_mean = response->mutable_user_stream_rms_evm_per_subcarrier_mean()->mutable_data(); auto array_size = actual_array_size; @@ -6403,10 +6167,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6437,10 +6200,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->OFDMModAccFetchUserStreamRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_user_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_rms_evm_per_symbol_mean = response->mutable_user_stream_rms_evm_per_symbol_mean()->mutable_data(); auto array_size = actual_array_size; @@ -6449,10 +6211,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6480,9 +6241,8 @@ namespace nirfmxwlan_grpc { int32 calibration_data_valid {}; auto status = library_->OFDMModAccValidateCalibrationData(instrument, selector_string, &calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_calibration_data_valid(static_cast(calibration_data_valid)); response->set_calibration_data_valid_raw(calibration_data_valid); @@ -6507,9 +6267,8 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->PowerRampCfgAcquisitionLength(instrument, selector_string, acquisition_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6548,9 +6307,8 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->PowerRampCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6576,10 +6334,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PowerRampFetchFallTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_raw_waveform()->Resize(actual_array_size, 0); float32* raw_waveform = response->mutable_raw_waveform()->mutable_data(); response->mutable_processed_waveform()->Resize(actual_array_size, 0); @@ -6594,10 +6351,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6630,9 +6386,8 @@ namespace nirfmxwlan_grpc { float64 fall_time_mean {}; auto status = library_->PowerRampFetchMeasurement(instrument, selector_string, timeout, &rise_time_mean, &fall_time_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_rise_time_mean(rise_time_mean); response->set_fall_time_mean(fall_time_mean); @@ -6660,10 +6415,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->PowerRampFetchRiseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_raw_waveform()->Resize(actual_array_size, 0); float32* raw_waveform = response->mutable_raw_waveform()->mutable_data(); response->mutable_processed_waveform()->Resize(actual_array_size, 0); @@ -6678,10 +6432,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -6712,9 +6465,8 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6736,9 +6488,8 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6793,9 +6544,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6833,9 +6583,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgMaskType(instrument, selector_string, mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6858,9 +6607,8 @@ namespace nirfmxwlan_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6912,9 +6660,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6955,9 +6702,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -6996,9 +6742,8 @@ namespace nirfmxwlan_grpc { float64 span = request->span(); auto status = library_->SEMCfgSpan(instrument, selector_string, span_auto, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7037,9 +6782,8 @@ namespace nirfmxwlan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7064,9 +6808,8 @@ namespace nirfmxwlan_grpc { float64 relative_power {}; auto status = library_->SEMFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_absolute_power(absolute_power); response->set_relative_power(relative_power); @@ -7096,9 +6839,8 @@ namespace nirfmxwlan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -7128,10 +6870,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -7148,10 +6889,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -7195,9 +6935,8 @@ namespace nirfmxwlan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); @@ -7226,10 +6965,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7246,10 +6984,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7280,9 +7017,8 @@ namespace nirfmxwlan_grpc { int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -7310,10 +7046,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); response->mutable_composite_mask()->Resize(actual_array_size, 0); @@ -7324,10 +7059,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -7361,9 +7095,8 @@ namespace nirfmxwlan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_measurement_status(static_cast(measurement_status)); response->set_measurement_status_raw(measurement_status); @@ -7393,10 +7126,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); response->mutable_margin()->Resize(actual_array_size, 0); @@ -7413,10 +7145,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_measurement_status()->Clear(); response->mutable_measurement_status()->Reserve(actual_array_size); @@ -7460,9 +7191,8 @@ namespace nirfmxwlan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_total_absolute_power(total_absolute_power); response->set_total_relative_power(total_relative_power); @@ -7491,10 +7221,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7511,10 +7240,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->mutable_total_absolute_power()->Resize(actual_array_size, 0); response->mutable_total_relative_power()->Resize(actual_array_size, 0); @@ -7560,9 +7288,8 @@ namespace nirfmxwlan_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7583,9 +7310,8 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7609,9 +7335,8 @@ namespace nirfmxwlan_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7636,9 +7361,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7662,9 +7386,8 @@ namespace nirfmxwlan_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7689,9 +7412,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7724,9 +7446,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7768,9 +7489,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7803,9 +7523,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7829,9 +7548,8 @@ namespace nirfmxwlan_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7856,9 +7574,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7891,9 +7608,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7938,9 +7654,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7968,9 +7683,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -7995,9 +7709,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8040,9 +7753,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8075,9 +7787,8 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8104,9 +7815,8 @@ namespace nirfmxwlan_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8131,9 +7841,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8158,9 +7867,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8184,9 +7892,8 @@ namespace nirfmxwlan_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8211,9 +7918,8 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8252,9 +7958,8 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8292,9 +7997,8 @@ namespace nirfmxwlan_grpc { auto status = library_->TXPCfgBurstDetectionEnabled(instrument, selector_string, burst_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8317,9 +8021,8 @@ namespace nirfmxwlan_grpc { float64 maximum_measurement_interval = request->maximum_measurement_interval(); auto status = library_->TXPCfgMaximumMeasurementInterval(instrument, selector_string, maximum_measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8344,9 +8047,8 @@ namespace nirfmxwlan_grpc { float64 peak_power_maximum {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_power_mean, &peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); response->set_average_power_mean(average_power_mean); response->set_peak_power_maximum(peak_power_maximum); @@ -8374,10 +8076,9 @@ namespace nirfmxwlan_grpc { int32 actual_array_size {}; while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); auto array_size = actual_array_size; @@ -8386,10 +8087,9 @@ namespace nirfmxwlan_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + } response->set_status(status); response->set_x0(x0); response->set_dx(dx); @@ -8416,9 +8116,8 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } @@ -8441,9 +8140,8 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nirfsa/nirfsa_service.cpp b/generated/nirfsa/nirfsa_service.cpp index abb1553fd..9605c230a 100644 --- a/generated/nirfsa/nirfsa_service.cpp +++ b/generated/nirfsa/nirfsa_service.cpp @@ -58,9 +58,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -82,9 +81,8 @@ namespace nirfsa_grpc { ViBoolean is_done {}; auto status = library_->CheckAcquisitionStatus(vi, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -106,9 +104,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -129,9 +126,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearSelfCalibrateRange(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -153,9 +149,8 @@ namespace nirfsa_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -176,9 +171,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -215,9 +209,8 @@ namespace nirfsa_grpc { auto status = library_->ConfigureAcquisitionType(vi, acquisition_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -256,9 +249,8 @@ namespace nirfsa_grpc { auto status = library_->ConfigureDeembeddingTableInterpolationLinear(vi, port, table_name, format); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -281,9 +273,8 @@ namespace nirfsa_grpc { auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationNearest(vi, port, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -306,9 +297,8 @@ namespace nirfsa_grpc { auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationSpline(vi, port, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -365,9 +355,8 @@ namespace nirfsa_grpc { auto status = library_->ConfigureDigitalEdgeAdvanceTrigger(vi, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -425,9 +414,8 @@ namespace nirfsa_grpc { ViInt64 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureDigitalEdgeRefTrigger(vi, source, edge, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -484,9 +472,8 @@ namespace nirfsa_grpc { auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -509,9 +496,8 @@ namespace nirfsa_grpc { ViReal64 carrier_frequency = request->carrier_frequency(); auto status = library_->ConfigureIQCarrierFrequency(vi, channel_list, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -551,9 +537,8 @@ namespace nirfsa_grpc { ViInt64 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureIQPowerEdgeRefTrigger(vi, source, level, slope, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -576,9 +561,8 @@ namespace nirfsa_grpc { ViReal64 iq_rate = request->iq_rate(); auto status = library_->ConfigureIQRate(vi, channel_list, iq_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -602,9 +586,8 @@ namespace nirfsa_grpc { ViInt64 number_of_records = request->number_of_records(); auto status = library_->ConfigureNumberOfRecords(vi, channel_list, number_of_records_is_finite, number_of_records); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -628,9 +611,8 @@ namespace nirfsa_grpc { ViInt64 samples_per_record = request->samples_per_record(); auto status = library_->ConfigureNumberOfSamples(vi, channel_list, number_of_samples_is_finite, samples_per_record); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -671,9 +653,8 @@ namespace nirfsa_grpc { auto status = library_->ConfigurePXIChassisClk10(vi, pxi_clk10_source); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -715,9 +696,8 @@ namespace nirfsa_grpc { ViReal64 ref_clock_rate = request->ref_clock_rate(); auto status = library_->ConfigureRefClock(vi, clock_source, ref_clock_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -740,9 +720,8 @@ namespace nirfsa_grpc { ViReal64 reference_level = request->reference_level(); auto status = library_->ConfigureReferenceLevel(vi, channel_list, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -765,9 +744,8 @@ namespace nirfsa_grpc { ViReal64 resolution_bandwidth = request->resolution_bandwidth(); auto status = library_->ConfigureResolutionBandwidth(vi, channel_list, resolution_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -788,9 +766,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeAdvanceTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -812,9 +789,8 @@ namespace nirfsa_grpc { ViInt64 pretrigger_samples = request->pretrigger_samples(); auto status = library_->ConfigureSoftwareEdgeRefTrigger(vi, pretrigger_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -835,9 +811,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareEdgeStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -861,9 +836,8 @@ namespace nirfsa_grpc { ViReal64 span = request->span(); auto status = library_->ConfigureSpectrumFrequencyCenterSpan(vi, channel_list, center_frequency, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -887,9 +861,8 @@ namespace nirfsa_grpc { ViReal64 stop_frequency = request->stop_frequency(); auto status = library_->ConfigureSpectrumFrequencyStartStop(vi, channel_list, start_frequency, stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -914,9 +887,8 @@ namespace nirfsa_grpc { ViBoolean set_as_active_list = request->set_as_active_list(); auto status = library_->CreateConfigurationList(vi, list_name, number_of_list_attributes, list_attribute_ids, set_as_active_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -938,9 +910,8 @@ namespace nirfsa_grpc { ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateConfigurationListStep(vi, set_as_active_step); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -984,9 +955,8 @@ namespace nirfsa_grpc { auto status = library_->CreateDeembeddingSparameterTableArray(vi, port, table_name, frequencies, frequencies_size, sparameter_table.data(), sparameter_table_size, number_of_ports, sparameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1026,9 +996,8 @@ namespace nirfsa_grpc { auto status = library_->CreateDeembeddingSparameterTableS2PFile(vi, port, table_name, s2p_file_path, sparameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1049,9 +1018,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DeleteAllDeembeddingTables(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1073,9 +1041,8 @@ namespace nirfsa_grpc { auto list_name = request->list_name().c_str(); auto status = library_->DeleteConfigurationList(vi, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1098,9 +1065,8 @@ namespace nirfsa_grpc { auto table_name = request->table_name().c_str(); auto status = library_->DeleteDeembeddingTable(vi, port, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1121,9 +1087,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1144,9 +1109,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableAdvanceTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1167,9 +1131,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableRefTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1190,9 +1153,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1214,9 +1176,8 @@ namespace nirfsa_grpc { ViBoolean enable = request->enable(); auto status = library_->EnableSessionAccess(vi, enable); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1239,9 +1200,8 @@ namespace nirfsa_grpc { std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorMessage(vi, status_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -1266,9 +1226,8 @@ namespace nirfsa_grpc { std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_code(error_code); response->set_error_message(error_message); @@ -1329,9 +1288,8 @@ namespace nirfsa_grpc { auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1359,9 +1317,8 @@ namespace nirfsa_grpc { std::vector wfm_info(number_of_records, niRFSA_wfmInfo_struct()); auto status = library_->FetchIQMultiRecordComplexF32(vi, channel_list, starting_record, number_of_records, number_of_samples, timeout, data.data(), wfm_info.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -1391,9 +1348,8 @@ namespace nirfsa_grpc { std::vector wfm_info(number_of_records, niRFSA_wfmInfo_struct()); auto status = library_->FetchIQMultiRecordComplexF64(vi, channel_list, starting_record, number_of_records, number_of_samples, timeout, data.data(), wfm_info.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -1423,9 +1379,8 @@ namespace nirfsa_grpc { std::vector wfm_info(number_of_records, niRFSA_wfmInfo_struct()); auto status = library_->FetchIQMultiRecordComplexI16(vi, channel_list, starting_record, number_of_records, number_of_samples, timeout, data.data(), wfm_info.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -1454,9 +1409,8 @@ namespace nirfsa_grpc { niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->FetchIQSingleRecordComplexF32(vi, channel_list, record_number, number_of_samples, timeout, data.data(), &wfm_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -1485,9 +1439,8 @@ namespace nirfsa_grpc { niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->FetchIQSingleRecordComplexF64(vi, channel_list, record_number, number_of_samples, timeout, data.data(), &wfm_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -1516,9 +1469,8 @@ namespace nirfsa_grpc { niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->FetchIQSingleRecordComplexI16(vi, channel_list, record_number, number_of_samples, timeout, data.data(), &wfm_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -1544,9 +1496,8 @@ namespace nirfsa_grpc { ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1571,9 +1522,8 @@ namespace nirfsa_grpc { ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1598,9 +1548,8 @@ namespace nirfsa_grpc { ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1625,9 +1574,8 @@ namespace nirfsa_grpc { ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1652,9 +1600,8 @@ namespace nirfsa_grpc { ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); @@ -1680,10 +1627,9 @@ namespace nirfsa_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buf_size = status; std::string value; @@ -1695,10 +1641,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -1723,9 +1668,8 @@ namespace nirfsa_grpc { std::string info(2048 - 1, '\0'); auto status = library_->GetCalUserDefinedInfo(vi, (ViChar*)info.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_info(info); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); @@ -1749,9 +1693,8 @@ namespace nirfsa_grpc { ViInt32 info_size {}; auto status = library_->GetCalUserDefinedInfoMaxSize(vi, &info_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_info_size(info_size); return ::grpc::Status::OK; @@ -1775,10 +1718,9 @@ namespace nirfsa_grpc { ViInt32 number_of_ports {}; while (true) { auto status = library_->GetDeembeddingSparameters(vi, nullptr, 0, &number_of_sparameters, &number_of_ports); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::vector sparameters(number_of_sparameters, NIComplexNumber_struct()); auto sparameters_array_size = number_of_sparameters; status = library_->GetDeembeddingSparameters(vi, sparameters.data(), sparameters_array_size, &number_of_sparameters, &number_of_ports); @@ -1786,10 +1728,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); convert_to_grpc(sparameters, response->mutable_sparameters()); { @@ -1839,10 +1780,9 @@ namespace nirfsa_grpc { ViInt32 number_of_frequencies {}; while (true) { auto status = library_->GetDeviceResponse(vi, channel_list, response_type, 0, nullptr, nullptr, nullptr, &number_of_frequencies); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_frequencies()->Resize(number_of_frequencies, 0); ViReal64* frequencies = response->mutable_frequencies()->mutable_data(); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); @@ -1855,10 +1795,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_frequencies()->Resize(number_of_frequencies, 0); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); @@ -1885,10 +1824,9 @@ namespace nirfsa_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -1901,10 +1839,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -1934,9 +1871,8 @@ namespace nirfsa_grpc { ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -1963,9 +1899,8 @@ namespace nirfsa_grpc { ViReal64 temperature {}; auto status = library_->GetExtCalLastTemp(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -1988,9 +1923,8 @@ namespace nirfsa_grpc { ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_months(months); return ::grpc::Status::OK; @@ -2015,9 +1949,8 @@ namespace nirfsa_grpc { ViInt64 backlog {}; auto status = library_->GetFetchBacklog(vi, channel_list, record_number, &backlog); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_backlog(backlog); return ::grpc::Status::OK; @@ -2041,10 +1974,9 @@ namespace nirfsa_grpc { ViInt32 number_of_frequencies {}; while (true) { auto status = library_->GetFrequencyResponse(vi, channel_list, 0, nullptr, nullptr, nullptr, &number_of_frequencies); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_frequencies()->Resize(number_of_frequencies, 0); ViReal64* frequencies = response->mutable_frequencies()->mutable_data(); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); @@ -2057,10 +1989,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_frequencies()->Resize(number_of_frequencies, 0); response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); @@ -2088,10 +2019,9 @@ namespace nirfsa_grpc { ViInt32 number_of_coefficient_sets {}; while (true) { auto status = library_->GetNormalizationCoefficients(vi, channel_list, 0, nullptr, &number_of_coefficient_sets); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::vector coefficient_info(number_of_coefficient_sets, niRFSA_coefficientInfo_struct()); auto array_size = number_of_coefficient_sets; status = library_->GetNormalizationCoefficients(vi, channel_list, array_size, coefficient_info.data(), &number_of_coefficient_sets); @@ -2099,10 +2029,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); { @@ -2135,9 +2064,8 @@ namespace nirfsa_grpc { ViInt32 number_of_spectral_lines {}; auto status = library_->GetNumberOfSpectralLines(vi, channel_list, &number_of_spectral_lines); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_number_of_spectral_lines(number_of_spectral_lines); return ::grpc::Status::OK; @@ -2162,10 +2090,9 @@ namespace nirfsa_grpc { ViInt32 buffer_size {}; while (true) { auto status = library_->GetRelayName(vi, channel_list, index, nullptr, &buffer_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::string name; if (buffer_size > 0) { name.resize(buffer_size /* Workaround: strlen-bug */); @@ -2175,10 +2102,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -2205,10 +2131,9 @@ namespace nirfsa_grpc { ViInt32 buffer_size {}; while (true) { auto status = library_->GetRelayOperationsCount(vi, channel_list, nullptr, &buffer_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_operations_count()->Resize(buffer_size, 0); ViInt32* operations_count = reinterpret_cast(response->mutable_operations_count()->mutable_data()); status = library_->GetRelayOperationsCount(vi, channel_list, operations_count, &buffer_size); @@ -2216,10 +2141,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_operations_count()->Resize(buffer_size, 0); response->set_buffer_size(buffer_size); @@ -2245,10 +2169,9 @@ namespace nirfsa_grpc { ViInt32 number_of_coefficient_sets {}; while (true) { auto status = library_->GetScalingCoefficients(vi, channel_list, 0, nullptr, &number_of_coefficient_sets); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::vector coefficient_info(number_of_coefficient_sets, niRFSA_coefficientInfo_struct()); auto array_size = number_of_coefficient_sets; status = library_->GetScalingCoefficients(vi, channel_list, array_size, coefficient_info.data(), &number_of_coefficient_sets); @@ -2256,10 +2179,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); { @@ -2296,9 +2218,8 @@ namespace nirfsa_grpc { ViInt32 minute {}; auto status = library_->GetSelfCalLastDateAndTime(vi, self_calibration_step, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -2326,9 +2247,8 @@ namespace nirfsa_grpc { ViReal64 temp {}; auto status = library_->GetSelfCalLastTemp(vi, self_calibration_step, &temp); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temp(temp); return ::grpc::Status::OK; @@ -2351,9 +2271,8 @@ namespace nirfsa_grpc { SmtSpectrumInfo_struct spectrum_info {}; auto status = library_->GetSpectralInfoForSMT(vi, &spectrum_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); return ::grpc::Status::OK; @@ -2377,9 +2296,8 @@ namespace nirfsa_grpc { ViUInt32 writer_handle {}; auto status = library_->GetStreamEndpointHandle(vi, stream_endpoint, &writer_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_writer_handle(writer_handle); return ::grpc::Status::OK; @@ -2423,9 +2341,8 @@ namespace nirfsa_grpc { } auto status = library_->GetTerminalName(vi, signal, signal_identifier, buffer_size, (ViChar*)terminal_name.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_terminal_name(terminal_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); @@ -2450,10 +2367,9 @@ namespace nirfsa_grpc { ViInt32 actual_data_size {}; while (true) { auto status = library_->GetUserData(vi, identifier, 0, nullptr, &actual_data_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::string data(actual_data_size, '\0'); auto buffer_size = actual_data_size; status = library_->GetUserData(vi, identifier, buffer_size, (ViInt8*)data.data(), &actual_data_size); @@ -2461,10 +2377,9 @@ namespace nirfsa_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_data(data); response->mutable_data()->resize(actual_data_size); @@ -2499,9 +2414,8 @@ namespace nirfsa_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2537,9 +2451,8 @@ namespace nirfsa_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2564,9 +2477,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2587,9 +2499,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2612,9 +2523,8 @@ namespace nirfsa_grpc { ViInt64 valid_steps {}; auto status = library_->IsSelfCalValid(vi, &self_cal_valid, &valid_steps); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_cal_valid(self_cal_valid); if (valid_steps & 0x1) @@ -2657,9 +2567,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PerformThermalCorrection(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2685,9 +2594,8 @@ namespace nirfsa_grpc { niRFSA_wfmInfo_struct wfm_info {}; auto status = library_->ReadIQSingleRecordComplexF64(vi, channel_list, timeout, data.data(), data_array_size, &wfm_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(data, response->mutable_data()); convert_to_grpc(wfm_info, response->mutable_wfm_info()); @@ -2716,9 +2624,8 @@ namespace nirfsa_grpc { niRFSA_spectrumInfo_struct spectrum_info {}; auto status = library_->ReadPowerSpectrumF32(vi, channel_list, timeout, power_spectrum_data, data_array_size, &spectrum_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); return ::grpc::Status::OK; @@ -2746,9 +2653,8 @@ namespace nirfsa_grpc { niRFSA_spectrumInfo_struct spectrum_info {}; auto status = library_->ReadPowerSpectrumF64(vi, channel_list, timeout, power_spectrum_data, data_array_size, &spectrum_info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); return ::grpc::Status::OK; @@ -2770,9 +2676,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2795,9 +2700,8 @@ namespace nirfsa_grpc { ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2818,9 +2722,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2841,9 +2744,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2880,9 +2782,8 @@ namespace nirfsa_grpc { auto status = library_->ResetWithOptions(vi, steps_to_omit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2905,9 +2806,8 @@ namespace nirfsa_grpc { std::string instr_rev(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)driver_rev.data(), (ViChar*)instr_rev.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_driver_rev(driver_rev); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_rev())); @@ -2932,9 +2832,8 @@ namespace nirfsa_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2971,9 +2870,8 @@ namespace nirfsa_grpc { auto status = library_->SelfCalibrate(vi, steps_to_omit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3014,9 +2912,8 @@ namespace nirfsa_grpc { ViReal64 max_reference_level = request->max_reference_level(); auto status = library_->SelfCalibrateRange(vi, steps_to_omit, min_frequency, max_frequency, min_reference_level, max_reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3039,9 +2936,8 @@ namespace nirfsa_grpc { std::string test_message(2048 - 1, '\0'); auto status = library_->SelfTest(vi, &test_result, (ViChar*)test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_test_result(test_result); response->set_test_message(test_message); @@ -3082,9 +2978,8 @@ namespace nirfsa_grpc { auto trigger_identifier = request->trigger_identifier().c_str(); auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_identifier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3108,9 +3003,8 @@ namespace nirfsa_grpc { ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3149,9 +3043,8 @@ namespace nirfsa_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3175,9 +3068,8 @@ namespace nirfsa_grpc { ViInt64 value = request->value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3201,9 +3093,8 @@ namespace nirfsa_grpc { ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3228,9 +3119,8 @@ namespace nirfsa_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3273,9 +3163,8 @@ namespace nirfsa_grpc { auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3297,9 +3186,8 @@ namespace nirfsa_grpc { auto info = request->info().c_str(); auto status = library_->SetCalUserDefinedInfo(vi, info); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3323,9 +3211,8 @@ namespace nirfsa_grpc { std::string data(buffer_size, '\0'); auto status = library_->SetUserData(vi, identifier, buffer_size, (ViInt8*)data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_data(data); return ::grpc::Status::OK; diff --git a/generated/nirfsg/nirfsg_service.cpp b/generated/nirfsg/nirfsg_service.cpp index 067e9bab8..755f2449d 100644 --- a/generated/nirfsg/nirfsg_service.cpp +++ b/generated/nirfsg/nirfsg_service.cpp @@ -57,9 +57,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -82,9 +81,8 @@ namespace nirfsg_grpc { ViInt32 size_in_samples = request->size_in_samples(); auto status = library_->AllocateArbWaveform(vi, waveform_name, size_in_samples); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -108,9 +106,8 @@ namespace nirfsg_grpc { ViBoolean value = request->value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -149,9 +146,8 @@ namespace nirfsg_grpc { auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -175,9 +171,8 @@ namespace nirfsg_grpc { ViInt64 value = request->value_raw(); auto status = library_->CheckAttributeViInt64(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -216,9 +211,8 @@ namespace nirfsg_grpc { auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -243,9 +237,8 @@ namespace nirfsg_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -288,9 +281,8 @@ namespace nirfsg_grpc { auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -312,9 +304,8 @@ namespace nirfsg_grpc { ViBoolean is_done {}; auto status = library_->CheckGenerationStatus(vi, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_is_done(is_done); return ::grpc::Status::OK; @@ -338,9 +329,8 @@ namespace nirfsg_grpc { ViBoolean list_exists {}; auto status = library_->CheckIfConfigurationListExists(vi, list_name, &list_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_list_exists(list_exists); return ::grpc::Status::OK; @@ -364,9 +354,8 @@ namespace nirfsg_grpc { ViBoolean script_exists {}; auto status = library_->CheckIfScriptExists(vi, script_name, &script_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_script_exists(script_exists); return ::grpc::Status::OK; @@ -390,9 +379,8 @@ namespace nirfsg_grpc { ViBoolean waveform_exists {}; auto status = library_->CheckIfWaveformExists(vi, waveform_name, &waveform_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_waveform_exists(waveform_exists); return ::grpc::Status::OK; @@ -414,9 +402,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearAllArbWaveforms(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -438,9 +425,8 @@ namespace nirfsg_grpc { auto name = request->name().c_str(); auto status = library_->ClearArbWaveform(vi, name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -461,9 +447,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -484,9 +469,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearSelfCalibrateRange(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -508,9 +492,8 @@ namespace nirfsg_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -531,9 +514,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -572,9 +554,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureDeembeddingTableInterpolationLinear(vi, port, table_name, format); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -597,9 +578,8 @@ namespace nirfsg_grpc { auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationNearest(vi, port, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -622,9 +602,8 @@ namespace nirfsg_grpc { auto table_name = request->table_name().c_str(); auto status = library_->ConfigureDeembeddingTableInterpolationSpline(vi, port, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -681,9 +660,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureDigitalEdgeConfigurationListStepTrigger(vi, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -760,9 +738,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureDigitalEdgeScriptTrigger(vi, trigger_id, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -819,9 +796,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureDigitalEdgeStartTrigger(vi, source, edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -898,9 +874,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureDigitalLevelScriptTrigger(vi, trigger_id, source, level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -923,9 +898,8 @@ namespace nirfsg_grpc { ViInt8* user_defined_waveform = (ViInt8*)request->user_defined_waveform().c_str(); auto status = library_->ConfigureDigitalModulationUserDefinedWaveform(vi, number_of_samples, user_defined_waveform); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -962,9 +936,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureGenerationMode(vi, generation_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -986,9 +959,8 @@ namespace nirfsg_grpc { ViBoolean output_enabled = request->output_enabled(); auto status = library_->ConfigureOutputEnabled(vi, output_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1010,9 +982,8 @@ namespace nirfsg_grpc { ViInt64 p2p_endpoint_fullness_level = request->p2p_endpoint_fullness_level(); auto status = library_->ConfigureP2PEndpointFullnessStartTrigger(vi, p2p_endpoint_fullness_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1053,9 +1024,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigurePXIChassisClk10(vi, pxi_clk10_source); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1092,9 +1062,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigurePowerLevelType(vi, power_level_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1117,9 +1086,8 @@ namespace nirfsg_grpc { ViReal64 power_level = request->power_level(); auto status = library_->ConfigureRF(vi, frequency, power_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1161,9 +1129,8 @@ namespace nirfsg_grpc { ViReal64 ref_clock_rate = request->ref_clock_rate(); auto status = library_->ConfigureRefClock(vi, ref_clock_source, ref_clock_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1185,9 +1152,8 @@ namespace nirfsg_grpc { ViReal64 signal_bandwidth = request->signal_bandwidth(); auto status = library_->ConfigureSignalBandwidth(vi, signal_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1228,9 +1194,8 @@ namespace nirfsg_grpc { auto status = library_->ConfigureSoftwareScriptTrigger(vi, trigger_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1251,9 +1216,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureSoftwareStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1277,9 +1241,8 @@ namespace nirfsg_grpc { auto reserved_for_future_use = 0; auto status = library_->ConfigureUpconverterPLLSettlingTime(vi, pll_settling_time, ensure_pll_locked, reserved_for_future_use); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1304,9 +1267,8 @@ namespace nirfsg_grpc { ViBoolean set_as_active_list = request->set_as_active_list(); auto status = library_->CreateConfigurationList(vi, list_name, number_of_attributes, configuration_list_attributes, set_as_active_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1328,9 +1290,8 @@ namespace nirfsg_grpc { ViBoolean set_as_active_step = request->set_as_active_step(); auto status = library_->CreateConfigurationListStep(vi, set_as_active_step); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1374,9 +1335,8 @@ namespace nirfsg_grpc { auto status = library_->CreateDeembeddingSparameterTableArray(vi, port, table_name, frequencies, frequencies_size, sparameter_table.data(), sparameter_table_size, number_of_ports, sparameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1416,9 +1376,8 @@ namespace nirfsg_grpc { auto status = library_->CreateDeembeddingSparameterTableS2PFile(vi, port, table_name, s2p_file_path, sparameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1439,9 +1398,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DeleteAllDeembeddingTables(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1463,9 +1421,8 @@ namespace nirfsg_grpc { auto list_name = request->list_name().c_str(); auto status = library_->DeleteConfigurationList(vi, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1488,9 +1445,8 @@ namespace nirfsg_grpc { auto table_name = request->table_name().c_str(); auto status = library_->DeleteDeembeddingTable(vi, port, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1512,9 +1468,8 @@ namespace nirfsg_grpc { auto script_name = request->script_name().c_str(); auto status = library_->DeleteScript(vi, script_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1535,9 +1490,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1558,9 +1512,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableAllModulation(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1581,9 +1534,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableConfigurationListStepTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1624,9 +1576,8 @@ namespace nirfsg_grpc { auto status = library_->DisableScriptTrigger(vi, trigger_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1647,9 +1598,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableStartTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1672,9 +1622,8 @@ namespace nirfsg_grpc { std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -1699,9 +1648,8 @@ namespace nirfsg_grpc { std::string error_message(1024 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_code(error_code); response->set_error_message(error_message); @@ -1781,9 +1729,8 @@ namespace nirfsg_grpc { auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1807,9 +1754,8 @@ namespace nirfsg_grpc { ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1834,9 +1780,8 @@ namespace nirfsg_grpc { ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1861,9 +1806,8 @@ namespace nirfsg_grpc { ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1888,9 +1832,8 @@ namespace nirfsg_grpc { ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1915,9 +1858,8 @@ namespace nirfsg_grpc { ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); @@ -1943,10 +1885,9 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buf_size = status; std::string value; @@ -1958,10 +1899,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -1987,10 +1927,9 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string name; @@ -2002,10 +1941,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -2031,10 +1969,9 @@ namespace nirfsg_grpc { ViInt32 number_of_ports {}; while (true) { auto status = library_->GetDeembeddingSparameters(vi, nullptr, 0, &number_of_sparameters, &number_of_ports); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::vector sparameters(number_of_sparameters, NIComplexNumber_struct()); auto sparameters_array_size = number_of_sparameters; status = library_->GetDeembeddingSparameters(vi, sparameters.data(), sparameters_array_size, &number_of_sparameters, &number_of_ports); @@ -2042,10 +1979,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); convert_to_grpc(sparameters, response->mutable_sparameters()); { @@ -2078,10 +2014,9 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 error_description_buffer_size = status; ViStatus error_code {}; @@ -2094,10 +2029,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_code(error_code); response->set_error_description(error_description); @@ -2128,9 +2062,8 @@ namespace nirfsg_grpc { ViInt32 second {}; auto status = library_->GetExternalCalibrationLastDateAndTime(vi, &year, &month, &day, &hour, &minute, &second); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -2179,9 +2112,8 @@ namespace nirfsg_grpc { ViInt32 second {}; auto status = library_->GetSelfCalibrationDateAndTime(vi, module, &year, &month, &day, &hour, &minute, &second); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -2225,9 +2157,8 @@ namespace nirfsg_grpc { ViReal64 temperature {}; auto status = library_->GetSelfCalibrationTemperature(vi, module, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -2286,10 +2217,9 @@ namespace nirfsg_grpc { while (true) { auto status = library_->GetTerminalName(vi, signal, signal_identifier, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string terminal_name; @@ -2301,10 +2231,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_terminal_name(terminal_name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); @@ -2330,10 +2259,9 @@ namespace nirfsg_grpc { ViInt32 actual_data_size {}; while (true) { auto status = library_->GetUserData(vi, identifier, 0, nullptr, &actual_data_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } std::string data(actual_data_size, '\0'); auto buffer_size = actual_data_size; status = library_->GetUserData(vi, identifier, buffer_size, (ViInt8*)data.data(), &actual_data_size); @@ -2341,10 +2269,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_data(data); response->mutable_data()->resize(actual_data_size); @@ -2371,10 +2298,9 @@ namespace nirfsg_grpc { ViInt32 required_size {}; while (true) { auto status = library_->GetWaveformBurstStartLocations(vi, channel_name, 0, nullptr, &required_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_locations()->Resize(required_size, 0); ViReal64* locations = response->mutable_locations()->mutable_data(); auto number_of_locations = required_size; @@ -2383,10 +2309,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_locations()->Resize(required_size, 0); response->set_required_size(required_size); @@ -2412,10 +2337,9 @@ namespace nirfsg_grpc { ViInt32 required_size {}; while (true) { auto status = library_->GetWaveformBurstStopLocations(vi, channel_name, 0, nullptr, &required_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_locations()->Resize(required_size, 0); ViReal64* locations = response->mutable_locations()->mutable_data(); auto number_of_locations = required_size; @@ -2424,10 +2348,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_locations()->Resize(required_size, 0); response->set_required_size(required_size); @@ -2453,10 +2376,9 @@ namespace nirfsg_grpc { ViInt32 required_size {}; while (true) { auto status = library_->GetWaveformMarkerEventLocations(vi, channel_name, 0, nullptr, &required_size); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } response->mutable_locations()->Resize(required_size, 0); ViReal64* locations = response->mutable_locations()->mutable_data(); auto number_of_locations = required_size; @@ -2465,10 +2387,9 @@ namespace nirfsg_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->mutable_locations()->Resize(required_size, 0); response->set_required_size(required_size); @@ -2502,9 +2423,8 @@ namespace nirfsg_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_new_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2540,9 +2460,8 @@ namespace nirfsg_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2567,9 +2486,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Initiate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2590,9 +2508,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2615,9 +2532,8 @@ namespace nirfsg_grpc { auto file_path = request->file_path().c_str(); auto status = library_->LoadConfigurationsFromFile(vi, channel_name, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2638,9 +2554,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PerformPowerSearch(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2661,9 +2576,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PerformThermalCorrection(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2688,9 +2602,8 @@ namespace nirfsg_grpc { ViInt32 max_waveform_size {}; auto status = library_->QueryArbWaveformCapabilities(vi, &max_number_waveforms, &waveform_quantum, &min_waveform_size, &max_waveform_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_max_number_waveforms(max_number_waveforms); response->set_waveform_quantum(waveform_quantum); @@ -2718,9 +2631,8 @@ namespace nirfsg_grpc { ViUInt32 waveform_index = request->waveform_index(); auto status = library_->ReadAndDownloadWaveformFromFileTDMS(vi, waveform_name, file_path, waveform_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2741,9 +2653,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2766,9 +2677,8 @@ namespace nirfsg_grpc { ViAttr attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(vi, channel_name, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2789,9 +2699,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2812,9 +2721,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2851,9 +2759,8 @@ namespace nirfsg_grpc { auto status = library_->ResetWithOptions(vi, steps_to_omit); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2876,9 +2783,8 @@ namespace nirfsg_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); @@ -2905,9 +2811,8 @@ namespace nirfsg_grpc { auto file_path = request->file_path().c_str(); auto status = library_->SaveConfigurationsToFile(vi, channel_name, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2929,9 +2834,8 @@ namespace nirfsg_grpc { auto name = request->name().c_str(); auto status = library_->SelectArbWaveform(vi, name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2952,9 +2856,8 @@ namespace nirfsg_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SelfCal(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2995,9 +2898,8 @@ namespace nirfsg_grpc { ViReal64 max_power_level = request->max_power_level(); auto status = library_->SelfCalibrateRange(vi, steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3020,9 +2922,8 @@ namespace nirfsg_grpc { std::string self_test_message(2048 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -3082,9 +2983,8 @@ namespace nirfsg_grpc { auto status = library_->SendSoftwareEdgeTrigger(vi, trigger, trigger_identifier); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3123,9 +3023,8 @@ namespace nirfsg_grpc { ViInt32 offset = request->offset(); auto status = library_->SetArbWaveformNextWritePosition(vi, waveform_name, relative_to, offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3149,9 +3048,8 @@ namespace nirfsg_grpc { ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3190,9 +3088,8 @@ namespace nirfsg_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3216,9 +3113,8 @@ namespace nirfsg_grpc { ViInt64 value = request->value_raw(); auto status = library_->SetAttributeViInt64(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3257,9 +3153,8 @@ namespace nirfsg_grpc { auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3284,9 +3179,8 @@ namespace nirfsg_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3329,9 +3223,8 @@ namespace nirfsg_grpc { auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3355,9 +3248,8 @@ namespace nirfsg_grpc { ViInt8* data = (ViInt8*)request->data().c_str(); auto status = library_->SetUserData(vi, identifier, buffer_size, data); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3381,9 +3273,8 @@ namespace nirfsg_grpc { auto locations = const_cast(request->locations().data()); auto status = library_->SetWaveformBurstStartLocations(vi, channel_name, number_of_locations, locations); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3407,9 +3298,8 @@ namespace nirfsg_grpc { auto locations = const_cast(request->locations().data()); auto status = library_->SetWaveformBurstStopLocations(vi, channel_name, number_of_locations, locations); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3433,9 +3323,8 @@ namespace nirfsg_grpc { auto locations = const_cast(request->locations().data()); auto status = library_->SetWaveformMarkerEventLocations(vi, channel_name, number_of_locations, locations); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3457,9 +3346,8 @@ namespace nirfsg_grpc { ViInt32 max_time_milliseconds = request->max_time_milliseconds(); auto status = library_->WaitUntilSettled(vi, max_time_milliseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3496,9 +3384,8 @@ namespace nirfsg_grpc { ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveform(vi, waveform_name, number_of_samples, i_data, q_data, more_data_pending); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3523,9 +3410,8 @@ namespace nirfsg_grpc { ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveformComplexF32(vi, waveform_name, number_of_samples, wfm_data.data(), more_data_pending); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3550,9 +3436,8 @@ namespace nirfsg_grpc { ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveformComplexF64(vi, waveform_name, number_of_samples, wfm_data.data(), more_data_pending); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3576,9 +3461,8 @@ namespace nirfsg_grpc { auto wfm_data = convert_from_grpc(request->wfm_data()); auto status = library_->WriteArbWaveformComplexI16(vi, waveform_name, number_of_samples, wfm_data.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3615,9 +3499,8 @@ namespace nirfsg_grpc { ViBoolean more_data_pending = request->more_data_pending(); auto status = library_->WriteArbWaveformF32(vi, waveform_name, number_of_samples, i_data, q_data, more_data_pending); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -3639,9 +3522,8 @@ namespace nirfsg_grpc { auto script = request->script().c_str(); auto status = library_->WriteScript(vi, script); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/niscope/niscope_service.cpp b/generated/niscope/niscope_service.cpp index 811f423ac..0768db20c 100644 --- a/generated/niscope/niscope_service.cpp +++ b/generated/niscope/niscope_service.cpp @@ -57,9 +57,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Abort(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -81,9 +80,8 @@ namespace niscope_grpc { ViInt32 acquisition_status {}; auto status = library_->AcquisitionStatus(vi, &acquisition_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_acquisition_status(static_cast(acquisition_status)); response->set_acquisition_status_raw(acquisition_status); @@ -123,9 +121,8 @@ namespace niscope_grpc { ViInt32 meas_waveform_size {}; auto status = library_->ActualMeasWfmSize(vi, array_meas_function, &meas_waveform_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_meas_waveform_size(meas_waveform_size); return ::grpc::Status::OK; @@ -149,9 +146,8 @@ namespace niscope_grpc { ViInt32 num_wfms {}; auto status = library_->ActualNumWfms(vi, channel_list, &num_wfms); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_num_wfms(num_wfms); return ::grpc::Status::OK; @@ -174,9 +170,8 @@ namespace niscope_grpc { ViInt32 record_length {}; auto status = library_->ActualRecordLength(vi, &record_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_record_length(record_length); return ::grpc::Status::OK; @@ -215,9 +210,8 @@ namespace niscope_grpc { auto status = library_->AddWaveformProcessing(vi, channel_list, meas_function); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -239,9 +233,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->AdjustSampleClockRelativeDelay(vi, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -262,9 +255,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AutoSetup(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -285,9 +277,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->CableSenseSignalStart(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -308,9 +299,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->CableSenseSignalStop(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -348,9 +338,8 @@ namespace niscope_grpc { auto status = library_->CalSelfCalibrate(vi, channel_list, option); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -374,9 +363,8 @@ namespace niscope_grpc { ViBoolean value = request->value(); auto status = library_->CheckAttributeViBoolean(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -415,9 +403,8 @@ namespace niscope_grpc { auto status = library_->CheckAttributeViInt32(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -456,9 +443,8 @@ namespace niscope_grpc { auto status = library_->CheckAttributeViInt64(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -505,9 +491,8 @@ namespace niscope_grpc { auto status = library_->CheckAttributeViReal64(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -532,9 +517,8 @@ namespace niscope_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -577,9 +561,8 @@ namespace niscope_grpc { auto status = library_->CheckAttributeViString(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -617,9 +600,8 @@ namespace niscope_grpc { auto status = library_->ClearWaveformMeasurementStats(vi, channel_list, clearable_measurement_function); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -641,9 +623,8 @@ namespace niscope_grpc { auto channel_list = request->channel_list().c_str(); auto status = library_->ClearWaveformProcessing(vi, channel_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -665,9 +646,8 @@ namespace niscope_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -688,9 +668,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -712,9 +691,8 @@ namespace niscope_grpc { ViInt32 acquisition_type = request->acquisition_type(); auto status = library_->ConfigureAcquisition(vi, acquisition_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -738,9 +716,8 @@ namespace niscope_grpc { ViReal64 max_input_frequency = request->max_input_frequency(); auto status = library_->ConfigureChanCharacteristics(vi, channel_list, input_impedance, max_input_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -822,9 +799,8 @@ namespace niscope_grpc { ViBoolean master_enabled = request->master_enabled(); auto status = library_->ConfigureClock(vi, input_clock_source, output_clock_source, clock_sync_pulse_source, master_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -848,9 +824,8 @@ namespace niscope_grpc { auto coefficients = const_cast(request->coefficients().data()); auto status = library_->ConfigureEqualizationFilterCoefficients(vi, channel_list, number_of_coefficients, coefficients); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -876,9 +851,8 @@ namespace niscope_grpc { ViBoolean enforce_realtime = request->enforce_realtime(); auto status = library_->ConfigureHorizontalTiming(vi, min_sample_rate, min_num_pts, ref_position, num_records, enforce_realtime); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -918,9 +892,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerDigital(vi, trigger_source, slope, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -977,9 +950,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerEdge(vi, trigger_source, level, slope, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1053,9 +1025,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerGlitch(vi, trigger_source, level, width, polarity, glitch_condition, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1113,9 +1084,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerHysteresis(vi, trigger_source, level, hysteresis, slope, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1136,9 +1106,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ConfigureTriggerImmediate(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1196,9 +1165,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerRunt(vi, trigger_source, low_threshold, high_threshold, polarity, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1221,9 +1189,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerSoftware(vi, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1313,9 +1280,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerVideo(vi, trigger_source, enable_dc_restore, signal_format, event_parameter, line_number, polarity, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1390,9 +1356,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerWidth(vi, trigger_source, level, low_threshold, high_threshold, polarity, condition, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1450,9 +1415,8 @@ namespace niscope_grpc { ViReal64 delay = request->delay(); auto status = library_->ConfigureTriggerWindow(vi, trigger_source, low_level, high_level, window_mode, trigger_coupling, holdoff, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1494,9 +1458,8 @@ namespace niscope_grpc { ViBoolean enabled = request->enabled(); auto status = library_->ConfigureVertical(vi, channel_list, range, offset, coupling, probe_attenuation, enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1517,9 +1480,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1543,9 +1505,8 @@ namespace niscope_grpc { std::string error_description(642 - 1, '\0'); auto status = library_->ErrorHandler(vi, error_code, error_source, (ViChar*)error_description.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_description(error_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); @@ -1569,10 +1530,9 @@ namespace niscope_grpc { while (true) { auto status = library_->ExportAttributeConfigurationBuffer(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 size_in_bytes = status; std::string configuration(size_in_bytes, '\0'); @@ -1581,10 +1541,9 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_configuration(configuration); return ::grpc::Status::OK; @@ -1608,9 +1567,8 @@ namespace niscope_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ExportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1668,9 +1626,8 @@ namespace niscope_grpc { auto status = library_->ExportSignal(vi, signal, signal_identifier, output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1694,9 +1651,8 @@ namespace niscope_grpc { ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, channel_list, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1721,9 +1677,8 @@ namespace niscope_grpc { ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, channel_list, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1748,9 +1703,8 @@ namespace niscope_grpc { ViInt64 value {}; auto status = library_->GetAttributeViInt64(vi, channel_list, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1775,9 +1729,8 @@ namespace niscope_grpc { ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, channel_list, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1802,9 +1755,8 @@ namespace niscope_grpc { ViSession value {}; auto status = library_->GetAttributeViSession(vi, channel_list, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); @@ -1830,10 +1782,9 @@ namespace niscope_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_list, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buf_size = status; std::string value; @@ -1845,10 +1796,9 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -1874,10 +1824,9 @@ namespace niscope_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string channel_string; @@ -1889,10 +1838,9 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_channel_string(channel_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); @@ -1918,10 +1866,9 @@ namespace niscope_grpc { while (true) { auto status = library_->GetChannelNameFromString(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string name; @@ -1933,10 +1880,9 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_name(name); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); @@ -1964,9 +1910,8 @@ namespace niscope_grpc { ViReal64* coefficients = response->mutable_coefficients()->mutable_data(); auto status = library_->GetEqualizationFilterCoefficients(vi, channel, number_of_coefficients, coefficients); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1988,10 +1933,9 @@ namespace niscope_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; ViStatus error_code {}; @@ -1999,15 +1943,14 @@ namespace niscope_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &error_code, buffer_size, description.data()); + status = library_->GetError(vi, &error_code, buffer_size, (ViChar*)description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_code(error_code); response->set_description(description); @@ -2034,10 +1977,9 @@ namespace niscope_grpc { while (true) { auto status = library_->GetErrorMessage(vi, error_code, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string error_message; @@ -2049,10 +1991,9 @@ namespace niscope_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -2085,9 +2026,8 @@ namespace niscope_grpc { ViInt32 number_of_frequencies {}; auto status = library_->GetFrequencyResponse(vi, channel, buffer_size, frequencies, amplitudes, phases, &number_of_frequencies); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_number_of_frequencies(number_of_frequencies); return ::grpc::Status::OK; @@ -2111,9 +2051,8 @@ namespace niscope_grpc { ViUInt32 writer_handle {}; auto status = library_->GetStreamEndpointHandle(vi, stream_name, &writer_handle); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_writer_handle(writer_handle); return ::grpc::Status::OK; @@ -2137,9 +2076,8 @@ namespace niscope_grpc { ViInt8* configuration = (ViInt8*)request->configuration().c_str(); auto status = library_->ImportAttributeConfigurationBuffer(vi, size_in_bytes, configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2161,9 +2099,8 @@ namespace niscope_grpc { auto file_path = request->file_path().c_str(); auto status = library_->ImportAttributeConfigurationFile(vi, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2194,9 +2131,8 @@ namespace niscope_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2232,9 +2168,8 @@ namespace niscope_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -2259,9 +2194,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InitiateAcquisition(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2282,9 +2216,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ProbeCompensationSignalStart(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2305,9 +2238,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ProbeCompensationSignalStop(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2328,9 +2260,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2351,9 +2282,8 @@ namespace niscope_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetDevice(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2376,9 +2306,8 @@ namespace niscope_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_driver_revision(driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); @@ -2404,9 +2333,8 @@ namespace niscope_grpc { ViInt32 sample_mode {}; auto status = library_->SampleMode(vi, &sample_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_sample_mode(sample_mode); return ::grpc::Status::OK; @@ -2429,9 +2357,8 @@ namespace niscope_grpc { ViReal64 sample_rate {}; auto status = library_->SampleRate(vi, &sample_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_sample_rate(sample_rate); return ::grpc::Status::OK; @@ -2455,9 +2382,8 @@ namespace niscope_grpc { std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -2497,9 +2423,8 @@ namespace niscope_grpc { auto status = library_->SendSoftwareTriggerEdge(vi, which_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2523,9 +2448,8 @@ namespace niscope_grpc { ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2564,9 +2488,8 @@ namespace niscope_grpc { auto status = library_->SetAttributeViInt32(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2605,9 +2528,8 @@ namespace niscope_grpc { auto status = library_->SetAttributeViInt64(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2654,9 +2576,8 @@ namespace niscope_grpc { auto status = library_->SetAttributeViReal64(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2681,9 +2602,8 @@ namespace niscope_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -2726,9 +2646,8 @@ namespace niscope_grpc { auto status = library_->SetAttributeViString(vi, channel_list, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/niswitch/niswitch_service.cpp b/generated/niswitch/niswitch_service.cpp index 7be485641..e965d939d 100644 --- a/generated/niswitch/niswitch_service.cpp +++ b/generated/niswitch/niswitch_service.cpp @@ -57,9 +57,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->AbortScan(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -83,9 +82,8 @@ namespace niswitch_grpc { ViInt32 path_capability {}; auto status = library_->CanConnect(vi, channel1, channel2, &path_capability); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_path_capability(static_cast(path_capability)); response->set_path_capability_raw(path_capability); @@ -111,9 +109,8 @@ namespace niswitch_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->CheckAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -152,9 +149,8 @@ namespace niswitch_grpc { auto status = library_->CheckAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -178,9 +174,8 @@ namespace niswitch_grpc { ViReal64 attribute_value = request->attribute_value_raw(); auto status = library_->CheckAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -204,9 +199,8 @@ namespace niswitch_grpc { ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->CheckAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -231,9 +225,8 @@ namespace niswitch_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->CheckAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -254,9 +247,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearError(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -277,9 +269,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ClearInterchangeWarnings(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -301,9 +292,8 @@ namespace niswitch_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -324,9 +314,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Commit(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -364,9 +353,8 @@ namespace niswitch_grpc { auto status = library_->ConfigureScanList(vi, scanlist, scan_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -420,9 +408,8 @@ namespace niswitch_grpc { auto status = library_->ConfigureScanTrigger(vi, scan_delay, trigger_input, scan_advanced_output); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -445,9 +432,8 @@ namespace niswitch_grpc { auto channel2 = request->channel2().c_str(); auto status = library_->Connect(vi, channel1, channel2); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -469,9 +455,8 @@ namespace niswitch_grpc { auto connection_list = request->connection_list().c_str(); auto status = library_->ConnectMultiple(vi, connection_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -492,9 +477,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Disable(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -517,9 +501,8 @@ namespace niswitch_grpc { auto channel2 = request->channel2().c_str(); auto status = library_->Disconnect(vi, channel1, channel2); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -540,9 +523,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisconnectAll(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -564,9 +546,8 @@ namespace niswitch_grpc { auto disconnection_list = request->disconnection_list().c_str(); auto status = library_->DisconnectMultiple(vi, disconnection_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -589,9 +570,8 @@ namespace niswitch_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -616,9 +596,8 @@ namespace niswitch_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorQuery(vi, &error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_code(error_code); response->set_error_message(error_message); @@ -645,9 +624,8 @@ namespace niswitch_grpc { ViBoolean attribute_value {}; auto status = library_->GetAttributeViBoolean(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -672,9 +650,8 @@ namespace niswitch_grpc { ViInt32 attribute_value {}; auto status = library_->GetAttributeViInt32(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -699,9 +676,8 @@ namespace niswitch_grpc { ViReal64 attribute_value {}; auto status = library_->GetAttributeViReal64(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_attribute_value(attribute_value); return ::grpc::Status::OK; @@ -726,10 +702,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetAttributeViString(vi, channel_name, attribute_id, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 array_size = status; std::string attribute_value; @@ -741,10 +716,9 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_attribute_value(attribute_value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); @@ -771,9 +745,8 @@ namespace niswitch_grpc { ViSession attribute_value {}; auto status = library_->GetAttributeViSession(vi, channel_name, attribute_id, &attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(attribute_value); response->mutable_attribute_value()->set_id(session_id); @@ -798,10 +771,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetChannelName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string channel_name_buffer; @@ -813,10 +785,9 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_channel_name_buffer(channel_name_buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name_buffer())); @@ -841,10 +812,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetError(vi, nullptr, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; ViStatus code {}; @@ -852,15 +822,14 @@ namespace niswitch_grpc { if (buffer_size > 0) { description.resize(buffer_size - 1); } - status = library_->GetError(vi, &code, buffer_size, description.data()); + status = library_->GetError(vi, &code, buffer_size, (ViChar*)description.data()); if (status == kErrorReadBufferTooSmall || status == kWarningCAPIStringTruncatedToFitBuffer || status > static_cast(buffer_size)) { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_code(code); response->set_description(description); @@ -886,10 +855,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetNextCoercionRecord(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string coercion_record; @@ -901,10 +869,9 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_coercion_record(coercion_record); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); @@ -929,10 +896,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetNextInterchangeWarning(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string interchange_warning; @@ -944,10 +910,9 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_interchange_warning(interchange_warning); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); @@ -974,10 +939,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetPath(vi, channel1, channel2, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string path; @@ -989,10 +953,9 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_path(path); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_path())); @@ -1018,9 +981,8 @@ namespace niswitch_grpc { ViInt32 relay_count {}; auto status = library_->GetRelayCount(vi, relay_name, &relay_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_relay_count(relay_count); return ::grpc::Status::OK; @@ -1044,10 +1006,9 @@ namespace niswitch_grpc { while (true) { auto status = library_->GetRelayName(vi, index, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 relay_name_buffer_size = status; std::string relay_name_buffer; @@ -1059,10 +1020,9 @@ namespace niswitch_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_relay_name_buffer(relay_name_buffer); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_relay_name_buffer())); @@ -1088,9 +1048,8 @@ namespace niswitch_grpc { ViInt32 relay_position {}; auto status = library_->GetRelayPosition(vi, relay_name, &relay_position); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_relay_position(static_cast(relay_position)); response->set_relay_position_raw(relay_position); @@ -1123,9 +1082,8 @@ namespace niswitch_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1161,9 +1119,8 @@ namespace niswitch_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1199,9 +1156,8 @@ namespace niswitch_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1226,9 +1182,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InitiateScan(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1249,9 +1204,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->InvalidateAllAttributes(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1273,9 +1227,8 @@ namespace niswitch_grpc { ViBoolean is_debounced {}; auto status = library_->IsDebounced(vi, &is_debounced); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_is_debounced(is_debounced); return ::grpc::Status::OK; @@ -1298,9 +1251,8 @@ namespace niswitch_grpc { ViBoolean is_scanning {}; auto status = library_->IsScanning(vi, &is_scanning); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_is_scanning(is_scanning); return ::grpc::Status::OK; @@ -1339,9 +1291,8 @@ namespace niswitch_grpc { auto status = library_->RelayControl(vi, relay_name, relay_action); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1362,9 +1313,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1385,9 +1335,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetInterchangeCheck(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1408,9 +1357,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetWithDefaults(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1433,9 +1381,8 @@ namespace niswitch_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)instrument_driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_instrument_driver_revision(instrument_driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); @@ -1493,9 +1440,8 @@ namespace niswitch_grpc { ViBoolean invert = request->invert(); auto status = library_->RouteScanAdvancedOutput(vi, scan_advanced_output_connector, scan_advanced_output_bus_line, invert); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1549,9 +1495,8 @@ namespace niswitch_grpc { ViBoolean invert = request->invert(); auto status = library_->RouteTriggerInput(vi, trigger_input_connector, trigger_input_bus_line, invert); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1589,9 +1534,8 @@ namespace niswitch_grpc { auto status = library_->Scan(vi, scanlist, initiation); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1614,9 +1558,8 @@ namespace niswitch_grpc { std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -1640,9 +1583,8 @@ namespace niswitch_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SendSoftwareTrigger(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1666,9 +1608,8 @@ namespace niswitch_grpc { ViBoolean attribute_value = request->attribute_value(); auto status = library_->SetAttributeViBoolean(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1707,9 +1648,8 @@ namespace niswitch_grpc { auto status = library_->SetAttributeViInt32(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1733,9 +1673,8 @@ namespace niswitch_grpc { ViReal64 attribute_value = request->attribute_value_raw(); auto status = library_->SetAttributeViReal64(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1759,9 +1698,8 @@ namespace niswitch_grpc { ViString attribute_value = (ViString)request->attribute_value_raw().c_str(); auto status = library_->SetAttributeViString(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1786,9 +1724,8 @@ namespace niswitch_grpc { ViSession attribute_value = session_repository_->access_session(attribute_value_grpc_session.id(), attribute_value_grpc_session.name()); auto status = library_->SetAttributeViSession(vi, channel_name, attribute_id, attribute_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1810,9 +1747,8 @@ namespace niswitch_grpc { ViBoolean continuous_scan = request->continuous_scan(); auto status = library_->SetContinuousScan(vi, continuous_scan); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1834,9 +1770,8 @@ namespace niswitch_grpc { auto path_list = request->path_list().c_str(); auto status = library_->SetPath(vi, path_list); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1858,9 +1793,8 @@ namespace niswitch_grpc { ViInt32 maximum_time_ms = request->maximum_time_ms(); auto status = library_->WaitForDebounce(vi, maximum_time_ms); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1882,9 +1816,8 @@ namespace niswitch_grpc { ViInt32 maximum_time_ms = request->maximum_time_ms(); auto status = library_->WaitForScanComplete(vi, maximum_time_ms); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nisync/nisync_service.cpp b/generated/nisync/nisync_service.cpp index 81c559122..e2fcba96f 100644 --- a/generated/nisync/nisync_service.cpp +++ b/generated/nisync/nisync_service.cpp @@ -66,9 +66,8 @@ namespace nisync_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -94,9 +93,8 @@ namespace nisync_grpc { session_repository_->remove_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Close(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -119,9 +117,8 @@ namespace nisync_grpc { std::string error_message(256 - 1, '\0'); auto status = library_->ErrorMessage(vi, error_code, (ViChar*)error_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_error_message(error_message); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); @@ -144,9 +141,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Reset(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -167,9 +163,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->PersistConfig(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -192,9 +187,8 @@ namespace nisync_grpc { std::string self_test_message(256 - 1, '\0'); auto status = library_->SelfTest(vi, &self_test_result, (ViChar*)self_test_message.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_self_test_result(self_test_result); response->set_self_test_message(self_test_message); @@ -220,9 +214,8 @@ namespace nisync_grpc { std::string firmware_revision(256 - 1, '\0'); auto status = library_->RevisionQuery(vi, (ViChar*)driver_revision.data(), (ViChar*)firmware_revision.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_driver_revision(driver_revision); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); @@ -252,9 +245,8 @@ namespace nisync_grpc { ViInt32 update_edge = request->update_edge(); auto status = library_->ConnectTrigTerminals(vi, src_terminal, dest_terminal, sync_clock, invert, update_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -277,9 +269,8 @@ namespace nisync_grpc { auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->DisconnectTrigTerminals(vi, src_terminal, dest_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -306,9 +297,8 @@ namespace nisync_grpc { ViReal64 delay = request->delay(); auto status = library_->ConnectSWTrigToTerminal(vi, src_terminal, dest_terminal, sync_clock, invert, update_edge, delay); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -331,9 +321,8 @@ namespace nisync_grpc { auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->DisconnectSWTrigFromTerminal(vi, src_terminal, dest_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -355,9 +344,8 @@ namespace nisync_grpc { auto src_terminal = request->src_terminal().c_str(); auto status = library_->SendSoftwareTrigger(vi, src_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -380,9 +368,8 @@ namespace nisync_grpc { auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->ConnectClkTerminals(vi, src_terminal, dest_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -405,9 +392,8 @@ namespace nisync_grpc { auto dest_terminal = request->dest_terminal().c_str(); auto status = library_->DisconnectClkTerminals(vi, src_terminal, dest_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -433,9 +419,8 @@ namespace nisync_grpc { ViReal64 error {}; auto status = library_->MeasureFrequency(vi, src_terminal, duration, &actual_duration, &frequency, &error); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_duration(actual_duration); response->set_frequency(frequency); @@ -465,9 +450,8 @@ namespace nisync_grpc { ViReal64 frequency_error {}; auto status = library_->MeasureFrequencyEx(vi, src_terminal, duration, decimation_count, &actual_duration, &frequency, &frequency_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_actual_duration(actual_duration); response->set_frequency(frequency); @@ -491,9 +475,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Start1588(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -514,9 +497,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Stop1588(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -537,9 +519,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Start8021AS(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -560,9 +541,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->Stop8021AS(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -587,9 +567,8 @@ namespace nisync_grpc { ViUInt16 time_fractional_nanoseconds = request->time_fractional_nanoseconds(); auto status = library_->SetTime(vi, time_source, time_seconds, time_nanoseconds, time_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -613,9 +592,8 @@ namespace nisync_grpc { ViUInt16 time_fractional_nanoseconds {}; auto status = library_->GetTime(vi, &time_seconds, &time_nanoseconds, &time_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_time_seconds(time_seconds); response->set_time_nanoseconds(time_nanoseconds); @@ -639,9 +617,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->ResetFrequency(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -667,9 +644,8 @@ namespace nisync_grpc { ViUInt16 time_fractional_nanoseconds = request->time_fractional_nanoseconds(); auto status = library_->CreateFutureTimeEvent(vi, terminal, output_level, time_seconds, time_nanoseconds, time_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -691,9 +667,8 @@ namespace nisync_grpc { auto terminal = request->terminal().c_str(); auto status = library_->ClearFutureTimeEvents(vi, terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -716,9 +691,8 @@ namespace nisync_grpc { ViInt32 active_edge = request->active_edge(); auto status = library_->EnableTimeStampTrigger(vi, terminal, active_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -742,9 +716,8 @@ namespace nisync_grpc { ViUInt32 decimation_count = request->decimation_count(); auto status = library_->EnableTimeStampTriggerWithDecimation(vi, terminal, active_edge, decimation_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -771,9 +744,8 @@ namespace nisync_grpc { ViInt32 detected_edge {}; auto status = library_->ReadTriggerTimeStamp(vi, terminal, timeout, &time_seconds, &time_nanoseconds, &time_fractional_nanoseconds, &detected_edge); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_time_seconds(time_seconds); response->set_time_nanoseconds(time_nanoseconds); @@ -799,9 +771,8 @@ namespace nisync_grpc { auto terminal = request->terminal().c_str(); auto status = library_->DisableTimeStampTrigger(vi, terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -831,9 +802,8 @@ namespace nisync_grpc { ViUInt16 stop_time_fractional_nanoseconds = request->stop_time_fractional_nanoseconds(); auto status = library_->CreateClock(vi, terminal, high_ticks, low_ticks, start_time_seconds, start_time_nanoseconds, start_time_fractional_nanoseconds, stop_time_seconds, stop_time_nanoseconds, stop_time_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -855,9 +825,8 @@ namespace nisync_grpc { auto terminal = request->terminal().c_str(); auto status = library_->ClearClock(vi, terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -878,9 +847,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReferenceFreeRunning(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -901,9 +869,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReferenceGPS(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -926,9 +893,8 @@ namespace nisync_grpc { auto terminal_name = request->terminal_name().c_str(); auto status = library_->SetTimeReferenceIRIG(vi, irig_type, terminal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -954,9 +920,8 @@ namespace nisync_grpc { ViUInt16 initial_time_fractional_nanoseconds = request->initial_time_fractional_nanoseconds(); auto status = library_->SetTimeReferencePPS(vi, terminal_name, use_manual_time, initial_time_seconds, initial_time_nanoseconds, initial_time_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -977,9 +942,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReference1588OrdinaryClock(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1000,9 +964,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->SetTimeReference8021AS(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1023,9 +986,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->EnableGPSTimestamping(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1048,9 +1010,8 @@ namespace nisync_grpc { auto terminal_name = request->terminal_name().c_str(); auto status = library_->EnableIRIGTimestamping(vi, irig_type, terminal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1077,9 +1038,8 @@ namespace nisync_grpc { ViUInt16 gps_fractional_nanoseconds {}; auto status = library_->ReadLastGPSTimestamp(vi, ×tamp_seconds, ×tamp_nanoseconds, ×tamp_fractional_nanoseconds, &gps_seconds, &gps_nanoseconds, &gps_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_timestamp_seconds(timestamp_seconds); response->set_timestamp_nanoseconds(timestamp_nanoseconds); @@ -1113,9 +1073,8 @@ namespace nisync_grpc { ViUInt16 irigb_fractional_nanoseconds {}; auto status = library_->ReadLastIRIGTimestamp(vi, terminal, ×tamp_seconds, ×tamp_nanoseconds, ×tamp_fractional_nanoseconds, &irigb_seconds, &irigb_nanoseconds, &irigb_fractional_nanoseconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_timestamp_seconds(timestamp_seconds); response->set_timestamp_nanoseconds(timestamp_nanoseconds); @@ -1142,9 +1101,8 @@ namespace nisync_grpc { ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); auto status = library_->DisableGPSTimestamping(vi); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1166,9 +1124,8 @@ namespace nisync_grpc { auto terminal_name = request->terminal_name().c_str(); auto status = library_->DisableIRIGTimestamping(vi, terminal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1192,9 +1149,8 @@ namespace nisync_grpc { ViReal64 up_velocity {}; auto status = library_->GetVelocity(vi, &east_velocity, &north_velocity, &up_velocity); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_east_velocity(east_velocity); response->set_north_velocity(north_velocity); @@ -1221,9 +1177,8 @@ namespace nisync_grpc { ViReal64 altitude {}; auto status = library_->GetLocation(vi, &latitude, &longitude, &altitude); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_latitude(latitude); response->set_longitude(longitude); @@ -1248,10 +1203,9 @@ namespace nisync_grpc { while (true) { auto status = library_->GetTimeReferenceNames(vi, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViUInt32 buffer_size = status; std::string time_reference_names; @@ -1263,10 +1217,9 @@ namespace nisync_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_time_reference_names(time_reference_names); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_time_reference_names())); @@ -1293,9 +1246,8 @@ namespace nisync_grpc { ViInt32 value {}; auto status = library_->GetAttributeViInt32(vi, active_item, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1320,9 +1272,8 @@ namespace nisync_grpc { ViReal64 value {}; auto status = library_->GetAttributeViReal64(vi, active_item, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1347,9 +1298,8 @@ namespace nisync_grpc { ViBoolean value {}; auto status = library_->GetAttributeViBoolean(vi, active_item, attribute, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -1374,10 +1324,9 @@ namespace nisync_grpc { while (true) { auto status = library_->GetAttributeViString(vi, active_item, attribute, 0, nullptr); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, vi); - } - + } ViInt32 buffer_size = status; std::string value; @@ -1389,10 +1338,9 @@ namespace nisync_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); response->set_value(value); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); @@ -1419,9 +1367,8 @@ namespace nisync_grpc { ViInt32 value = request->value_raw(); auto status = library_->SetAttributeViInt32(vi, active_item, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1445,9 +1392,8 @@ namespace nisync_grpc { ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(vi, active_item, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1471,9 +1417,8 @@ namespace nisync_grpc { ViBoolean value = request->value(); auto status = library_->SetAttributeViBoolean(vi, active_item, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1497,9 +1442,8 @@ namespace nisync_grpc { auto value = request->value_raw().c_str(); auto status = library_->SetAttributeViString(vi, active_item, attribute, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1525,9 +1469,8 @@ namespace nisync_grpc { ViInt32 minute {}; auto status = library_->GetExtCalLastDateAndTime(vi, &year, &month, &day, &hour, &minute); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_year(year); response->set_month(month); @@ -1554,9 +1497,8 @@ namespace nisync_grpc { ViReal64 temp {}; auto status = library_->GetExtCalLastTemp(vi, &temp); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temp(temp); return ::grpc::Status::OK; @@ -1579,9 +1521,8 @@ namespace nisync_grpc { ViInt32 months {}; auto status = library_->GetExtCalRecommendedInterval(vi, &months); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_months(months); return ::grpc::Status::OK; @@ -1605,9 +1546,8 @@ namespace nisync_grpc { auto new_password = request->new_password().c_str(); auto status = library_->ChangeExtCalPassword(vi, old_password, new_password); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1629,9 +1569,8 @@ namespace nisync_grpc { ViReal64 temperature {}; auto status = library_->ReadCurrentTemperature(vi, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_temperature(temperature); return ::grpc::Status::OK; @@ -1654,9 +1593,8 @@ namespace nisync_grpc { ViReal64 voltage {}; auto status = library_->CalGetOscillatorVoltage(vi, &voltage); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_voltage(voltage); return ::grpc::Status::OK; @@ -1679,9 +1617,8 @@ namespace nisync_grpc { ViReal64 voltage {}; auto status = library_->CalGetClk10PhaseVoltage(vi, &voltage); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_voltage(voltage); return ::grpc::Status::OK; @@ -1704,9 +1641,8 @@ namespace nisync_grpc { ViReal64 voltage {}; auto status = library_->CalGetDDSStartPulsePhaseVoltage(vi, &voltage); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_voltage(voltage); return ::grpc::Status::OK; @@ -1729,9 +1665,8 @@ namespace nisync_grpc { ViReal64 phase {}; auto status = library_->CalGetDDSInitialPhase(vi, &phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_phase(phase); return ::grpc::Status::OK; @@ -1762,9 +1697,8 @@ namespace nisync_grpc { auto cleanup_lambda = [&] (ViSession id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; @@ -1790,9 +1724,8 @@ namespace nisync_grpc { ViInt32 action = request->action(); auto status = library_->CloseExtCal(vi, action); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1815,9 +1748,8 @@ namespace nisync_grpc { ViReal64 old_voltage {}; auto status = library_->CalAdjustOscillatorVoltage(vi, measured_voltage, &old_voltage); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_old_voltage(old_voltage); return ::grpc::Status::OK; @@ -1841,9 +1773,8 @@ namespace nisync_grpc { ViReal64 old_voltage {}; auto status = library_->CalAdjustClk10PhaseVoltage(vi, measured_voltage, &old_voltage); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_old_voltage(old_voltage); return ::grpc::Status::OK; @@ -1867,9 +1798,8 @@ namespace nisync_grpc { ViReal64 old_voltage {}; auto status = library_->CalAdjustDDSStartPulsePhaseVoltage(vi, measured_voltage, &old_voltage); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_old_voltage(old_voltage); return ::grpc::Status::OK; @@ -1893,9 +1823,8 @@ namespace nisync_grpc { ViReal64 old_phase {}; auto status = library_->CalAdjustDDSInitialPhase(vi, measured_phase, &old_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, vi); + return ConvertApiErrorStatusForViSession(status, vi); } - response->set_status(status); response->set_old_phase(old_phase); return ::grpc::Status::OK; diff --git a/generated/nitclk/nitclk_service.cpp b/generated/nitclk/nitclk_service.cpp index 13d94a999..04b91ef5e 100644 --- a/generated/nitclk/nitclk_service.cpp +++ b/generated/nitclk/nitclk_service.cpp @@ -62,9 +62,8 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); auto status = library_->ConfigureForHomogeneousTriggers(session_count, sessions.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -92,9 +91,8 @@ namespace nitclk_grpc { ViReal64 min_time = request->min_time(); auto status = library_->FinishSyncPulseSenderSynchronize(session_count, sessions.data(), min_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -118,9 +116,8 @@ namespace nitclk_grpc { ViReal64 value {}; auto status = library_->GetAttributeViReal64(session, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, session); + return ConvertApiErrorStatusForViSession(status, session); } - response->set_status(status); response->set_value(value); return ::grpc::Status::OK; @@ -145,9 +142,8 @@ namespace nitclk_grpc { ViSession value {}; auto status = library_->GetAttributeViSession(session, channel_name, attribute_id, &value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, session); + return ConvertApiErrorStatusForViSession(status, session); } - response->set_status(status); auto session_id = session_repository_->resolve_session_id(value); response->mutable_value()->set_id(session_id); @@ -169,10 +165,9 @@ namespace nitclk_grpc { while (true) { auto status = library_->GetExtendedErrorInfo(nullptr, 0); - if (!status_ok(status)) { + if (!status_ok(status)) { return ConvertApiErrorStatusForViSession(status, 0); - } - + } ViUInt32 error_string_size = status; std::string error_string; @@ -184,10 +179,9 @@ namespace nitclk_grpc { // buffer is now too small, try again continue; } - if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); - } - + if (!status_ok(status)) { + return ConvertApiErrorStatusForViSession(status, 0); + } response->set_status(status); response->set_error_string(error_string); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); @@ -217,9 +211,8 @@ namespace nitclk_grpc { [&](auto session) { return session_repository_->access_session(session.id(), session.name()); }); auto status = library_->Initiate(session_count, sessions.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -247,9 +240,8 @@ namespace nitclk_grpc { ViBoolean done {}; auto status = library_->IsDone(session_count, sessions.data(), &done); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); response->set_done(done); return ::grpc::Status::OK; @@ -274,9 +266,8 @@ namespace nitclk_grpc { ViReal64 value = request->value_raw(); auto status = library_->SetAttributeViReal64(session, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, session); + return ConvertApiErrorStatusForViSession(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -301,9 +292,8 @@ namespace nitclk_grpc { ViSession value = session_repository_->access_session(value_grpc_session.id(), value_grpc_session.name()); auto status = library_->SetAttributeViSession(session, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, session); + return ConvertApiErrorStatusForViSession(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -327,9 +317,8 @@ namespace nitclk_grpc { auto value = request->value_raw().c_str(); auto status = library_->SetAttributeViString(session, channel_name, attribute_id, value); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, session); + return ConvertApiErrorStatusForViSession(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -357,9 +346,8 @@ namespace nitclk_grpc { ViReal64 min_time = request->min_time(); auto status = library_->SetupForSyncPulseSenderSynchronize(session_count, sessions.data(), min_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -387,9 +375,8 @@ namespace nitclk_grpc { ViReal64 min_tclk_period = request->min_tclk_period(); auto status = library_->Synchronize(session_count, sessions.data(), min_tclk_period); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -417,9 +404,8 @@ namespace nitclk_grpc { ViReal64 min_time = request->min_time(); auto status = library_->SynchronizeToSyncPulseSender(session_count, sessions.data(), min_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -447,9 +433,8 @@ namespace nitclk_grpc { ViReal64 timeout = request->timeout(); auto status = library_->WaitUntilDone(session_count, sessions.data(), timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForViSession(status, 0); + return ConvertApiErrorStatusForViSession(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nixnet/nixnet_service.cpp b/generated/nixnet/nixnet_service.cpp index 811264e83..0dd2972e4 100644 --- a/generated/nixnet/nixnet_service.cpp +++ b/generated/nixnet/nixnet_service.cpp @@ -72,9 +72,8 @@ namespace nixnet_grpc { auto status = library_->Blink(interface_ref, modifier); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, interface_ref); + return ConvertApiErrorStatusFornxSessionRef_t(status, interface_ref); } - response->set_status(status); return ::grpc::Status::OK; } @@ -96,9 +95,8 @@ namespace nixnet_grpc { session_repository_->remove_session(session_grpc_session.id(), session_grpc_session.name()); auto status = library_->Clear(session); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -159,9 +157,8 @@ namespace nixnet_grpc { auto status = library_->ConnectTerminals(session, source, destination); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -205,9 +202,8 @@ namespace nixnet_grpc { u32 number_of_bytes_returned {}; auto status = library_->ConvertByteArrayToFramesSinglePoint(session, value_buffer, size_of_value_buffer, buffer.data(), size_of_buffer, &number_of_bytes_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); return ::grpc::Status::OK; @@ -233,9 +229,8 @@ namespace nixnet_grpc { std::string value_buffer(size_of_value_buffer, '\0'); auto status = library_->ConvertFramesToByteArraySinglePoint(session, frame_buffer, number_of_bytes_for_frames, (u8*)value_buffer.data(), size_of_value_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); response->set_value_buffer(value_buffer); return ::grpc::Status::OK; @@ -266,9 +261,8 @@ namespace nixnet_grpc { nxTimestamp100ns_t* timestamp_buffer = reinterpret_cast(response->mutable_timestamp_buffer()->mutable_data()); auto status = library_->ConvertFramesToSignalsSinglePoint(session, frame_buffer, number_of_bytes_for_frames, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -312,9 +306,8 @@ namespace nixnet_grpc { u32 number_of_bytes_returned {}; auto status = library_->ConvertSignalsToFramesSinglePoint(session, value_buffer, size_of_value_buffer, buffer.data(), size_of_buffer, &number_of_bytes_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); return ::grpc::Status::OK; @@ -336,9 +329,8 @@ namespace nixnet_grpc { nxTimestamp1ns_t to_timestamp_1ns {}; auto status = library_->ConvertTimestamp100nsTo1ns(from_timestamp_100ns, &to_timestamp_1ns); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->set_to_timestamp_1ns(to_timestamp_1ns); return ::grpc::Status::OK; @@ -360,9 +352,8 @@ namespace nixnet_grpc { nxTimestamp100ns_t to_timestamp_100ns {}; auto status = library_->ConvertTimestamp1nsTo100ns(from_timestamp_1ns, &to_timestamp_100ns); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->set_to_timestamp_100ns(to_timestamp_100ns); return ::grpc::Status::OK; @@ -411,9 +402,8 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->Clear(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->mutable_session()->set_id(session_id); return ::grpc::Status::OK; @@ -470,9 +460,8 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->Clear(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->mutable_session()->set_id(session_id); return ::grpc::Status::OK; @@ -498,9 +487,8 @@ namespace nixnet_grpc { u32 default_baud_rate = request->default_baud_rate(); auto status = library_->DbAddAlias(database_alias, database_filepath, default_baud_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -522,9 +510,8 @@ namespace nixnet_grpc { u64 default_baud_rate = request->default_baud_rate(); auto status = library_->DbAddAlias64(database_alias, database_filepath, default_baud_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -547,9 +534,8 @@ namespace nixnet_grpc { nx_database_ref_t_resource_repository_->remove_session(database_grpc_session.id(), database_grpc_session.name()); auto status = library_->DbCloseDatabase(database, close_all_refs); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); + return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); } - response->set_status(status); return ::grpc::Status::OK; } @@ -607,9 +593,8 @@ namespace nixnet_grpc { nx_database_ref_t_resource_repository_->remove_session(db_object_grpc_session.id(), db_object_grpc_session.name()); auto status = library_->DbDeleteObject(db_object); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); } - response->set_status(status); return ::grpc::Status::OK; } @@ -632,9 +617,8 @@ namespace nixnet_grpc { u32 percent_complete {}; auto status = library_->DbDeploy(ip_address, database_alias, wait_for_complete, &percent_complete); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->set_percent_complete(percent_complete); return ::grpc::Status::OK; @@ -710,9 +694,8 @@ namespace nixnet_grpc { u32 attribute_text_size {}; auto status = library_->DbGetDBCAttributeSize(db_object, mode, attribute_name, &attribute_text_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); } - response->set_status(status); response->set_attribute_text_size(attribute_text_size); return ::grpc::Status::OK; @@ -735,9 +718,8 @@ namespace nixnet_grpc { u32 sizeof_filepath_buffer {}; auto status = library_->DbGetDatabaseListSizes(ip_address, &sizeof_alias_buffer, &sizeof_filepath_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->set_sizeof_alias_buffer(sizeof_alias_buffer); response->set_sizeof_filepath_buffer(sizeof_filepath_buffer); @@ -777,9 +759,8 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->DbGetPropertySize(db_object, property_id, &property_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); } - response->set_status(status); response->set_property_size(property_size); return ::grpc::Status::OK; @@ -822,9 +803,8 @@ namespace nixnet_grpc { u32 percent_complete {}; auto status = library_->DbMerge(target_cluster, source_obj, copy_mode, prefix, wait_for_complete, &percent_complete); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, target_cluster); + return ConvertApiErrorStatusFornxDatabaseRef_t(status, target_cluster); } - response->set_status(status); response->set_percent_complete(percent_complete); return ::grpc::Status::OK; @@ -854,9 +834,8 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxDatabaseRef_t id) { library_->DbCloseDatabase(id, false); }; int status = nx_database_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->mutable_database()->set_id(session_id); return ::grpc::Status::OK; @@ -880,9 +859,8 @@ namespace nixnet_grpc { auto database_alias = request->database_alias().c_str(); auto status = library_->DbRemoveAlias(database_alias); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -904,9 +882,8 @@ namespace nixnet_grpc { auto db_filepath = request->db_filepath().c_str(); auto status = library_->DbSaveDatabase(database, db_filepath); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); + return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); } - response->set_status(status); return ::grpc::Status::OK; } @@ -927,9 +904,8 @@ namespace nixnet_grpc { auto database_alias = request->database_alias().c_str(); auto status = library_->DbUndeploy(ip_address, database_alias); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -990,9 +966,8 @@ namespace nixnet_grpc { auto status = library_->DisconnectTerminals(session, source, destination); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1013,9 +988,8 @@ namespace nixnet_grpc { nxSessionRef_t session = session_repository_->access_session(session_grpc_session.id(), session_grpc_session.name()); auto status = library_->Flush(session); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1053,9 +1027,8 @@ namespace nixnet_grpc { auto status = library_->FutureTimeTrigger(session, when, timescale); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1093,9 +1066,8 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->GetPropertySize(session, property_id, &property_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); response->set_property_size(property_size); return ::grpc::Status::OK; @@ -1135,9 +1107,8 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->GetSubPropertySize(session, active_index, property_id, &property_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); response->set_property_size(property_size); return ::grpc::Status::OK; @@ -1196,9 +1167,8 @@ namespace nixnet_grpc { u32 number_of_bytes_returned {}; auto status = library_->ReadFrame(session, buffer.data(), size_of_buffer, timeout, &number_of_bytes_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); return ::grpc::Status::OK; @@ -1227,9 +1197,8 @@ namespace nixnet_grpc { nxTimestamp100ns_t* timestamp_buffer = reinterpret_cast(response->mutable_timestamp_buffer()->mutable_data()); auto status = library_->ReadSignalSinglePoint(session, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1273,9 +1242,8 @@ namespace nixnet_grpc { u32 number_of_values_returned {}; auto status = library_->ReadSignalWaveform(session, timeout, &start_time, &delta_time, value_buffer.data(), size_of_value_buffer, &number_of_values_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); response->set_start_time(start_time); response->set_delta_time(delta_time); @@ -1311,9 +1279,8 @@ namespace nixnet_grpc { u32* num_pairs_buffer = response->mutable_num_pairs_buffer()->mutable_data(); auto status = library_->ReadSignalXY(session, &time_limit, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer, num_pairs_buffer, size_of_num_pairs_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1352,9 +1319,8 @@ namespace nixnet_grpc { _nxTimeLocalNetwork_t state_value {}; auto status = library_->ReadStateTimeTrigger(session, timeout, state_size, &state_value); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); convert_to_grpc(state_value, response->mutable_state_value()); return ::grpc::Status::OK; @@ -1392,9 +1358,8 @@ namespace nixnet_grpc { auto status = library_->Start(session, scope); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1417,9 +1382,8 @@ namespace nixnet_grpc { library_->StatusToString(status_id, sizeof_string, (char*)status_description.data()); auto status = 0; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->set_status_description(status_description); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_status_description())); @@ -1458,9 +1422,8 @@ namespace nixnet_grpc { auto status = library_->Stop(session, scope); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1482,9 +1445,8 @@ namespace nixnet_grpc { session_repository_->remove_session(system_grpc_session.id(), system_grpc_session.name()); auto status = library_->SystemClose(system); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, system); + return ConvertApiErrorStatusFornxSessionRef_t(status, system); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1512,9 +1474,8 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->SystemClose(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusFornxSessionRef_t(status, 0); } - response->set_status(status); response->mutable_system()->set_id(session_id); return ::grpc::Status::OK; @@ -1558,9 +1519,8 @@ namespace nixnet_grpc { u32 param_out {}; auto status = library_->Wait(session, condition, param_in, timeout, ¶m_out); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); response->set_param_out(param_out); return ::grpc::Status::OK; @@ -1600,9 +1560,8 @@ namespace nixnet_grpc { auto status = library_->WriteFrame(session, buffer, number_of_bytes_for_frames, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1625,9 +1584,8 @@ namespace nixnet_grpc { u32 size_of_value_buffer = static_cast(request->value_buffer().size() * sizeof(f64)); auto status = library_->WriteSignalSinglePoint(session, value_buffer, size_of_value_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1666,9 +1624,8 @@ namespace nixnet_grpc { u32 size_of_value_buffer = static_cast(request->value_buffer().size() * sizeof(f64)); auto status = library_->WriteSignalWaveform(session, timeout, value_buffer, size_of_value_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1711,9 +1668,8 @@ namespace nixnet_grpc { u32 size_of_num_pairs_buffer = static_cast(request->num_pairs_buffer().size() * sizeof(u32)); auto status = library_->WriteSignalXY(session, timeout, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer, num_pairs_buffer, size_of_num_pairs_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusFornxSessionRef_t(status, session); } - response->set_status(status); return ::grpc::Status::OK; } diff --git a/generated/nixnetsocket/nixnetsocket_service.cpp b/generated/nixnetsocket/nixnetsocket_service.cpp index 4eda66a03..708c90045 100644 --- a/generated/nixnetsocket/nixnetsocket_service.cpp +++ b/generated/nixnetsocket/nixnetsocket_service.cpp @@ -68,9 +68,8 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxSOCKET id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); convert_to_grpc(addr, response->mutable_addr()); response->mutable_socket()->set_id(session_id); @@ -98,9 +97,8 @@ namespace nixnetsocket_grpc { auto namelen = name.size(); auto status = library_->Bind(socket, name, namelen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -122,9 +120,8 @@ namespace nixnetsocket_grpc { session_repository_->remove_session(socket_grpc_session.id(), socket_grpc_session.name()); auto status = library_->Close(socket); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -147,9 +144,8 @@ namespace nixnetsocket_grpc { auto namelen = name.size(); auto status = library_->Connect(socket, name, namelen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -172,9 +168,8 @@ namespace nixnetsocket_grpc { auto is_set = library_->FdIsSet(fd, set); auto status = 0; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, fd); + return ConvertApiErrorStatusFornxSOCKET(status, fd); } - response->set_status(status); response->set_is_set(is_set); return ::grpc::Status::OK; @@ -202,9 +197,8 @@ namespace nixnetsocket_grpc { auto res = allocate_output_storage>(library_); auto status = library_->GetAddrInfo(stack_ref, node_api, service_api, hints, &res); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); convert_to_grpc(res, response->mutable_res()); return ::grpc::Status::OK; @@ -242,9 +236,8 @@ namespace nixnetsocket_grpc { } auto status = library_->GetNameInfo(stack_ref, addr, addrlen, (char*)host.data(), hostlen, (char*)serv.data(), servlen, flags); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); response->set_host(host); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_host())); @@ -271,9 +264,8 @@ namespace nixnetsocket_grpc { auto addrlen = static_cast(sizeof(addr.storage)); auto status = library_->GetPeerName(socket, &addr, &addrlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); convert_to_grpc(addr, response->mutable_addr()); return ::grpc::Status::OK; @@ -297,9 +289,8 @@ namespace nixnetsocket_grpc { auto addrlen = static_cast(sizeof(addr.storage)); auto status = library_->GetSockName(socket, &addr, &addrlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); convert_to_grpc(addr, response->mutable_addr()); return ::grpc::Status::OK; @@ -355,9 +346,8 @@ namespace nixnetsocket_grpc { auto optlen = optval.size(socket, level); auto status = library_->GetSockOpt(socket, level, optname, optval.data(), &optlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); convert_to_grpc(optval, response->mutable_optval()); return ::grpc::Status::OK; @@ -381,9 +371,8 @@ namespace nixnetsocket_grpc { auto addr = library_->InetAddr(stack_ref, cp); auto status = addr == -1 ? -1 : 0; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); response->set_addr(addr); return ::grpc::Status::OK; @@ -407,9 +396,8 @@ namespace nixnetsocket_grpc { auto name = allocate_output_storage(); auto status = library_->InetAToN(stack_ref, cp, &name); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); convert_to_grpc(name, response->mutable_name()); return ::grpc::Status::OK; @@ -433,9 +421,8 @@ namespace nixnetsocket_grpc { auto address = library_->InetNToA(stack_ref, in_addr); auto status = address ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); response->set_address(address); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); @@ -463,9 +450,8 @@ namespace nixnetsocket_grpc { auto address = library_->InetNToP(stack_ref, af, addr, (char*)dst.data(), size); auto status = address ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); response->set_address(address); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); @@ -506,9 +492,8 @@ namespace nixnetsocket_grpc { auto addr = allocate_output_storage(af); auto status = library_->InetPToN(stack_ref, af, address, &addr); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); convert_to_grpc(addr, response->mutable_addr()); return ::grpc::Status::OK; @@ -531,9 +516,8 @@ namespace nixnetsocket_grpc { nx_ip_stack_ref_t_resource_repository_->remove_session(stack_ref_grpc_session.id(), stack_ref_grpc_session.name()); auto status = library_->IpStackClear(stack_ref); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); return ::grpc::Status::OK; } @@ -563,9 +547,8 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxIpStackRef_t id) { library_->IpStackClear(id); }; int status = nx_ip_stack_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusFornxSOCKET(status, 0); } - response->set_status(status); response->mutable_stack_ref()->set_id(session_id); return ::grpc::Status::OK; @@ -605,9 +588,8 @@ namespace nixnetsocket_grpc { auto info = allocate_output_storage(library_); auto status = library_->IpStackGetAllStacksInfoStr(format, (nixnetsocket_grpc::IpStackInfoString*)info.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusFornxSOCKET(status, 0); } - response->set_status(status); convert_to_grpc(info, response->mutable_info()); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); @@ -632,9 +614,8 @@ namespace nixnetsocket_grpc { auto virtual_interfaces = allocate_output_storage>(library_); auto status = library_->IpStackGetInfo(stack_ref, info_id, &virtual_interfaces); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); convert_to_grpc(virtual_interfaces, response->mutable_virtual_interfaces()); return ::grpc::Status::OK; @@ -664,9 +645,8 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxIpStackRef_t id) { library_->IpStackClear(id); }; int status = nx_ip_stack_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusFornxSOCKET(status, 0); } - response->set_status(status); response->mutable_stack_ref()->set_id(session_id); return ::grpc::Status::OK; @@ -693,9 +673,8 @@ namespace nixnetsocket_grpc { int32_t timeout_ms = request->timeout_ms(); auto status = library_->IpStackWaitForInterface(stack_ref, local_interface, timeout_ms); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); return ::grpc::Status::OK; } @@ -717,9 +696,8 @@ namespace nixnetsocket_grpc { int32_t backlog = request->backlog(); auto status = library_->Listen(socket, backlog); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -746,9 +724,8 @@ namespace nixnetsocket_grpc { std::string data(size, '\0'); auto status = library_->Recv(socket, (char*)data.data(), size, flags); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); response->set_data(data); return ::grpc::Status::OK; @@ -778,9 +755,8 @@ namespace nixnetsocket_grpc { nxsocklen_t fromlen {}; auto status = library_->RecvFrom(socket, (char*)data.data(), size, flags, &from_addr, &fromlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); response->set_data(data); convert_to_grpc(from_addr, response->mutable_from_addr()); @@ -806,9 +782,8 @@ namespace nixnetsocket_grpc { auto timeout = convert_from_grpc(request->timeout()); auto status = library_->Select(nfds, readfds, writefds, exceptfds, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusFornxSOCKET(status, 0); } - response->set_status(status); return ::grpc::Status::OK; } @@ -832,9 +807,8 @@ namespace nixnetsocket_grpc { int32_t flags_raw = request->flags_raw(); auto status = library_->Send(socket, data, size, flags_raw); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -860,9 +834,8 @@ namespace nixnetsocket_grpc { auto tolen = to.size(); auto status = library_->SendTo(socket, data, size, flags_raw, to, tolen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -918,9 +891,8 @@ namespace nixnetsocket_grpc { auto optlen = opt_data.size(); auto status = library_->SetSockOpt(socket, level, optname, optval, optlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -957,9 +929,8 @@ namespace nixnetsocket_grpc { auto status = library_->Shutdown(socket, how); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusFornxSOCKET(status, socket); } - response->set_status(status); return ::grpc::Status::OK; } @@ -1037,9 +1008,8 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxSOCKET id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); } - response->set_status(status); response->mutable_socket()->set_id(session_id); return ::grpc::Status::OK; @@ -1069,9 +1039,8 @@ namespace nixnetsocket_grpc { auto error = library_->StrErrR(errnum, (char*)buf.data(), buf_len); auto status = error ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusFornxSOCKET(status, 0); } - response->set_status(status); response->set_error(error); nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error())); diff --git a/source/codegen/metadata/nirfmxspecan_restricted/config.py b/source/codegen/metadata/nirfmxspecan_restricted/config.py index 48200551e..10207cace 100644 --- a/source/codegen/metadata/nirfmxspecan_restricted/config.py +++ b/source/codegen/metadata/nirfmxspecan_restricted/config.py @@ -54,5 +54,6 @@ "metadata_version": "0.1", "module_name": "nirfmxspecan_restricted", "session_class_description": "An NI-RFmxSpecAn instrument handle", + 'session_handle_parameter_name': 'instrumentHandle', "duplicate_resource_handles_allowed": True, } diff --git a/source/codegen/templates/service_helpers.mako b/source/codegen/templates/service_helpers.mako index 3b56617cc..ad6d5d424 100644 --- a/source/codegen/templates/service_helpers.mako +++ b/source/codegen/templates/service_helpers.mako @@ -87,7 +87,7 @@ ${call_library_method( arg_string=service_helpers.create_args_for_ivi_dance(parameters), indent_level=1) }\ -${populate_error_check(function_data, parameters)} +${populate_error_check(function_data, parameters, indent_level=1)}\ ${size_param['type']} ${common_helpers.get_cpp_local_name(size_param)} = status; <%block filter="common_helpers.indent(1)">\ @@ -129,7 +129,7 @@ ${call_library_method( arg_string=service_helpers.create_args_for_ivi_dance_with_a_twist(parameters), indent_level=1) }\ -${populate_error_check(function_data, parameters)} +${populate_error_check(function_data, parameters, indent_level=1)}\ <%block filter="common_helpers.indent(1)">\ ${initialize_output_params(array_output_parameters)}\ \ @@ -720,7 +720,7 @@ ${initialize_hardcoded_parameter(parameter)} normal_outputs = [p for p in output_parameters if not p in get_last_error_outputs] %>\ <%block filter="common_helpers.indent(indent_level)">\ -${populate_error_check(function_data, parameters, indent_level)} +${populate_error_check(function_data, parameters)}\ response->set_status(status); %if output_parameters: ${set_response_values(normal_outputs, init_method)}\ @@ -746,7 +746,7 @@ ${set_response_values(normal_outputs, init_method)}\ break %>\ if (!status_ok(status)) { - return ConvertApiErrorStatusFor${handle_type}(status, ${session}); + return ConvertApiErrorStatusFor${handle_type}(status, ${session}); } \ diff --git a/source/custom/nidaqmx_service.custom.cpp b/source/custom/nidaqmx_service.custom.cpp index 22b83ef7f..1fa56c426 100644 --- a/source/custom/nidaqmx_service.custom.cpp +++ b/source/custom/nidaqmx_service.custom.cpp @@ -4,8 +4,9 @@ namespace nidaqmx_grpc { ::grpc::Status NiDAQmxService::ConvertApiErrorStatusForTaskHandle(google::protobuf::int32 status, TaskHandle task) { + // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorString(status, description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetExtendedErrorInfo(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nidcpower_service.custom.cpp b/source/custom/nidcpower_service.custom.cpp index 43dbd28a6..52949745f 100644 --- a/source/custom/nidcpower_service.custom.cpp +++ b/source/custom/nidcpower_service.custom.cpp @@ -57,13 +57,14 @@ ::grpc::Status NiDCPowerService::MeasureMultiple(::grpc::ServerContext* context, ::grpc::Status NiDCPowerService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { - const ViInt32 buffer_size = 4096; + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 256, "ErrorMessage expects a minimum buffer size."); ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, buffer_size, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->ErrorMessage(vi, status, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nidigitalpattern_service.custom.cpp b/source/custom/nidigitalpattern_service.custom.cpp index 56c4c99fa..b9e18c4ab 100644 --- a/source/custom/nidigitalpattern_service.custom.cpp +++ b/source/custom/nidigitalpattern_service.custom.cpp @@ -4,12 +4,14 @@ namespace nidigitalpattern_grpc { ::grpc::Status NiDigitalService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 256, "ErrorMessage expects a minimum buffer size."); ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->ErrorMessage(vi, status, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nidmm_service.custom.cpp b/source/custom/nidmm_service.custom.cpp index ea5171273..daf79c496 100644 --- a/source/custom/nidmm_service.custom.cpp +++ b/source/custom/nidmm_service.custom.cpp @@ -4,14 +4,14 @@ namespace nidmm_grpc { ::grpc::Status NiDmmService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { - const ViInt32 buffer_size = 4096; ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, buffer_size, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorMessage(vi, status, buffer_size, description.data()); + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetErrorMessage(vi, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nifgen_service.custom.cpp b/source/custom/nifgen_service.custom.cpp index befd11a34..a399f70ce 100644 --- a/source/custom/nifgen_service.custom.cpp +++ b/source/custom/nifgen_service.custom.cpp @@ -39,13 +39,15 @@ ::grpc::Status NiFgenService::CreateAdvancedArbSequence(::grpc::ServerContext* c ::grpc::Status NiFgenService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 256, "ErrorMessage expects a minimum buffer size."); ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->ErrorHandler(vi, status, description.data()); + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->ErrorMessage(vi, status, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxbluetooth_service.custom.cpp b/source/custom/nirfmxbluetooth_service.custom.cpp index 327b06b36..b3c8101b7 100644 --- a/source/custom/nirfmxbluetooth_service.custom.cpp +++ b/source/custom/nirfmxbluetooth_service.custom.cpp @@ -4,14 +4,14 @@ namespace nirfmxbluetooth_grpc { ::grpc::Status NiRFmxBluetoothService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { - const ViInt32 buffer_size = 4096; ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxinstr_service.custom.cpp b/source/custom/nirfmxinstr_service.custom.cpp index 969c1090e..af114c50c 100644 --- a/source/custom/nirfmxinstr_service.custom.cpp +++ b/source/custom/nirfmxinstr_service.custom.cpp @@ -117,6 +117,7 @@ ::grpc::Status NiRFmxInstrService::ConvertApiErrorStatusForniRFmxInstrHandle(goo library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nirfmxlte_service.custom.cpp b/source/custom/nirfmxlte_service.custom.cpp index 19ec513be..211148bdf 100644 --- a/source/custom/nirfmxlte_service.custom.cpp +++ b/source/custom/nirfmxlte_service.custom.cpp @@ -4,14 +4,14 @@ namespace nirfmxlte_grpc { ::grpc::Status NiRFmxLTEService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { - const ViInt32 buffer_size = 4096; ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxnr_service.custom.cpp b/source/custom/nirfmxnr_service.custom.cpp index 895a8bff5..7b7beb067 100644 --- a/source/custom/nirfmxnr_service.custom.cpp +++ b/source/custom/nirfmxnr_service.custom.cpp @@ -10,6 +10,7 @@ ::grpc::Status NiRFmxNRService::ConvertApiErrorStatusForniRFmxInstrHandle(google library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nirfmxspecan_restricted_service.custom.cpp b/source/custom/nirfmxspecan_restricted_service.custom.cpp index 591ea292f..ca1c85c35 100644 --- a/source/custom/nirfmxspecan_restricted_service.custom.cpp +++ b/source/custom/nirfmxspecan_restricted_service.custom.cpp @@ -1,2 +1,19 @@ +#include > + namespace nirfmxspecan_restricted_grpc { + +::grpc::Status NiRFmxSpecAnRestrictedService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + const ViInt32 buffer_size = 4096; + ViStatus error_code {}; + std::string description(buffer_size, '\0'); + // Try first to get the most recent error with a dynamic message. + library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + if (error_code != status) { + // Since another thread has changed the status, fall back to the static message lookup. + library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + } + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + } // namespace nirfmxspecan_restricted_grpc diff --git a/source/custom/nirfmxwlan_service.custom.cpp b/source/custom/nirfmxwlan_service.custom.cpp index c84b10bf8..3e4cb5261 100644 --- a/source/custom/nirfmxwlan_service.custom.cpp +++ b/source/custom/nirfmxwlan_service.custom.cpp @@ -10,6 +10,7 @@ ::grpc::Status NiRFmxWLANService::ConvertApiErrorStatusForniRFmxInstrHandle(goog library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nirfsa_service.custom.cpp b/source/custom/nirfsa_service.custom.cpp index 5b552451e..e12c7d4b6 100644 --- a/source/custom/nirfsa_service.custom.cpp +++ b/source/custom/nirfsa_service.custom.cpp @@ -4,13 +4,14 @@ namespace nirfsa_grpc { ::grpc::Status NiRFSAService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { - const ViInt32 buffer_size = 4096; + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 1024, "ErrorMessage expects a minimum buffer size."); ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, buffer_size, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->ErrorMessage(vi, status, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nirfsg_service.custom.cpp b/source/custom/nirfsg_service.custom.cpp index 8796dc6da..2df638d28 100644 --- a/source/custom/nirfsg_service.custom.cpp +++ b/source/custom/nirfsg_service.custom.cpp @@ -4,12 +4,14 @@ namespace nirfsg_grpc { ::grpc::Status NiRFSGService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 1024, "ErrorMessage expects a minimum buffer size."); ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->ErrorMessage(vi, status, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/niscope_service.custom.cpp b/source/custom/niscope_service.custom.cpp index d445fe175..38e2a0011 100644 --- a/source/custom/niscope_service.custom.cpp +++ b/source/custom/niscope_service.custom.cpp @@ -566,14 +566,14 @@ ::grpc::Status NiScopeService::ReadMeasurement(::grpc::ServerContext* context, c ::grpc::Status NiScopeService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { - const ViInt32 buffer_size = 4096; ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, buffer_size, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorMessage(vi, status, buffer_size, description.data()); + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetErrorMessage(vi, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/niswitch_service.custom.cpp b/source/custom/niswitch_service.custom.cpp index 0f39426de..8b6126eaf 100644 --- a/source/custom/niswitch_service.custom.cpp +++ b/source/custom/niswitch_service.custom.cpp @@ -4,12 +4,14 @@ namespace niswitch_grpc { ::grpc::Status NiSwitchService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 256, "ErrorMessage expects a minimum buffer size."); ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. + description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->ErrorMessage(vi, status, description.data()); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nisync_service.custom.cpp b/source/custom/nisync_service.custom.cpp index 3c56a242c..7aa2e3fb2 100644 --- a/source/custom/nisync_service.custom.cpp +++ b/source/custom/nisync_service.custom.cpp @@ -38,8 +38,8 @@ ::grpc::Status NiSyncService::ReadMultipleTriggerTimeStamp(::grpc::ServerContext ::grpc::Status NiSyncService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { - const ViInt32 buffer_size = 4096; - std::string description(buffer_size, '\0'); + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 256, "ErrorMessage expects a minimum buffer size."); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->ErrorMessage(vi, status, description.data()); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nixnet_service.custom.cpp b/source/custom/nixnet_service.custom.cpp index dea24d5fd..184c68291 100644 --- a/source/custom/nixnet_service.custom.cpp +++ b/source/custom/nixnet_service.custom.cpp @@ -1149,6 +1149,7 @@ ::grpc::Status NiXnetService::DbGetDBCAttribute(::grpc::ServerContext* context, ::grpc::Status NiXnetService::ConvertApiErrorStatusFornxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session) { + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 2048, "StatusToString expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); @@ -1156,6 +1157,7 @@ ::grpc::Status NiXnetService::ConvertApiErrorStatusFornxSessionRef_t(google::pro ::grpc::Status NiXnetService::ConvertApiErrorStatusFornxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session) { + static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 2048, "StatusToString expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/custom/nixnetsocket_service.custom.cpp b/source/custom/nixnetsocket_service.custom.cpp index b264c2255..25b319552 100644 --- a/source/custom/nixnetsocket_service.custom.cpp +++ b/source/custom/nixnetsocket_service.custom.cpp @@ -4,6 +4,7 @@ namespace nixnetsocket_grpc { ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxSOCKET(google::protobuf::int32 status, nxSOCKET socket) { + // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetLastErrorStr(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); @@ -11,6 +12,7 @@ ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxSOCKET(google::pro ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket) { + // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetLastErrorStr(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); diff --git a/source/server/converters.h b/source/server/converters.h index ad14d5b78..4fcb08ad1 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -324,8 +324,10 @@ const int kMaxGrpcErrorDescriptionSize = 4096; inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 status, std::string& description) { converters::trim_trailing_nulls(description); - // TODO: May need full-fledged json escape logic. - for (size_t index = 0; (index = description.find('"', index)) != std::string::npos; ++index) { + // TODO: AB#2103383: Ensure description strings are properly JSON encoded. + // Alex: grpc-device already uses nlohmann::json to parse the config file. + // Brad: If you don't want to add a dependency on a full-fledged JSON parser, consider the encodeAndStrcpy function from jsonz. + for (size_t index = 0; (index = description.find('"', index)) != std::string::npos; index += 2) { description.replace(index, 1, "\\\""); } std::string errorMessage = "{ \"code\":\"" + std::to_string(status) + "\", \"" + description + "\" }"; From 4586684f42809d9d6fc1689712dd35b75bb8e8ae Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Mon, 8 Aug 2022 09:32:40 -0500 Subject: [PATCH 03/11] Fix case naming, make custom methods use new error scheme too --- generated/nidaqmx/nidaqmx_service.cpp | 584 ++--- generated/nidcpower/nidcpower_service.cpp | 106 +- .../nidigitalpattern_service.cpp | 162 +- generated/nidmm/nidmm_service.cpp | 120 +- generated/nifake/nifake_service.cpp | 184 +- .../nifake_non_ivi/nifake_non_ivi_service.cpp | 62 +- generated/nifgen/nifgen_service.cpp | 156 +- .../nirfmxbluetooth_service.cpp | 712 +++--- .../nirfmxbluetooth/nirfmxbluetooth_service.h | 2 +- generated/nirfmxinstr/nirfmxinstr_service.cpp | 462 ++-- generated/nirfmxinstr/nirfmxinstr_service.h | 2 +- generated/nirfmxlte/nirfmxlte_service.cpp | 1882 +++++++-------- generated/nirfmxlte/nirfmxlte_service.h | 2 +- generated/nirfmxnr/nirfmxnr_service.cpp | 1546 ++++++------ generated/nirfmxnr/nirfmxnr_service.h | 2 +- .../nirfmxspecan/nirfmxspecan_service.cpp | 2074 ++++++++--------- generated/nirfmxspecan/nirfmxspecan_service.h | 2 +- .../nirfmxspecan_restricted_service.cpp | 30 +- .../nirfmxspecan_restricted_service.h | 2 +- generated/nirfmxwlan/nirfmxwlan_service.cpp | 1500 ++++++------ generated/nirfmxwlan/nirfmxwlan_service.h | 2 +- generated/nirfsa/nirfsa_service.cpp | 256 +- generated/nirfsg/nirfsg_service.cpp | 136 +- generated/niscope/niscope_service.cpp | 76 +- generated/niswitch/niswitch_service.cpp | 84 +- generated/nisync/nisync_service.cpp | 130 +- generated/nitclk/nitclk_service.cpp | 12 +- generated/nixnet/nixnet_service.cpp | 138 +- generated/nixnet/nixnet_service.h | 4 +- .../nixnetsocket/nixnetsocket_service.cpp | 120 +- generated/nixnetsocket/nixnetsocket_service.h | 4 +- source/codegen/templates/service.h.mako | 5 +- source/codegen/templates/service_helpers.mako | 77 +- source/custom/nidcpower_service.custom.cpp | 9 +- source/custom/nifgen_service.custom.cpp | 7 +- .../custom/nirfmxbluetooth_service.custom.cpp | 2 +- source/custom/nirfmxinstr_service.custom.cpp | 40 +- source/custom/nirfmxlte_service.custom.cpp | 2 +- source/custom/nirfmxnr_service.custom.cpp | 2 +- ...nirfmxspecan_restricted_service.custom.cpp | 13 +- source/custom/nirfmxspecan_service.custom.cpp | 2 +- source/custom/nirfmxwlan_service.custom.cpp | 2 +- source/custom/niscope_service.custom.cpp | 174 +- source/custom/nisync_service.custom.cpp | 5 +- source/custom/nitclk_service.custom.cpp | 12 +- source/custom/nixnet_service.custom.cpp | 407 ++-- source/custom/nixnetsocket_service.custom.cpp | 4 +- source/server/converters.h | 2 +- 48 files changed, 5688 insertions(+), 5631 deletions(-) diff --git a/generated/nidaqmx/nidaqmx_service.cpp b/generated/nidaqmx/nidaqmx_service.cpp index e93a55b76..5c414a81d 100644 --- a/generated/nidaqmx/nidaqmx_service.cpp +++ b/generated/nidaqmx/nidaqmx_service.cpp @@ -124,8 +124,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_device_name_out(device_name_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_device_name_out())); + response->set_device_name_out(device_name_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_device_name_out())); return ::grpc::Status::OK; } } @@ -150,7 +150,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_disconnected_ports_exist(disconnected_ports_exist); + response->set_disconnected_ports_exist(disconnected_ports_exist); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7039,7 +7039,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->mutable_task()->set_id(session_id); + response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7095,7 +7095,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->mutable_task()->set_id(session_id); + response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7131,7 +7131,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->mutable_task()->set_id(session_id); + response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7241,7 +7241,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_cal_supported(cal_supported); + response->set_cal_supported(cal_supported); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7375,11 +7375,11 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7408,11 +7408,11 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7462,9 +7462,9 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - for (int i = 0; i < stateVector.size(); ++i) { - response->add_power_up_states(stateVector[i]); - } + for (int i = 0; i < stateVector.size(); ++i) { + response->add_power_up_states(stateVector[i]); + } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7491,7 +7491,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->mutable_state_array()->Resize(array_size_copy, 0); + response->mutable_state_array()->Resize(array_size_copy, 0); response->mutable_channel_type_array()->Clear(); response->mutable_channel_type_array()->Reserve(array_size_copy); std::transform( @@ -7524,7 +7524,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7548,7 +7548,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7585,8 +7585,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_port_list(port_list); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); + response->set_port_list(port_list); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); return ::grpc::Status::OK; } } @@ -7630,7 +7630,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7673,7 +7673,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7716,7 +7716,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7773,8 +7773,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -7818,7 +7818,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7863,7 +7863,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7908,7 +7908,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8010,13 +8010,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::ChannelInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::ChannelInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8075,8 +8075,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -8122,7 +8122,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8165,7 +8165,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8208,7 +8208,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8306,13 +8306,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8367,11 +8367,11 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::DeviceInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_value()->Clear(); response->mutable_value()->Reserve(size); std::transform( @@ -8438,8 +8438,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -8483,7 +8483,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8561,7 +8561,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_logic_family(logic_family); + response->set_logic_family(logic_family); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8605,9 +8605,9 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - for (int i = 0; i < stateVector.size(); ++i) { - response->add_power_up_states(static_cast(stateVector[i])); - } + for (int i = 0; i < stateVector.size(); ++i) { + response->add_power_up_states(static_cast(stateVector[i])); + } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8651,9 +8651,9 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - for (int i = 0; i < stateVector.size(); ++i) { - response->add_pull_up_pull_down_states(static_cast(stateVector[i])); - } + for (int i = 0; i < stateVector.size(); ++i) { + response->add_pull_up_pull_down_states(static_cast(stateVector[i])); + } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8690,8 +8690,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_port_list(port_list); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); + response->set_port_list(port_list); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_port_list())); return ::grpc::Status::OK; } } @@ -8730,8 +8730,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_error_string(error_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); + response->set_error_string(error_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); return ::grpc::Status::OK; } } @@ -8776,7 +8776,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8820,7 +8820,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8864,13 +8864,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::ExportSignalInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::ExportSignalInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8928,8 +8928,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -8974,7 +8974,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9011,8 +9011,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_error_string(error_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); + response->set_error_string(error_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); return ::grpc::Status::OK; } } @@ -9037,7 +9037,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9061,7 +9061,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9101,8 +9101,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_buffer(buffer); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); + response->set_buffer(buffer); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); return ::grpc::Status::OK; } } @@ -9143,8 +9143,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_buffer(buffer); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); + response->set_buffer(buffer); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); return ::grpc::Status::OK; } } @@ -9185,8 +9185,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_buffer(buffer); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); + response->set_buffer(buffer); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_buffer())); return ::grpc::Status::OK; } } @@ -9230,7 +9230,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9287,8 +9287,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -9332,7 +9332,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9389,8 +9389,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -9434,7 +9434,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9491,8 +9491,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -9536,7 +9536,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9590,7 +9590,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } } @@ -9634,7 +9634,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9732,13 +9732,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9793,11 +9793,11 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::PhysicalChannelInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_value()->Clear(); response->mutable_value()->Reserve(size); std::transform( @@ -9864,8 +9864,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -9909,7 +9909,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10008,7 +10008,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10052,7 +10052,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10096,13 +10096,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::ReadInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::ReadInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10160,8 +10160,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -10206,7 +10206,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10250,7 +10250,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10294,7 +10294,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10338,13 +10338,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::RealTimeInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::RealTimeInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10388,7 +10388,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10412,7 +10412,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10455,7 +10455,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10553,13 +10553,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::ScaleInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::ScaleInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10616,8 +10616,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -10645,11 +10645,11 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10673,7 +10673,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10697,7 +10697,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10721,7 +10721,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(data, response->mutable_data()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10777,8 +10777,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -10821,7 +10821,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10865,7 +10865,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10923,8 +10923,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -10969,7 +10969,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11013,7 +11013,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11057,7 +11057,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11102,7 +11102,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11147,7 +11147,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11192,13 +11192,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11257,8 +11257,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -11304,7 +11304,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(value, response->mutable_value()); + convert_to_grpc(value, response->mutable_value()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11349,7 +11349,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11394,7 +11394,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11438,13 +11438,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::TimingInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11502,8 +11502,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -11548,7 +11548,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(value, response->mutable_value()); + convert_to_grpc(value, response->mutable_value()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11592,7 +11592,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11636,7 +11636,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11680,7 +11680,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11724,7 +11724,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11824,13 +11824,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -11886,11 +11886,11 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::TriggerInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_value()->Clear(); response->mutable_value()->Reserve(size); std::transform( @@ -11958,8 +11958,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -12004,7 +12004,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(value, response->mutable_value()); + convert_to_grpc(value, response->mutable_value()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12048,7 +12048,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12093,7 +12093,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12138,7 +12138,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12183,13 +12183,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::WatchdogInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::WatchdogInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12248,8 +12248,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -12294,7 +12294,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12338,7 +12338,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12382,13 +12382,13 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nidaqmx_grpc::WriteInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nidaqmx_grpc::WriteInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12446,8 +12446,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -12492,7 +12492,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12536,7 +12536,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12560,7 +12560,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_is_task_done(is_task_done); + response->set_is_task_done(is_task_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12591,7 +12591,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, 0); } response->set_status(status); - response->mutable_task()->set_id(session_id); + response->mutable_task()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12640,7 +12640,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12666,7 +12666,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12720,7 +12720,7 @@ namespace nidaqmx_grpc { [&](auto x) { return x; }); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12766,7 +12766,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12820,7 +12820,7 @@ namespace nidaqmx_grpc { [&](auto x) { return x; }); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12866,7 +12866,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12896,7 +12896,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12942,7 +12942,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12968,7 +12968,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12994,7 +12994,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13024,7 +13024,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13070,7 +13070,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13118,7 +13118,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13145,8 +13145,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_frequency(frequency); - response->set_duty_cycle(duty_cycle); + response->set_frequency(frequency); + response->set_duty_cycle(duty_cycle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13194,7 +13194,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13221,8 +13221,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_high_ticks(high_ticks); - response->set_low_ticks(low_ticks); + response->set_high_ticks(high_ticks); + response->set_low_ticks(low_ticks); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13270,7 +13270,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13297,8 +13297,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_high_time(high_time); - response->set_low_time(low_time); + response->set_high_time(high_time); + response->set_low_time(low_time); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13344,9 +13344,9 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_read_array(read_array); - response->set_samps_per_chan_read(samps_per_chan_read); - response->set_num_bytes_per_samp(num_bytes_per_samp); + response->set_read_array(read_array); + response->set_samps_per_chan_read(samps_per_chan_read); + response->set_num_bytes_per_samp(num_bytes_per_samp); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13372,7 +13372,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13426,7 +13426,7 @@ namespace nidaqmx_grpc { [&](auto x) { return x; }); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13472,7 +13472,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13517,8 +13517,8 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_read_array(read_array); - response->set_samps_per_chan_read(samps_per_chan_read); + response->set_read_array(read_array); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13548,9 +13548,9 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_read_array(read_array); - response->set_samps_read(samps_read); - response->set_num_bytes_per_samp(num_bytes_per_samp); + response->set_read_array(read_array); + response->set_samps_read(samps_read); + response->set_num_bytes_per_samp(num_bytes_per_samp); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13581,7 +13581,7 @@ namespace nidaqmx_grpc { [this](TaskHandle task, int32 status) { RegisterDoneEventResponse callback_response; auto response = &callback_response; - response->set_status(status); + response->set_status(status); queue_write(callback_response); return 0; }); @@ -13637,9 +13637,9 @@ namespace nidaqmx_grpc { [this](TaskHandle task, int32 every_n_samples_event_type, uInt32 n_samples) { RegisterEveryNSamplesEventResponse callback_response; auto response = &callback_response; - response->set_every_n_samples_event_type(static_cast(every_n_samples_event_type)); - response->set_every_n_samples_event_type_raw(every_n_samples_event_type); - response->set_n_samples(n_samples); + response->set_every_n_samples_event_type(static_cast(every_n_samples_event_type)); + response->set_every_n_samples_event_type_raw(every_n_samples_event_type); + response->set_n_samples(n_samples); queue_write(callback_response); return 0; }); @@ -13712,7 +13712,7 @@ namespace nidaqmx_grpc { [this](TaskHandle task, int32 signal_id) { RegisterSignalEventResponse callback_response; auto response = &callback_response; - response->set_signal_id(signal_id); + response->set_signal_id(signal_id); queue_write(callback_response); return 0; }); @@ -17702,7 +17702,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_is_late(is_late); + response->set_is_late(is_late); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17743,7 +17743,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - convert_to_grpc(timestamp, response->mutable_timestamp()); + convert_to_grpc(timestamp, response->mutable_timestamp()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17811,7 +17811,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17899,7 +17899,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -17947,7 +17947,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18009,7 +18009,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18057,7 +18057,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18103,7 +18103,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_num_samps_per_chan_written(num_samps_per_chan_written); + response->set_num_samps_per_chan_written(num_samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18176,7 +18176,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_num_samps_per_chan_written(num_samps_per_chan_written); + response->set_num_samps_per_chan_written(num_samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18249,7 +18249,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_num_samps_per_chan_written(num_samps_per_chan_written); + response->set_num_samps_per_chan_written(num_samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18321,7 +18321,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18409,7 +18409,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18457,7 +18457,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18502,7 +18502,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -18531,7 +18531,7 @@ namespace nidaqmx_grpc { return ConvertApiErrorStatusForTaskHandle(status, task); } response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + response->set_samps_per_chan_written(samps_per_chan_written); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nidcpower/nidcpower_service.cpp b/generated/nidcpower/nidcpower_service.cpp index 122e05b9d..2f3781329 100644 --- a/generated/nidcpower/nidcpower_service.cpp +++ b/generated/nidcpower/nidcpower_service.cpp @@ -790,7 +790,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); + response->set_error_code(error_code); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -864,7 +864,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2411,8 +2411,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2544,8 +2544,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(in_compliance, response->mutable_in_compliance()); - response->set_actual_count(actual_count); + convert_to_grpc(in_compliance, response->mutable_in_compliance()); + response->set_actual_count(actual_count); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2571,7 +2571,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2597,7 +2597,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2623,7 +2623,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2649,7 +2649,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2675,8 +2675,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(attribute_value); - response->mutable_attribute_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(attribute_value); + response->mutable_attribute_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2717,8 +2717,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); + response->set_attribute_value(attribute_value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); return ::grpc::Status::OK; } } @@ -2759,8 +2759,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_channel_name(channel_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); + response->set_channel_name(channel_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); return ::grpc::Status::OK; } } @@ -2801,8 +2801,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_channel_name(channel_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); + response->set_channel_name(channel_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name())); return ::grpc::Status::OK; } } @@ -2843,9 +2843,9 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_code(code); - response->set_description(description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); + response->set_code(code); + response->set_description(description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); return ::grpc::Status::OK; } } @@ -2874,11 +2874,11 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2902,7 +2902,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2926,7 +2926,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_months(months); + response->set_months(months); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2965,8 +2965,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_coercion_record(coercion_record); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); + response->set_coercion_record(coercion_record); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); return ::grpc::Status::OK; } } @@ -3006,8 +3006,8 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_interchange_warning(interchange_warning); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); + response->set_interchange_warning(interchange_warning); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); return ::grpc::Status::OK; } } @@ -3036,11 +3036,11 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3064,7 +3064,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3145,7 +3145,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3211,7 +3211,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_measurement(measurement); + response->set_measurement(measurement); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3236,7 +3236,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_in_compliance(in_compliance); + response->set_in_compliance(in_compliance); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3262,7 +3262,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_max_current_limit(max_current_limit); + response->set_max_current_limit(max_current_limit); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3288,7 +3288,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_max_voltage_level(max_voltage_level); + response->set_max_voltage_level(max_voltage_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3314,7 +3314,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_min_current_limit(min_current_limit); + response->set_min_current_limit(min_current_limit); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3355,7 +3355,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_in_state(in_state); + response->set_in_state(in_state); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3379,7 +3379,7 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3492,10 +3492,10 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_instrument_driver_revision(instrument_driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_instrument_driver_revision(instrument_driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3520,9 +3520,9 @@ namespace nidcpower_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nidigitalpattern/nidigitalpattern_service.cpp b/generated/nidigitalpattern/nidigitalpattern_service.cpp index 812d28bed..6f4ff7fdd 100644 --- a/generated/nidigitalpattern/nidigitalpattern_service.cpp +++ b/generated/nidigitalpattern/nidigitalpattern_service.cpp @@ -1481,8 +1481,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1563,9 +1563,9 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_data()->Resize(actual_num_waveforms, 0); - response->set_actual_num_waveforms(actual_num_waveforms); - response->set_actual_samples_per_waveform(actual_samples_per_waveform); + response->mutable_data()->Resize(actual_num_waveforms, 0); + response->set_actual_num_waveforms(actual_num_waveforms); + response->set_actual_samples_per_waveform(actual_samples_per_waveform); return ::grpc::Status::OK; } } @@ -1596,11 +1596,11 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_pattern_index(pattern_index); - response->set_time_set_index(time_set_index); - response->set_vector_number(vector_number); - response->set_cycle_number(cycle_number); - response->set_num_dut_cycles(num_dut_cycles); + response->set_pattern_index(pattern_index); + response->set_time_set_index(time_set_index); + response->set_vector_number(vector_number); + response->set_cycle_number(cycle_number); + response->set_num_dut_cycles(num_dut_cycles); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1641,15 +1641,15 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - CopyBytesToEnums(expected_pin_states, response->mutable_expected_pin_states()); - response->set_expected_pin_states_raw(expected_pin_states); - response->mutable_expected_pin_states()->Resize(actual_num_pin_data, 0); - CopyBytesToEnums(actual_pin_states, response->mutable_actual_pin_states()); - response->set_actual_pin_states_raw(actual_pin_states); - response->mutable_actual_pin_states()->Resize(actual_num_pin_data, 0); - convert_to_grpc(per_pin_pass_fail, response->mutable_per_pin_pass_fail()); - response->mutable_per_pin_pass_fail()->Resize(actual_num_pin_data, 0); - response->set_actual_num_pin_data(actual_num_pin_data); + CopyBytesToEnums(expected_pin_states, response->mutable_expected_pin_states()); + response->set_expected_pin_states_raw(expected_pin_states); + response->mutable_expected_pin_states()->Resize(actual_num_pin_data, 0); + CopyBytesToEnums(actual_pin_states, response->mutable_actual_pin_states()); + response->set_actual_pin_states_raw(actual_pin_states); + response->mutable_actual_pin_states()->Resize(actual_num_pin_data, 0); + convert_to_grpc(per_pin_pass_fail, response->mutable_per_pin_pass_fail()); + response->mutable_per_pin_pass_fail()->Resize(actual_num_pin_data, 0); + response->set_actual_num_pin_data(actual_num_pin_data); return ::grpc::Status::OK; } } @@ -1676,7 +1676,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_scan_cycle_number(scan_cycle_number); + response->set_scan_cycle_number(scan_cycle_number); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1775,8 +1775,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_frequencies()->Resize(actual_num_frequencies, 0); - response->set_actual_num_frequencies(actual_num_frequencies); + response->mutable_frequencies()->Resize(actual_num_frequencies, 0); + response->set_actual_num_frequencies(actual_num_frequencies); return ::grpc::Status::OK; } } @@ -1803,7 +1803,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1829,7 +1829,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1855,7 +1855,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1881,7 +1881,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1907,8 +1907,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(value); - response->mutable_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(value); + response->mutable_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1949,8 +1949,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -1991,8 +1991,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); return ::grpc::Status::OK; } } @@ -2033,8 +2033,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_names(names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_names())); + response->set_names(names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_names())); return ::grpc::Status::OK; } } @@ -2075,9 +2075,9 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2115,8 +2115,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_failure_count()->Resize(actual_num_read, 0); - response->set_actual_num_read(actual_num_read); + response->mutable_failure_count()->Resize(actual_num_read, 0); + response->set_actual_num_read(actual_num_read); return ::grpc::Status::OK; } } @@ -2142,7 +2142,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_sample_count(sample_count); + response->set_sample_count(sample_count); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2179,8 +2179,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_pin_indexes()->Resize(actual_num_pins, 0); - response->set_actual_num_pins(actual_num_pins); + response->mutable_pin_indexes()->Resize(actual_num_pins, 0); + response->set_actual_num_pins(actual_num_pins); return ::grpc::Status::OK; } } @@ -2221,8 +2221,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); return ::grpc::Status::OK; } } @@ -2263,8 +2263,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_pin_list(pin_list); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_pin_list())); + response->set_pin_list(pin_list); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_pin_list())); return ::grpc::Status::OK; } } @@ -2305,8 +2305,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); return ::grpc::Status::OK; } } @@ -2348,10 +2348,10 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_pin_indexes()->Resize(actual_num_values, 0); - response->mutable_site_numbers()->Resize(actual_num_values, 0); - response->mutable_channel_indexes()->Resize(actual_num_values, 0); - response->set_actual_num_values(actual_num_values); + response->mutable_pin_indexes()->Resize(actual_num_values, 0); + response->mutable_site_numbers()->Resize(actual_num_values, 0); + response->mutable_channel_indexes()->Resize(actual_num_values, 0); + response->set_actual_num_values(actual_num_values); return ::grpc::Status::OK; } } @@ -2388,9 +2388,9 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(pass_fail, response->mutable_pass_fail()); - response->mutable_pass_fail()->Resize(actual_num_sites, 0); - response->set_actual_num_sites(actual_num_sites); + convert_to_grpc(pass_fail, response->mutable_pass_fail()); + response->mutable_pass_fail()->Resize(actual_num_sites, 0); + response->set_actual_num_sites(actual_num_sites); return ::grpc::Status::OK; } } @@ -2444,8 +2444,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_site_numbers()->Resize(actual_num_site_numbers, 0); - response->set_actual_num_site_numbers(actual_num_site_numbers); + response->mutable_site_numbers()->Resize(actual_num_site_numbers, 0); + response->set_actual_num_site_numbers(actual_num_site_numbers); return ::grpc::Status::OK; } } @@ -2472,8 +2472,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_format(static_cast(format)); - response->set_format_raw(format); + response->set_format(static_cast(format)); + response->set_format_raw(format); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2515,7 +2515,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_time(time); + response->set_time(time); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2541,7 +2541,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_edge_multiplier(edge_multiplier); + response->set_edge_multiplier(edge_multiplier); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2581,8 +2581,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); return ::grpc::Status::OK; } } @@ -2608,7 +2608,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_period(period); + response->set_period(period); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2641,7 +2641,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2678,7 +2678,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2727,7 +2727,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_done(done); + response->set_done(done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2752,7 +2752,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_enable(enable); + response->set_enable(enable); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3185,8 +3185,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_measurements()->Resize(actual_num_read, 0); - response->set_actual_num_read(actual_num_read); + response->mutable_measurements()->Resize(actual_num_read, 0); + response->set_actual_num_read(actual_num_read); return ::grpc::Status::OK; } } @@ -3235,7 +3235,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3260,7 +3260,7 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3296,10 +3296,10 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - CopyBytesToEnums(data, response->mutable_data()); - response->set_data_raw(data); - response->mutable_data()->Resize(actual_num_read, 0); - response->set_actual_num_read(actual_num_read); + CopyBytesToEnums(data, response->mutable_data()); + response->set_data_raw(data); + response->mutable_data()->Resize(actual_num_read, 0); + response->set_actual_num_read(actual_num_read); return ::grpc::Status::OK; } } @@ -3454,9 +3454,9 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_test_result(test_result); - response->set_test_message(test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_test_message())); + response->set_test_result(test_result); + response->set_test_message(test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3699,8 +3699,8 @@ namespace nidigitalpattern_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_offsets()->Resize(actual_num_offsets, 0); - response->set_actual_num_offsets(actual_num_offsets); + response->mutable_offsets()->Resize(actual_num_offsets, 0); + response->set_actual_num_offsets(actual_num_offsets); return ::grpc::Status::OK; } } diff --git a/generated/nidmm/nidmm_service.cpp b/generated/nidmm/nidmm_service.cpp index 3051bade7..ce33a8a24 100644 --- a/generated/nidmm/nidmm_service.cpp +++ b/generated/nidmm/nidmm_service.cpp @@ -1311,7 +1311,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_configuration(configuration); + response->set_configuration(configuration); return ::grpc::Status::OK; } } @@ -1375,7 +1375,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_reading(reading); + response->set_reading(reading); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1418,7 +1418,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_number_of_points(actual_number_of_points); + response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1461,7 +1461,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_number_of_points(actual_number_of_points); + response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1486,12 +1486,12 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - if(aperture_time == (int)aperture_time) { - response->set_aperture_time(static_cast(static_cast(aperture_time))); - } - response->set_aperture_time_raw(aperture_time); - response->set_aperture_time_units(static_cast(aperture_time_units)); - response->set_aperture_time_units_raw(aperture_time_units); + if(aperture_time == (int)aperture_time) { + response->set_aperture_time(static_cast(static_cast(aperture_time))); + } + response->set_aperture_time_raw(aperture_time); + response->set_aperture_time_units(static_cast(aperture_time_units)); + response->set_aperture_time_units_raw(aperture_time_units); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1517,7 +1517,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1543,7 +1543,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1569,7 +1569,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1595,8 +1595,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(attribute_value); - response->mutable_attribute_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(attribute_value); + response->mutable_attribute_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1637,8 +1637,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); + response->set_attribute_value(attribute_value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); return ::grpc::Status::OK; } } @@ -1663,7 +1663,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_range(actual_range); + response->set_actual_range(actual_range); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1707,11 +1707,11 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_month(month); - response->set_day(day); - response->set_year(year); - response->set_hour(hour); - response->set_minute(minute); + response->set_month(month); + response->set_day(day); + response->set_year(year); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1751,8 +1751,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_channel_string(channel_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); + response->set_channel_string(channel_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); return ::grpc::Status::OK; } } @@ -1778,7 +1778,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1818,9 +1818,9 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_description(description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); + response->set_error_code(error_code); + response->set_description(description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); return ::grpc::Status::OK; } } @@ -1861,8 +1861,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } } @@ -1887,7 +1887,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_months(months); + response->set_months(months); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1927,7 +1927,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1951,7 +1951,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_period(period); + response->set_period(period); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1990,8 +1990,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_coercion_record(coercion_record); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); + response->set_coercion_record(coercion_record); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); return ::grpc::Status::OK; } } @@ -2031,8 +2031,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_interchange_warning(interchange_warning); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); + response->set_interchange_warning(interchange_warning); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); return ::grpc::Status::OK; } } @@ -2057,7 +2057,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_cal_supported(self_cal_supported); + response->set_self_cal_supported(self_cal_supported); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2137,7 +2137,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2174,7 +2174,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2246,7 +2246,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_is_over_range(is_over_range); + response->set_is_over_range(is_over_range); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2271,7 +2271,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_is_under_range(is_under_range); + response->set_is_under_range(is_under_range); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2296,8 +2296,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_conductance(conductance); - response->set_susceptance(susceptance); + response->set_conductance(conductance); + response->set_susceptance(susceptance); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2322,8 +2322,8 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_resistance(resistance); - response->set_reactance(reactance); + response->set_resistance(resistance); + response->set_reactance(reactance); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2363,7 +2363,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_reading(reading); + response->set_reading(reading); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2406,7 +2406,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_number_of_points(actual_number_of_points); + response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2431,9 +2431,9 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_acquisition_backlog(acquisition_backlog); - response->set_acquisition_status(static_cast(acquisition_status)); - response->set_acquisition_status_raw(acquisition_status); + response->set_acquisition_backlog(acquisition_backlog); + response->set_acquisition_status(static_cast(acquisition_status)); + response->set_acquisition_status_raw(acquisition_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2476,7 +2476,7 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_number_of_points(actual_number_of_points); + response->set_actual_number_of_points(actual_number_of_points); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2567,10 +2567,10 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_instrument_driver_revision(instrument_driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_instrument_driver_revision(instrument_driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2617,9 +2617,9 @@ namespace nidmm_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nifake/nifake_service.cpp b/generated/nifake/nifake_service.cpp index c53e9b388..2bb49a8f2 100644 --- a/generated/nifake/nifake_service.cpp +++ b/generated/nifake/nifake_service.cpp @@ -169,7 +169,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(an_array, response->mutable_an_array()); + convert_to_grpc(an_array, response->mutable_an_array()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -351,7 +351,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_configuration(configuration); + response->set_configuration(configuration); return ::grpc::Status::OK; } } @@ -379,7 +379,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_number_of_samples(actual_number_of_samples); + response->set_actual_number_of_samples(actual_number_of_samples); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -403,7 +403,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_boolean(a_boolean); + response->set_a_boolean(a_boolean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -427,7 +427,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_number(a_number); + response->set_a_number(a_number); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -451,8 +451,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_string(a_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); + response->set_a_string(a_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -474,15 +474,15 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - if (flags & 0x1) - response->add_flags_array(Bitfield::BITFIELD_FLAG_A); - if (flags & 0x2) - response->add_flags_array(Bitfield::BITFIELD_FLAG_B); - if (flags & 0x4) - response->add_flags_array(Bitfield::BITFIELD_FLAG_C); - if (flags & 0x8) - response->add_flags_array(Bitfield::BITFIELD_FLAG_D); - response->set_flags_raw(flags); + if (flags & 0x1) + response->add_flags_array(Bitfield::BITFIELD_FLAG_A); + if (flags & 0x2) + response->add_flags_array(Bitfield::BITFIELD_FLAG_B); + if (flags & 0x4) + response->add_flags_array(Bitfield::BITFIELD_FLAG_C); + if (flags & 0x8) + response->add_flags_array(Bitfield::BITFIELD_FLAG_D); + response->set_flags_raw(flags); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -521,8 +521,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_string(a_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); + response->set_a_string(a_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); return ::grpc::Status::OK; } } @@ -591,8 +591,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_array_out()->Resize(actual_size, 0); - response->set_actual_size(actual_size); + response->mutable_array_out()->Resize(actual_size, 0); + response->set_actual_size(actual_size); return ::grpc::Status::OK; } } @@ -628,15 +628,15 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(array_out, response->mutable_array_out()); - { - auto shrunk_size = actual_size; - auto current_size = response->mutable_array_out()->size(); - if (shrunk_size != current_size) { - response->mutable_array_out()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(array_out, response->mutable_array_out()); + { + auto shrunk_size = actual_size; + auto current_size = response->mutable_array_out()->size(); + if (shrunk_size != current_size) { + response->mutable_array_out()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_size(actual_size); + } + response->set_actual_size(actual_size); return ::grpc::Status::OK; } } @@ -673,8 +673,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_array_out()->Resize(actual_size, 0); - response->set_actual_size(actual_size); + response->mutable_array_out()->Resize(actual_size, 0); + response->set_actual_size(actual_size); return ::grpc::Status::OK; } } @@ -708,9 +708,9 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->set_array_out(array_out); - response->mutable_array_out()->resize(actual_size); - response->set_actual_size(actual_size); + response->set_array_out(array_out); + response->mutable_array_out()->resize(actual_size); + response->set_actual_size(actual_size); return ::grpc::Status::OK; } } @@ -747,9 +747,9 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->set_array_out(array_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_array_out())); - response->set_actual_size(actual_size); + response->set_array_out(array_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_array_out())); + response->set_actual_size(actual_size); return ::grpc::Status::OK; } } @@ -786,9 +786,9 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->set_string_out(string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); - response->set_actual_size(actual_size); + response->set_string_out(string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); + response->set_actual_size(actual_size); return ::grpc::Status::OK; } } @@ -813,7 +813,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_size_out(size_out); + response->set_size_out(size_out); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -875,8 +875,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - CopyBytesToEnums(u_int8_enum_array, response->mutable_u_int8_enum_array()); - response->set_u_int8_enum_array_raw(u_int8_enum_array); + CopyBytesToEnums(u_int8_enum_array, response->mutable_u_int8_enum_array()); + response->set_u_int8_enum_array_raw(u_int8_enum_array); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -902,7 +902,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -928,7 +928,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -954,7 +954,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -980,7 +980,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1005,8 +1005,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(session_out); - response->mutable_session_out()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(session_out); + response->mutable_session_out()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1047,8 +1047,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); + response->set_attribute_value(attribute_value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); return ::grpc::Status::OK; } } @@ -1078,11 +1078,11 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_month(month); - response->set_day(day); - response->set_year(year); - response->set_hour(hour); - response->set_minute(minute); + response->set_month(month); + response->set_day(day); + response->set_year(year); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1106,7 +1106,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_months(months); + response->set_months(months); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1130,7 +1130,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(cs, response->mutable_cs()); + convert_to_grpc(cs, response->mutable_cs()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1155,7 +1155,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(cs, response->mutable_cs()); + convert_to_grpc(cs, response->mutable_cs()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1180,9 +1180,9 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_quantity(a_quantity); - response->set_a_turtle(static_cast(a_turtle)); - response->set_a_turtle_raw(a_turtle); + response->set_a_quantity(a_quantity); + response->set_a_turtle(static_cast(a_turtle)); + response->set_a_turtle_raw(a_turtle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1206,7 +1206,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_uint8_number(a_uint8_number); + response->set_a_uint8_number(a_uint8_number); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1314,7 +1314,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1349,7 +1349,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1403,7 +1403,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1677,7 +1677,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_reading(reading); + response->set_reading(reading); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1710,8 +1710,8 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_data()->Resize(buffer_size, 0); - response->set_buffer_size(buffer_size); + response->mutable_data()->Resize(buffer_size, 0); + response->set_buffer_size(buffer_size); return ::grpc::Status::OK; } } @@ -1750,10 +1750,10 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_array_out()->Resize(actual_size, 0); - response->set_actual_size(actual_size); - response->mutable_other_array_out()->Resize(other_actual_size, 0); - response->set_other_actual_size(other_actual_size); + response->mutable_array_out()->Resize(actual_size, 0); + response->set_actual_size(actual_size); + response->mutable_other_array_out()->Resize(other_actual_size, 0); + response->set_other_actual_size(other_actual_size); return ::grpc::Status::OK; } } @@ -1780,7 +1780,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_reading(reading); + response->set_reading(reading); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1805,9 +1805,9 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_number(a_number); - response->set_a_string(a_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); + response->set_a_number(a_number); + response->set_a_string(a_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1831,7 +1831,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_timedelta(timedelta); + response->set_timedelta(timedelta); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1904,19 +1904,19 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_a_boolean(a_boolean); - response->set_an_int32(an_int32); - response->set_an_int64(an_int64); - response->set_an_int_enum(static_cast(an_int_enum)); - response->set_an_int_enum_raw(an_int_enum); - response->set_a_float(a_float); - auto a_float_enum_omap_it = floatenum_output_map_.find(a_float_enum); - if(a_float_enum_omap_it != floatenum_output_map_.end()) { - response->set_a_float_enum_mapped(static_cast(a_float_enum_omap_it->second)); - } - response->set_a_float_enum_raw(a_float_enum); - response->set_a_string(a_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); + response->set_a_boolean(a_boolean); + response->set_an_int32(an_int32); + response->set_an_int64(an_int64); + response->set_an_int_enum(static_cast(an_int_enum)); + response->set_an_int_enum_raw(an_int_enum); + response->set_a_float(a_float); + auto a_float_enum_omap_it = floatenum_output_map_.find(a_float_enum); + if(a_float_enum_omap_it != floatenum_output_map_.end()) { + response->set_a_float_enum_mapped(static_cast(a_float_enum_omap_it->second)); + } + response->set_a_float_enum_raw(a_float_enum); + response->set_a_string(a_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_a_string())); return ::grpc::Status::OK; } } @@ -2055,7 +2055,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_output(output); + response->set_output(output); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2175,7 +2175,7 @@ namespace nifake_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_an_array(an_array); + response->set_an_array(an_array); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nifake_non_ivi/nifake_non_ivi_service.cpp b/generated/nifake_non_ivi/nifake_non_ivi_service.cpp index 359ee79e8..a5e375bf8 100644 --- a/generated/nifake_non_ivi/nifake_non_ivi_service.cpp +++ b/generated/nifake_non_ivi/nifake_non_ivi_service.cpp @@ -160,8 +160,8 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->set_message(message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_message())); + response->set_message(message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_message())); return ::grpc::Status::OK; } } @@ -185,8 +185,8 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->set_string_out(string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); + response->set_string_out(string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_string_out())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -229,7 +229,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, handle); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -272,13 +272,13 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, handle); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_value(checked_convert_value(value)); - response->set_value_raw(value); + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_value(checked_convert_value(value)); + response->set_value_raw(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -322,11 +322,11 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, handle); } response->set_status(status); - auto checked_convert_value = [](auto raw_value) { - bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_value = [](auto raw_value) { + bool raw_value_is_valid = nifake_non_ivi_grpc::MarbleInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_value()->Clear(); response->mutable_value()->Reserve(10); std::transform( @@ -366,7 +366,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_handle()->set_id(session_id); + response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -401,7 +401,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_handle()->set_id(session_id); + response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -442,7 +442,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_handle()->set_id(session_id); + response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -475,7 +475,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_secondary_session_handle()->set_id(session_id); + response->mutable_secondary_session_handle()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -509,7 +509,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_handle()->set_id(session_id); + response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -543,7 +543,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_handle()->set_id(session_id); + response->mutable_handle()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -744,7 +744,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->set_u8_data(u8_data); + response->set_u8_data(u8_data); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -769,7 +769,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - response->mutable_i32_data()->Resize(array_size_copy, 0); + response->mutable_i32_data()->Resize(array_size_copy, 0); response->mutable_u16_data()->Clear(); response->mutable_u16_data()->Reserve(array_size_copy); std::transform( @@ -809,7 +809,7 @@ namespace nifake_non_ivi_grpc { [this](myInt16 data_out) { RegisterCallbackResponse callback_response; auto response = &callback_response; - response->set_data_out(data_out); + response->set_data_out(data_out); queue_write(callback_response); return 0; }); @@ -875,7 +875,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - convert_to_grpc(when, response->mutable_when()); + convert_to_grpc(when, response->mutable_when()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -966,9 +966,9 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - for (int i = 0; i < colorVector.size(); ++i) { - response->add_colors(static_cast(colorVector[i])); - } + for (int i = 0; i < colorVector.size(); ++i) { + response->add_colors(static_cast(colorVector[i])); + } return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1214,7 +1214,7 @@ namespace nifake_non_ivi_grpc { return ConvertApiErrorStatusForFakeHandle(status, 0); } response->set_status(status); - convert_to_grpc(structs, response->mutable_structs()); + convert_to_grpc(structs, response->mutable_structs()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nifgen/nifgen_service.cpp b/generated/nifgen/nifgen_service.cpp index d529d310e..a75dc5fe8 100644 --- a/generated/nifgen/nifgen_service.cpp +++ b/generated/nifgen/nifgen_service.cpp @@ -133,7 +133,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1256,7 +1256,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_sequence_handle(sequence_handle); + response->set_sequence_handle(sequence_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1310,7 +1310,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_frequency_list_handle(frequency_list_handle); + response->set_frequency_list_handle(frequency_list_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1337,7 +1337,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1364,7 +1364,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1406,7 +1406,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1434,7 +1434,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1467,7 +1467,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1509,7 +1509,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_handle(waveform_handle); + response->set_waveform_handle(waveform_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1813,8 +1813,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1839,8 +1839,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1865,9 +1865,9 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_code(error_code); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1993,7 +1993,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2019,7 +2019,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2045,7 +2045,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2071,7 +2071,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2097,8 +2097,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(attribute_value); - response->mutable_attribute_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(attribute_value); + response->mutable_attribute_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2139,8 +2139,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); + response->set_attribute_value(attribute_value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); return ::grpc::Status::OK; } } @@ -2181,8 +2181,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_channel_string(channel_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); + response->set_channel_string(channel_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); return ::grpc::Status::OK; } } @@ -2223,9 +2223,9 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2254,11 +2254,11 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2282,7 +2282,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2306,7 +2306,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_months(months); + response->set_months(months); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2343,8 +2343,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_coefficients_array()->Resize(number_of_coefficients_read, 0); - response->set_number_of_coefficients_read(number_of_coefficients_read); + response->mutable_coefficients_array()->Resize(number_of_coefficients_read, 0); + response->set_number_of_coefficients_read(number_of_coefficients_read); return ::grpc::Status::OK; } } @@ -2369,8 +2369,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_state(static_cast(state)); - response->set_state_raw(state); + response->set_state(static_cast(state)); + response->set_state_raw(state); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2409,8 +2409,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_coercion_record(coercion_record); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); + response->set_coercion_record(coercion_record); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); return ::grpc::Status::OK; } } @@ -2450,8 +2450,8 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_interchange_warning(interchange_warning); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); + response->set_interchange_warning(interchange_warning); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); return ::grpc::Status::OK; } } @@ -2480,11 +2480,11 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2508,7 +2508,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2532,7 +2532,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_cal_supported(self_cal_supported); + response->set_self_cal_supported(self_cal_supported); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2557,7 +2557,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_reader_handle(reader_handle); + response->set_reader_handle(reader_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2637,7 +2637,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2674,7 +2674,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2711,7 +2711,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2782,7 +2782,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_done(done); + response->set_done(done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2832,10 +2832,10 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_maximum_number_of_sequences(maximum_number_of_sequences); - response->set_minimum_sequence_length(minimum_sequence_length); - response->set_maximum_sequence_length(maximum_sequence_length); - response->set_maximum_loop_count(maximum_loop_count); + response->set_maximum_number_of_sequences(maximum_number_of_sequences); + response->set_minimum_sequence_length(minimum_sequence_length); + response->set_maximum_sequence_length(maximum_sequence_length); + response->set_maximum_loop_count(maximum_loop_count); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2862,10 +2862,10 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_maximum_number_of_waveforms(maximum_number_of_waveforms); - response->set_waveform_quantum(waveform_quantum); - response->set_minimum_waveform_size(minimum_waveform_size); - response->set_maximum_waveform_size(maximum_waveform_size); + response->set_maximum_number_of_waveforms(maximum_number_of_waveforms); + response->set_waveform_quantum(waveform_quantum); + response->set_minimum_waveform_size(minimum_waveform_size); + response->set_maximum_waveform_size(maximum_waveform_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2894,12 +2894,12 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_maximum_number_of_freq_lists(maximum_number_of_freq_lists); - response->set_minimum_frequency_list_length(minimum_frequency_list_length); - response->set_maximum_frequency_list_length(maximum_frequency_list_length); - response->set_minimum_frequency_list_duration(minimum_frequency_list_duration); - response->set_maximum_frequency_list_duration(maximum_frequency_list_duration); - response->set_frequency_list_duration_quantum(frequency_list_duration_quantum); + response->set_maximum_number_of_freq_lists(maximum_number_of_freq_lists); + response->set_minimum_frequency_list_length(minimum_frequency_list_length); + response->set_maximum_frequency_list_length(maximum_frequency_list_length); + response->set_minimum_frequency_list_duration(minimum_frequency_list_duration); + response->set_maximum_frequency_list_duration(maximum_frequency_list_duration); + response->set_frequency_list_duration_quantum(frequency_list_duration_quantum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2923,7 +2923,7 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3060,10 +3060,10 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_instrument_driver_revision(instrument_driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_instrument_driver_revision(instrument_driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3165,9 +3165,9 @@ namespace nifgen_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp b/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp index 4b11302e8..87a7f6ad2 100644 --- a/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp +++ b/generated/nirfmxbluetooth/nirfmxbluetooth_service.cpp @@ -77,7 +77,7 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -116,7 +116,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->ACPCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -140,7 +140,7 @@ namespace nirfmxbluetooth_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->ACPCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -179,7 +179,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->ACPCfgOffsetChannelMode(instrument, selector_string, offset_channel_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -207,7 +207,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ACPFetchAbsolutePowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_power()->Resize(actual_array_size, 0); float32* absolute_power = response->mutable_absolute_power()->mutable_data(); @@ -218,13 +218,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_absolute_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_absolute_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -251,7 +251,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ACPFetchMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_limit_with_exception_mask()->Resize(actual_array_size, 0); float32* limit_with_exception_mask = response->mutable_limit_with_exception_mask()->mutable_data(); @@ -264,14 +264,14 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_limit_with_exception_mask()->Resize(actual_array_size, 0); - response->mutable_limit_without_exception_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_limit_with_exception_mask()->Resize(actual_array_size, 0); + response->mutable_limit_without_exception_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -295,11 +295,11 @@ namespace nirfmxbluetooth_grpc { int32 measurement_status {}; auto status = library_->ACPFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -327,15 +327,15 @@ namespace nirfmxbluetooth_grpc { float64 upper_margin {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_absolute_power, &upper_absolute_power, &lower_relative_power, &upper_relative_power, &lower_margin, &upper_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_lower_absolute_power(lower_absolute_power); - response->set_upper_absolute_power(upper_absolute_power); - response->set_lower_relative_power(lower_relative_power); - response->set_upper_relative_power(upper_relative_power); - response->set_lower_margin(lower_margin); - response->set_upper_margin(upper_margin); + response->set_lower_absolute_power(lower_absolute_power); + response->set_upper_absolute_power(upper_absolute_power); + response->set_lower_relative_power(lower_relative_power); + response->set_upper_relative_power(upper_relative_power); + response->set_lower_margin(lower_margin); + response->set_upper_margin(upper_margin); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -359,7 +359,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); float64* lower_absolute_power = response->mutable_lower_absolute_power()->mutable_data(); @@ -380,16 +380,16 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); - response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); - response->mutable_lower_relative_power()->Resize(actual_array_size, 0); - response->mutable_upper_relative_power()->Resize(actual_array_size, 0); - response->mutable_lower_margin()->Resize(actual_array_size, 0); - response->mutable_upper_margin()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); + response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); + response->mutable_upper_relative_power()->Resize(actual_array_size, 0); + response->mutable_lower_margin()->Resize(actual_array_size, 0); + response->mutable_upper_margin()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -413,10 +413,10 @@ namespace nirfmxbluetooth_grpc { float64 reference_channel_power {}; auto status = library_->ACPFetchReferenceChannelPower(instrument, selector_string, timeout, &reference_channel_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_channel_power(reference_channel_power); + response->set_reference_channel_power(reference_channel_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -442,7 +442,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -453,13 +453,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -481,7 +481,7 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -511,7 +511,7 @@ namespace nirfmxbluetooth_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -535,7 +535,7 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); auto status = library_->AutoDetectSignal(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -560,10 +560,10 @@ namespace nirfmxbluetooth_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_level(reference_level); + response->set_reference_level(reference_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -585,7 +585,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -599,11 +599,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -626,7 +626,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -640,11 +640,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -667,7 +667,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->BuildSlotString(selector_string, slot_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -681,11 +681,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -708,7 +708,7 @@ namespace nirfmxbluetooth_grpc { int32 channel_number = request->channel_number(); auto status = library_->CfgChannelNumber(instrument, selector_string, channel_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -732,7 +732,7 @@ namespace nirfmxbluetooth_grpc { int32 data_rate = request->data_rate(); auto status = library_->CfgDataRate(instrument, selector_string, data_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -774,7 +774,7 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -798,7 +798,7 @@ namespace nirfmxbluetooth_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -822,7 +822,7 @@ namespace nirfmxbluetooth_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -862,7 +862,7 @@ namespace nirfmxbluetooth_grpc { int32 channel_number = request->channel_number(); auto status = library_->CfgFrequencyChannelNumber(instrument, selector_string, standard, channel_number); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -906,7 +906,7 @@ namespace nirfmxbluetooth_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -982,7 +982,7 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1023,7 +1023,7 @@ namespace nirfmxbluetooth_grpc { float64 cte_slot_duration = request->cte_slot_duration(); auto status = library_->CfgLEDirectionFinding(instrument, selector_string, direction_finding_mode, cte_length, cte_slot_duration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1063,7 +1063,7 @@ namespace nirfmxbluetooth_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1102,7 +1102,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->CfgPacketType(instrument, selector_string, packet_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1141,7 +1141,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->CfgPayloadBitPattern(instrument, selector_string, payload_bit_pattern); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1181,7 +1181,7 @@ namespace nirfmxbluetooth_grpc { int32 payload_length = request->payload_length(); auto status = library_->CfgPayloadLength(instrument, selector_string, payload_length_mode, payload_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1207,7 +1207,7 @@ namespace nirfmxbluetooth_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1247,7 +1247,7 @@ namespace nirfmxbluetooth_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1271,7 +1271,7 @@ namespace nirfmxbluetooth_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1296,7 +1296,7 @@ namespace nirfmxbluetooth_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1320,10 +1320,10 @@ namespace nirfmxbluetooth_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1344,7 +1344,7 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1367,7 +1367,7 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1391,7 +1391,7 @@ namespace nirfmxbluetooth_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1415,7 +1415,7 @@ namespace nirfmxbluetooth_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1438,7 +1438,7 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1461,7 +1461,7 @@ namespace nirfmxbluetooth_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1484,7 +1484,7 @@ namespace nirfmxbluetooth_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1507,7 +1507,7 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1547,7 +1547,7 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->FrequencyRangeCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1571,7 +1571,7 @@ namespace nirfmxbluetooth_grpc { float64 span = request->span(); auto status = library_->FrequencyRangeCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1597,11 +1597,11 @@ namespace nirfmxbluetooth_grpc { float64 low_frequency {}; auto status = library_->FrequencyRangeFetchMeasurement(instrument, selector_string, timeout, &high_frequency, &low_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_high_frequency(high_frequency); - response->set_low_frequency(low_frequency); + response->set_high_frequency(high_frequency); + response->set_low_frequency(low_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1627,7 +1627,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->FrequencyRangeFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -1638,13 +1638,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1669,7 +1669,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string result_names; if (actual_result_names_size > 0) { @@ -1682,13 +1682,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_actual_result_names_size(actual_result_names_size); - response->set_default_result_exists(default_result_exists); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_actual_result_names_size(actual_result_names_size); + response->set_default_result_exists(default_result_exists); return ::grpc::Status::OK; } } @@ -1712,10 +1712,10 @@ namespace nirfmxbluetooth_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1739,7 +1739,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -1750,11 +1750,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1778,10 +1778,10 @@ namespace nirfmxbluetooth_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1805,7 +1805,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -1816,11 +1816,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1844,10 +1844,10 @@ namespace nirfmxbluetooth_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1870,16 +1870,16 @@ namespace nirfmxbluetooth_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_attr_val(checked_convert_attr_val(attr_val)); - response->set_attr_val_raw(attr_val); + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_attr_val(checked_convert_attr_val(attr_val)); + response->set_attr_val_raw(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1903,7 +1903,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); @@ -1914,14 +1914,14 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxbluetooth_grpc::NiRFmxBluetoothInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -1931,8 +1931,8 @@ namespace nirfmxbluetooth_grpc { [&](auto x) { return checked_convert_attr_val(x); }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1956,10 +1956,10 @@ namespace nirfmxbluetooth_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1983,7 +1983,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -1994,11 +1994,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2022,10 +2022,10 @@ namespace nirfmxbluetooth_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2049,7 +2049,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; @@ -2059,7 +2059,7 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_attr_val()->Clear(); @@ -2071,8 +2071,8 @@ namespace nirfmxbluetooth_grpc { [&](auto x) { return x; }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2097,7 +2097,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; @@ -2107,18 +2107,18 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2143,7 +2143,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -2153,18 +2153,18 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2189,7 +2189,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -2203,11 +2203,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -2231,10 +2231,10 @@ namespace nirfmxbluetooth_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2257,10 +2257,10 @@ namespace nirfmxbluetooth_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2284,7 +2284,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -2295,11 +2295,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2324,7 +2324,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -2335,11 +2335,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2363,10 +2363,10 @@ namespace nirfmxbluetooth_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2390,7 +2390,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; @@ -2400,12 +2400,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - response->mutable_attr_val()->resize(actual_array_size); - response->set_actual_array_size(actual_array_size); + response->set_attr_val(attr_val); + response->mutable_attr_val()->resize(actual_array_size); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2428,7 +2428,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -2443,12 +2443,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2472,7 +2472,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -2486,11 +2486,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2521,11 +2521,11 @@ namespace nirfmxbluetooth_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXBT_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); - response->set_is_new_session(is_new_session); + response->mutable_instrument()->set_id(session_id); + response->set_is_new_session(is_new_session); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2557,10 +2557,10 @@ namespace nirfmxbluetooth_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXBT_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2585,7 +2585,7 @@ namespace nirfmxbluetooth_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2625,7 +2625,7 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2664,7 +2664,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->ModAccCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2690,7 +2690,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -2700,18 +2700,18 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(constellation, response->mutable_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(constellation, response->mutable_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2737,12 +2737,12 @@ namespace nirfmxbluetooth_grpc { float64 ninetynine_percent_devm {}; auto status = library_->ModAccFetchDEVM(instrument, selector_string, timeout, &peak_rms_devm_maximum, &peak_devm_maximum, &ninetynine_percent_devm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_peak_rms_devm_maximum(peak_rms_devm_maximum); - response->set_peak_devm_maximum(peak_devm_maximum); - response->set_ninetynine_percent_devm(ninetynine_percent_devm); + response->set_peak_rms_devm_maximum(peak_rms_devm_maximum); + response->set_peak_devm_maximum(peak_devm_maximum); + response->set_ninetynine_percent_devm(ninetynine_percent_devm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2766,11 +2766,11 @@ namespace nirfmxbluetooth_grpc { float64 peak_rms_magnitude_error_maximum {}; auto status = library_->ModAccFetchDEVMMagnitudeError(instrument, selector_string, timeout, &average_rms_magnitude_error_mean, &peak_rms_magnitude_error_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_rms_magnitude_error_mean(average_rms_magnitude_error_mean); - response->set_peak_rms_magnitude_error_maximum(peak_rms_magnitude_error_maximum); + response->set_average_rms_magnitude_error_mean(average_rms_magnitude_error_mean); + response->set_peak_rms_magnitude_error_maximum(peak_rms_magnitude_error_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2794,7 +2794,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchDEVMPerSymbolTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); float32* devm_per_symbol = response->mutable_devm_per_symbol()->mutable_data(); @@ -2805,11 +2805,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_devm_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2834,11 +2834,11 @@ namespace nirfmxbluetooth_grpc { float64 peak_rms_phase_error_maximum {}; auto status = library_->ModAccFetchDEVMPhaseError(instrument, selector_string, timeout, &average_rms_phase_error_mean, &peak_rms_phase_error_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_rms_phase_error_mean(average_rms_phase_error_mean); - response->set_peak_rms_phase_error_maximum(peak_rms_phase_error_maximum); + response->set_average_rms_phase_error_mean(average_rms_phase_error_mean); + response->set_peak_rms_phase_error_maximum(peak_rms_phase_error_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2862,7 +2862,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchDemodulatedBitTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector demodulated_bits(actual_array_size); auto array_size = actual_array_size; @@ -2872,7 +2872,7 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_demodulated_bits()->Clear(); @@ -2884,8 +2884,8 @@ namespace nirfmxbluetooth_grpc { [&](auto x) { return x; }); - response->mutable_demodulated_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_demodulated_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2910,11 +2910,11 @@ namespace nirfmxbluetooth_grpc { float64 df1avg_minimum {}; auto status = library_->ModAccFetchDf1(instrument, selector_string, timeout, &df1avg_maximum, &df1avg_minimum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_df1avg_maximum(df1avg_maximum); - response->set_df1avg_minimum(df1avg_minimum); + response->set_df1avg_maximum(df1avg_maximum); + response->set_df1avg_minimum(df1avg_minimum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2938,7 +2938,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchDf1maxTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); @@ -2951,12 +2951,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_time()->Resize(actual_array_size, 0); - response->mutable_df1max()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_time()->Resize(actual_array_size, 0); + response->mutable_df1max()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2981,11 +2981,11 @@ namespace nirfmxbluetooth_grpc { float64 percentage_of_symbols_above_df2max_threshold {}; auto status = library_->ModAccFetchDf2(instrument, selector_string, timeout, &df2avg_minimum, &percentage_of_symbols_above_df2max_threshold); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_df2avg_minimum(df2avg_minimum); - response->set_percentage_of_symbols_above_df2max_threshold(percentage_of_symbols_above_df2max_threshold); + response->set_df2avg_minimum(df2avg_minimum); + response->set_percentage_of_symbols_above_df2max_threshold(percentage_of_symbols_above_df2max_threshold); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3009,7 +3009,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchDf2maxTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); @@ -3022,12 +3022,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_time()->Resize(actual_array_size, 0); - response->mutable_df2max()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_time()->Resize(actual_array_size, 0); + response->mutable_df2max()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3053,12 +3053,12 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_drift_rate_maximum {}; auto status = library_->ModAccFetchFrequencyErrorBR(instrument, selector_string, timeout, &initial_frequency_error_maximum, &peak_frequency_drift_maximum, &peak_frequency_drift_rate_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_initial_frequency_error_maximum(initial_frequency_error_maximum); - response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); - response->set_peak_frequency_drift_rate_maximum(peak_frequency_drift_rate_maximum); + response->set_initial_frequency_error_maximum(initial_frequency_error_maximum); + response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); + response->set_peak_frequency_drift_rate_maximum(peak_frequency_drift_rate_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3083,12 +3083,12 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_error_w0_maximum {}; auto status = library_->ModAccFetchFrequencyErrorEDR(instrument, selector_string, timeout, &header_frequency_error_wi_maximum, &peak_frequency_error_wi_plus_w0_maximum, &peak_frequency_error_w0_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_header_frequency_error_wi_maximum(header_frequency_error_wi_maximum); - response->set_peak_frequency_error_wi_plus_w0_maximum(peak_frequency_error_wi_plus_w0_maximum); - response->set_peak_frequency_error_w0_maximum(peak_frequency_error_w0_maximum); + response->set_header_frequency_error_wi_maximum(header_frequency_error_wi_maximum); + response->set_peak_frequency_error_wi_plus_w0_maximum(peak_frequency_error_wi_plus_w0_maximum); + response->set_peak_frequency_error_w0_maximum(peak_frequency_error_w0_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3114,13 +3114,13 @@ namespace nirfmxbluetooth_grpc { float64 peak_frequency_drift_rate_maximum {}; auto status = library_->ModAccFetchFrequencyErrorLE(instrument, selector_string, timeout, &peak_frequency_error_maximum, &initial_frequency_drift_maximum, &peak_frequency_drift_maximum, &peak_frequency_drift_rate_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_peak_frequency_error_maximum(peak_frequency_error_maximum); - response->set_initial_frequency_drift_maximum(initial_frequency_drift_maximum); - response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); - response->set_peak_frequency_drift_rate_maximum(peak_frequency_drift_rate_maximum); + response->set_peak_frequency_error_maximum(peak_frequency_error_maximum); + response->set_initial_frequency_drift_maximum(initial_frequency_drift_maximum); + response->set_peak_frequency_drift_maximum(peak_frequency_drift_maximum); + response->set_peak_frequency_drift_rate_maximum(peak_frequency_drift_rate_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3144,7 +3144,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchFrequencyErrorTraceBR(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); @@ -3157,12 +3157,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_time()->Resize(actual_array_size, 0); - response->mutable_frequency_error()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_time()->Resize(actual_array_size, 0); + response->mutable_frequency_error()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3187,7 +3187,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchFrequencyErrorTraceLE(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); @@ -3200,12 +3200,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_time()->Resize(actual_array_size, 0); - response->mutable_frequency_error()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_time()->Resize(actual_array_size, 0); + response->mutable_frequency_error()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3230,7 +3230,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchFrequencyErrorWiPlusW0TraceEDR(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_time()->Resize(actual_array_size, 0); float32* time = response->mutable_time()->mutable_data(); @@ -3243,12 +3243,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_time()->Resize(actual_array_size, 0); - response->mutable_frequency_error_wi_plus_w0()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_time()->Resize(actual_array_size, 0); + response->mutable_frequency_error_wi_plus_w0()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3275,7 +3275,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchFrequencyTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); @@ -3286,13 +3286,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_frequency()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_frequency()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3317,7 +3317,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->ModAccFetchRMSDEVMTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_devm()->Resize(actual_array_size, 0); float32* rms_devm = response->mutable_rms_devm()->mutable_data(); @@ -3328,11 +3328,11 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_rms_devm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_rms_devm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3355,7 +3355,7 @@ namespace nirfmxbluetooth_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3378,7 +3378,7 @@ namespace nirfmxbluetooth_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3418,7 +3418,7 @@ namespace nirfmxbluetooth_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3440,7 +3440,7 @@ namespace nirfmxbluetooth_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3465,7 +3465,7 @@ namespace nirfmxbluetooth_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3491,7 +3491,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3516,7 +3516,7 @@ namespace nirfmxbluetooth_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3542,7 +3542,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3576,7 +3576,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3619,7 +3619,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3653,7 +3653,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3678,7 +3678,7 @@ namespace nirfmxbluetooth_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3704,7 +3704,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3738,7 +3738,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3784,7 +3784,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3813,7 +3813,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3839,7 +3839,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3883,7 +3883,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3917,7 +3917,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3945,7 +3945,7 @@ namespace nirfmxbluetooth_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3971,7 +3971,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3997,7 +3997,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4022,7 +4022,7 @@ namespace nirfmxbluetooth_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4048,7 +4048,7 @@ namespace nirfmxbluetooth_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4088,7 +4088,7 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4127,7 +4127,7 @@ namespace nirfmxbluetooth_grpc { auto status = library_->TXPCfgBurstSynchronizationType(instrument, selector_string, burst_synchronization_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4154,12 +4154,12 @@ namespace nirfmxbluetooth_grpc { float64 edr_dpsk_gfsk_average_power_ratio_mean {}; auto status = library_->TXPFetchEDRPowers(instrument, selector_string, timeout, &edr_gfsk_average_power_mean, &edr_dpsk_average_power_mean, &edr_dpsk_gfsk_average_power_ratio_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_edr_gfsk_average_power_mean(edr_gfsk_average_power_mean); - response->set_edr_dpsk_average_power_mean(edr_dpsk_average_power_mean); - response->set_edr_dpsk_gfsk_average_power_ratio_mean(edr_dpsk_gfsk_average_power_ratio_mean); + response->set_edr_gfsk_average_power_mean(edr_gfsk_average_power_mean); + response->set_edr_dpsk_average_power_mean(edr_dpsk_average_power_mean); + response->set_edr_dpsk_gfsk_average_power_ratio_mean(edr_dpsk_gfsk_average_power_ratio_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4183,11 +4183,11 @@ namespace nirfmxbluetooth_grpc { float64 reference_period_peak_absolute_power_deviation_maximum {}; auto status = library_->TXPFetchLECTEReferencePeriodPowers(instrument, selector_string, timeout, &reference_period_average_power_mean, &reference_period_peak_absolute_power_deviation_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_period_average_power_mean(reference_period_average_power_mean); - response->set_reference_period_peak_absolute_power_deviation_maximum(reference_period_peak_absolute_power_deviation_maximum); + response->set_reference_period_average_power_mean(reference_period_average_power_mean); + response->set_reference_period_peak_absolute_power_deviation_maximum(reference_period_peak_absolute_power_deviation_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4211,11 +4211,11 @@ namespace nirfmxbluetooth_grpc { float64 transmit_slot_peak_absolute_power_deviation_maximum {}; auto status = library_->TXPFetchLECTETransmitSlotPowers(instrument, selector_string, timeout, &transmit_slot_average_power_mean, &transmit_slot_peak_absolute_power_deviation_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_transmit_slot_average_power_mean(transmit_slot_average_power_mean); - response->set_transmit_slot_peak_absolute_power_deviation_maximum(transmit_slot_peak_absolute_power_deviation_maximum); + response->set_transmit_slot_average_power_mean(transmit_slot_average_power_mean); + response->set_transmit_slot_peak_absolute_power_deviation_maximum(transmit_slot_peak_absolute_power_deviation_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4239,7 +4239,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->TXPFetchLECTETransmitSlotPowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); float64* transmit_slot_average_power_mean = response->mutable_transmit_slot_average_power_mean()->mutable_data(); @@ -4252,12 +4252,12 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); - response->mutable_transmit_slot_peak_absolute_power_deviation_maximum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_transmit_slot_average_power_mean()->Resize(actual_array_size, 0); + response->mutable_transmit_slot_peak_absolute_power_deviation_maximum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4284,7 +4284,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); @@ -4295,13 +4295,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4328,13 +4328,13 @@ namespace nirfmxbluetooth_grpc { float64 peak_to_average_power_ratio_maximum {}; auto status = library_->TXPFetchPowers(instrument, selector_string, timeout, &average_power_mean, &average_power_maximum, &average_power_minimum, &peak_to_average_power_ratio_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_power_mean(average_power_mean); - response->set_average_power_maximum(average_power_maximum); - response->set_average_power_minimum(average_power_minimum); - response->set_peak_to_average_power_ratio_maximum(peak_to_average_power_ratio_maximum); + response->set_average_power_mean(average_power_mean); + response->set_average_power_maximum(average_power_maximum); + response->set_average_power_minimum(average_power_minimum); + response->set_peak_to_average_power_ratio_maximum(peak_to_average_power_ratio_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4372,7 +4372,7 @@ namespace nirfmxbluetooth_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TwentydBBandwidthCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4400,13 +4400,13 @@ namespace nirfmxbluetooth_grpc { float64 low_frequency {}; auto status = library_->TwentydBBandwidthFetchMeasurement(instrument, selector_string, timeout, &peak_power, &bandwidth, &high_frequency, &low_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_peak_power(peak_power); - response->set_bandwidth(bandwidth); - response->set_high_frequency(high_frequency); - response->set_low_frequency(low_frequency); + response->set_peak_power(peak_power); + response->set_bandwidth(bandwidth); + response->set_high_frequency(high_frequency); + response->set_low_frequency(low_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4432,7 +4432,7 @@ namespace nirfmxbluetooth_grpc { while (true) { auto status = library_->TwentydBBandwidthFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -4443,13 +4443,13 @@ namespace nirfmxbluetooth_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4471,7 +4471,7 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4495,7 +4495,7 @@ namespace nirfmxbluetooth_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nirfmxbluetooth/nirfmxbluetooth_service.h b/generated/nirfmxbluetooth/nirfmxbluetooth_service.h index be83ebd76..79f990cf0 100644 --- a/generated/nirfmxbluetooth/nirfmxbluetooth_service.h +++ b/generated/nirfmxbluetooth/nirfmxbluetooth_service.h @@ -178,7 +178,7 @@ class NiRFmxBluetoothService final : public NiRFmxBluetooth::Service { NiRFmxBluetoothLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; std::map frequencyreferencesource_output_map_ { {"OnboardClock", 1},{"RefIn", 2},{"PXI_Clk", 3},{"ClkIn", 4}, }; std::map nirfmxbluetoothstringattributevaluesmapped_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; diff --git a/generated/nirfmxinstr/nirfmxinstr_service.cpp b/generated/nirfmxinstr/nirfmxinstr_service.cpp index ce86897df..c3bb6bbd2 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.cpp +++ b/generated/nirfmxinstr/nirfmxinstr_service.cpp @@ -60,7 +60,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildCalibrationPlaneString(calibration_plane_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -74,11 +74,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -101,7 +101,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildInstrumentString(selector_string, instrument_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -115,11 +115,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -142,7 +142,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildLOString(selector_string, lo_index, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -156,11 +156,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -183,7 +183,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->BuildModuleString(selector_string, module_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -197,11 +197,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -240,7 +240,7 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgExternalAttenuationInterpolationLinear(instrument, selector_string, table_name, format); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -264,7 +264,7 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->CfgExternalAttenuationInterpolationNearest(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -288,7 +288,7 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->CfgExternalAttenuationInterpolationSpline(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -331,7 +331,7 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgExternalAttenuationTable(instrument, selector_string, table_name, frequency, external_attenuation, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -375,7 +375,7 @@ namespace nirfmxinstr_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -415,7 +415,7 @@ namespace nirfmxinstr_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -455,7 +455,7 @@ namespace nirfmxinstr_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -500,7 +500,7 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgSParameterExternalAttenuationTable(instrument, selector_string, table_name, frequency, frequency_array_size, s_parameters.data(), s_parameter_table_size, number_of_ports, s_parameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -539,7 +539,7 @@ namespace nirfmxinstr_grpc { auto status = library_->CfgSParameterExternalAttenuationType(instrument, selector_string, s_parameter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -562,10 +562,10 @@ namespace nirfmxinstr_grpc { int32 acquisition_done {}; auto status = library_->CheckAcquisitionStatus(instrument, &acquisition_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_acquisition_done(acquisition_done); + response->set_acquisition_done(acquisition_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -588,12 +588,12 @@ namespace nirfmxinstr_grpc { int32 personality {}; auto status = library_->CheckIfListExists(instrument, list_name, &list_exists, &personality); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_list_exists(list_exists); - response->set_personality(static_cast(personality)); - response->set_personality_raw(personality); + response->set_list_exists(list_exists); + response->set_personality(static_cast(personality)); + response->set_personality_raw(personality); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -616,12 +616,12 @@ namespace nirfmxinstr_grpc { int32 personality {}; auto status = library_->CheckIfSignalConfigurationExists(instrument, signal_name, &signal_configuration_exists, &personality); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_signal_configuration_exists(signal_configuration_exists); - response->set_personality(static_cast(personality)); - response->set_personality_raw(personality); + response->set_signal_configuration_exists(signal_configuration_exists); + response->set_personality(static_cast(personality)); + response->set_personality_raw(personality); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -643,7 +643,7 @@ namespace nirfmxinstr_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -666,7 +666,7 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DeleteAllExternalAttenuationTables(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -690,7 +690,7 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->DeleteExternalAttenuationTable(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -713,7 +713,7 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableCalibrationPlane(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -736,7 +736,7 @@ namespace nirfmxinstr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->EnableCalibrationPlane(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -794,7 +794,7 @@ namespace nirfmxinstr_grpc { auto status = library_->ExportSignal(instrument, export_signal_source, export_signal_output_terminal); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -819,10 +819,10 @@ namespace nirfmxinstr_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -846,7 +846,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeF32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -857,11 +857,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -885,10 +885,10 @@ namespace nirfmxinstr_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -912,7 +912,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeF64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -923,11 +923,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -951,10 +951,10 @@ namespace nirfmxinstr_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -977,16 +977,16 @@ namespace nirfmxinstr_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_attr_val(checked_convert_attr_val(attr_val)); - response->set_attr_val_raw(attr_val); + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_attr_val(checked_convert_attr_val(attr_val)); + response->set_attr_val_raw(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1010,7 +1010,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeI32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); @@ -1021,14 +1021,14 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxinstr_grpc::NiRFmxInstrInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -1038,8 +1038,8 @@ namespace nirfmxinstr_grpc { [&](auto x) { return checked_convert_attr_val(x); }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1063,10 +1063,10 @@ namespace nirfmxinstr_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1090,7 +1090,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeI64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -1101,11 +1101,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1129,10 +1129,10 @@ namespace nirfmxinstr_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1156,7 +1156,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeI8Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; @@ -1166,7 +1166,7 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_attr_val()->Clear(); @@ -1178,8 +1178,8 @@ namespace nirfmxinstr_grpc { [&](auto x) { return x; }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1204,7 +1204,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; @@ -1214,18 +1214,18 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1250,7 +1250,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -1260,18 +1260,18 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1296,7 +1296,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeString(instrument, channel_name, attribute_id, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -1310,11 +1310,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -1338,10 +1338,10 @@ namespace nirfmxinstr_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1364,10 +1364,10 @@ namespace nirfmxinstr_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1391,7 +1391,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeU32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -1402,11 +1402,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1431,7 +1431,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeU64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -1442,11 +1442,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1470,10 +1470,10 @@ namespace nirfmxinstr_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, channel_name, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1497,7 +1497,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAttributeU8Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; @@ -1507,12 +1507,12 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - response->mutable_attr_val()->resize(actual_array_size); - response->set_actual_array_size(actual_array_size); + response->set_attr_val(attr_val); + response->mutable_attr_val()->resize(actual_array_size); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1536,7 +1536,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetAvailablePorts(instrument, selector_string, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -1550,11 +1550,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_available_ports(available_ports); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_available_ports())); + response->set_available_ports(available_ports); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_available_ports())); return ::grpc::Status::OK; } } @@ -1577,7 +1577,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -1592,12 +1592,12 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -1621,7 +1621,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -1635,11 +1635,11 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -1662,10 +1662,10 @@ namespace nirfmxinstr_grpc { float64 external_attenuation {}; auto status = library_->GetExternalAttenuationTableActualValue(instrument, selector_string, &external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_external_attenuation(external_attenuation); + response->set_external_attenuation(external_attenuation); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1705,7 +1705,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetListNames(instrument, selector_string, personality_filter, nullptr, 0, &actual_list_names_size, nullptr, 0, &actual_personality_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string list_names; if (actual_list_names_size > 0) { @@ -1721,12 +1721,12 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_list_names(list_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_list_names())); - response->set_actual_list_names_size(actual_list_names_size); + response->set_list_names(list_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_list_names())); + response->set_actual_list_names_size(actual_list_names_size); response->mutable_personality()->Clear(); response->mutable_personality()->Reserve(actual_personality_array_size); std::transform( @@ -1736,8 +1736,8 @@ namespace nirfmxinstr_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_personality()->Resize(actual_personality_array_size, 0); - response->set_actual_personality_array_size(actual_personality_array_size); + response->mutable_personality()->Resize(actual_personality_array_size, 0); + response->set_actual_personality_array_size(actual_personality_array_size); return ::grpc::Status::OK; } } @@ -1794,11 +1794,11 @@ namespace nirfmxinstr_grpc { int32 s_parameter_type {}; auto status = library_->GetSParameterExternalAttenuationType(instrument, selector_string, &s_parameter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_s_parameter_type(static_cast(s_parameter_type)); - response->set_s_parameter_type_raw(s_parameter_type); + response->set_s_parameter_type(static_cast(s_parameter_type)); + response->set_s_parameter_type_raw(s_parameter_type); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1836,10 +1836,10 @@ namespace nirfmxinstr_grpc { CVIAbsoluteTime timestamp {}; auto status = library_->GetSelfCalibrateLastDateAndTime(instrument, selector_string, self_calibrate_step, ×tamp); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(timestamp, response->mutable_timestamp()); + convert_to_grpc(timestamp, response->mutable_timestamp()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1877,10 +1877,10 @@ namespace nirfmxinstr_grpc { float64 temperature {}; auto status = library_->GetSelfCalibrateLastTemperature(instrument, selector_string, self_calibrate_step, &temperature); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1920,7 +1920,7 @@ namespace nirfmxinstr_grpc { while (true) { auto status = library_->GetSignalConfigurationNames(instrument, selector_string, personality_filter, nullptr, 0, &actual_signal_names_size, nullptr, 0, &actual_personality_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string signal_names; if (actual_signal_names_size > 0) { @@ -1936,14 +1936,14 @@ namespace nirfmxinstr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_signal_names(signal_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); - response->set_actual_signal_names_size(actual_signal_names_size); - response->mutable_personality()->Resize(actual_personality_array_size, 0); - response->set_actual_personality_array_size(actual_personality_array_size); + response->set_signal_names(signal_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); + response->set_actual_signal_names_size(actual_signal_names_size); + response->mutable_personality()->Resize(actual_personality_array_size, 0); + response->set_actual_personality_array_size(actual_personality_array_size); return ::grpc::Status::OK; } } @@ -1974,11 +1974,11 @@ namespace nirfmxinstr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); - response->set_is_new_session(is_new_session); + response->mutable_instrument()->set_id(session_id); + response->set_is_new_session(is_new_session); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2010,10 +2010,10 @@ namespace nirfmxinstr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2051,10 +2051,10 @@ namespace nirfmxinstr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXINSTR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2080,31 +2080,31 @@ namespace nirfmxinstr_grpc { int32 valid_steps {}; auto status = library_->IsSelfCalibrateValid(instrument, selector_string, &self_calibrate_valid, &valid_steps); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_self_calibrate_valid(self_calibrate_valid); - if (valid_steps & 0x20) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_AMPLITUDE_ACCURACY); - if (valid_steps & 0x200) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_DC_OFFSET); - if (valid_steps & 0x8) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_DIGITIZER_SELF_CAL); - if (valid_steps & 0x2) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_GAIN_REFERENCE); - if (valid_steps & 0x4) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_IF_FLATNESS); - if (valid_steps & 0x80) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_IMAGE_SUPPRESSION); - if (valid_steps & 0x10) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_LO_SELF_CAL); - if (valid_steps & 0x1) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_PRESELECTOR_ALIGNMENT); - if (valid_steps & 0x40) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_RESIDUAL_LO_POWER); - if (valid_steps & 0x100) - response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_SYNTHESIZER_ALIGNMENT); - response->set_valid_steps_raw(valid_steps); + response->set_self_calibrate_valid(self_calibrate_valid); + if (valid_steps & 0x20) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_AMPLITUDE_ACCURACY); + if (valid_steps & 0x200) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_DC_OFFSET); + if (valid_steps & 0x8) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_DIGITIZER_SELF_CAL); + if (valid_steps & 0x2) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_GAIN_REFERENCE); + if (valid_steps & 0x4) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_IF_FLATNESS); + if (valid_steps & 0x80) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_IMAGE_SUPPRESSION); + if (valid_steps & 0x10) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_LO_SELF_CAL); + if (valid_steps & 0x1) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_PRESELECTOR_ALIGNMENT); + if (valid_steps & 0x40) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_RESIDUAL_LO_POWER); + if (valid_steps & 0x100) + response->add_valid_steps_array(SelfCalStep::SELF_CAL_STEP_SYNTHESIZER_ALIGNMENT); + response->set_valid_steps_raw(valid_steps); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2126,7 +2126,7 @@ namespace nirfmxinstr_grpc { int32 load_rf_instr_configuration = request->load_rf_instr_configuration(); auto status = library_->LoadAllConfigurations(instrument, file_path, load_rf_instr_configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2167,7 +2167,7 @@ namespace nirfmxinstr_grpc { auto status = library_->LoadSParameterExternalAttenuationTableFromS2PFile(instrument, selector_string, table_name, s2p_file_path, s_parameter_orientation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2191,7 +2191,7 @@ namespace nirfmxinstr_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, channel_name, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2213,7 +2213,7 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetDriver(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2235,7 +2235,7 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetEntireSession(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2257,7 +2257,7 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ResetToDefault(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2280,7 +2280,7 @@ namespace nirfmxinstr_grpc { char* file_path = (char*)request->file_path().c_str(); auto status = library_->SaveAllConfigurations(instrument, file_path); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2304,7 +2304,7 @@ namespace nirfmxinstr_grpc { char* table_name = (char*)request->table_name().c_str(); auto status = library_->SelectActiveExternalAttenuationTable(instrument, selector_string, table_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2343,7 +2343,7 @@ namespace nirfmxinstr_grpc { auto status = library_->SelfCalibrate(instrument, selector_string, steps_to_omit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2386,7 +2386,7 @@ namespace nirfmxinstr_grpc { float64 maximum_reference_level = request->maximum_reference_level(); auto status = library_->SelfCalibrateRange(instrument, selector_string, steps_to_omit, minimum_frequency, maximum_frequency, minimum_reference_level, maximum_reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2408,7 +2408,7 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeAdvanceTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2430,7 +2430,7 @@ namespace nirfmxinstr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeStartTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2455,7 +2455,7 @@ namespace nirfmxinstr_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2481,7 +2481,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2506,7 +2506,7 @@ namespace nirfmxinstr_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2532,7 +2532,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2566,7 +2566,7 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeI16(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2609,7 +2609,7 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeI32(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2643,7 +2643,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2668,7 +2668,7 @@ namespace nirfmxinstr_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2694,7 +2694,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2728,7 +2728,7 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeI8(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2774,7 +2774,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, channel_name, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2803,7 +2803,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2829,7 +2829,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, channel_name, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2873,7 +2873,7 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeString(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2907,7 +2907,7 @@ namespace nirfmxinstr_grpc { auto status = library_->SetAttributeU16(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2935,7 +2935,7 @@ namespace nirfmxinstr_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2961,7 +2961,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2987,7 +2987,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3012,7 +3012,7 @@ namespace nirfmxinstr_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, channel_name, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3038,7 +3038,7 @@ namespace nirfmxinstr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, channel_name, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3061,10 +3061,10 @@ namespace nirfmxinstr_grpc { CVIAbsoluteTime timestamp {}; auto status = library_->TimestampFromValues(seconds_since_1970, fractional_seconds, ×tamp); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - convert_to_grpc(timestamp, response->mutable_timestamp()); + convert_to_grpc(timestamp, response->mutable_timestamp()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3085,11 +3085,11 @@ namespace nirfmxinstr_grpc { float64 fractional_seconds {}; auto status = library_->ValuesFromTimestamp(timestamp, &seconds_since_1970, &fractional_seconds); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_seconds_since_1970(seconds_since_1970); - response->set_fractional_seconds(fractional_seconds); + response->set_seconds_since_1970(seconds_since_1970); + response->set_fractional_seconds(fractional_seconds); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3110,7 +3110,7 @@ namespace nirfmxinstr_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nirfmxinstr/nirfmxinstr_service.h b/generated/nirfmxinstr/nirfmxinstr_service.h index 4ad50f2d1..37737ada3 100644 --- a/generated/nirfmxinstr/nirfmxinstr_service.h +++ b/generated/nirfmxinstr/nirfmxinstr_service.h @@ -140,7 +140,7 @@ class NiRFmxInstrService final : public NiRFmxInstr::Service { NiRFmxInstrLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"},{5, "RefIn2"},{6, "PXI_ClkMaster"}, }; std::map frequencyreferencesource_output_map_ { {"OnboardClock", 1},{"RefIn", 2},{"PXI_Clk", 3},{"ClkIn", 4},{"RefIn2", 5},{"PXI_ClkMaster", 6}, }; std::map nirfmxinstrstringattributevaluesmapped_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"},{14, ""},{15, "RefOut"},{16, "RefOut2"},{17, "ClkOut"},{18, ""},{19, "OnboardClock"},{20, "RefIn"},{21, "PXI_Clk"},{22, "ClkIn"},{23, "RefIn2"},{24, "PXI_ClkMaster"},{25, "Automatic_SG_SA_Shared"},{26, "LO_In"},{27, "None"},{28, "Onboard"},{29, "Secondary"},{30, "SG_SA_Shared"},{31, "PFI0"},{32, "PFI1"},{33, "PXI_Trig0"},{34, "PXI_Trig1"},{35, "PXI_Trig2"},{36, "PXI_Trig3"},{37, "PXI_Trig4"},{38, "PXI_Trig5"},{39, "PXI_Trig6"},{40, "PXI_Trig7"},{41, "PXI_STAR"},{42, "PXIe_DStarC"},{43, "PXIe_DStarB"},{44, "TimerEvent"}, }; diff --git a/generated/nirfmxlte/nirfmxlte_service.cpp b/generated/nirfmxlte/nirfmxlte_service.cpp index 6dbdf6931..42b80ac35 100644 --- a/generated/nirfmxlte/nirfmxlte_service.cpp +++ b/generated/nirfmxlte/nirfmxlte_service.cpp @@ -93,7 +93,7 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -132,7 +132,7 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgConfigurableNumberOfOffsetsEnabled(instrument, selector_string, configurable_number_of_offsets_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -171,7 +171,7 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -210,7 +210,7 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -234,7 +234,7 @@ namespace nirfmxlte_grpc { int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgNumberOfEUTRAOffsets(instrument, selector_string, number_of_eutra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -258,7 +258,7 @@ namespace nirfmxlte_grpc { int32 number_of_gsm_offsets = request->number_of_gsm_offsets(); auto status = library_->ACPCfgNumberOfGSMOffsets(instrument, selector_string, number_of_gsm_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -282,7 +282,7 @@ namespace nirfmxlte_grpc { int32 number_of_utra_offsets = request->number_of_utra_offsets(); auto status = library_->ACPCfgNumberOfUTRAOffsets(instrument, selector_string, number_of_utra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -321,7 +321,7 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -377,7 +377,7 @@ namespace nirfmxlte_grpc { auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -417,7 +417,7 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -442,7 +442,7 @@ namespace nirfmxlte_grpc { int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgUTRAAndEUTRAOffsets(instrument, selector_string, number_of_utra_offsets, number_of_eutra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -471,7 +471,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); @@ -482,13 +482,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -513,11 +513,11 @@ namespace nirfmxlte_grpc { float64 relative_power {}; auto status = library_->ACPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -541,7 +541,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ACPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); @@ -554,12 +554,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_power()->Resize(actual_array_size, 0); - response->mutable_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_power()->Resize(actual_array_size, 0); + response->mutable_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -586,13 +586,13 @@ namespace nirfmxlte_grpc { float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_lower_relative_power(lower_relative_power); - response->set_upper_relative_power(upper_relative_power); - response->set_lower_absolute_power(lower_absolute_power); - response->set_upper_absolute_power(upper_absolute_power); + response->set_lower_relative_power(lower_relative_power); + response->set_upper_relative_power(upper_relative_power); + response->set_lower_absolute_power(lower_absolute_power); + response->set_upper_absolute_power(upper_absolute_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -616,7 +616,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); @@ -633,14 +633,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_lower_relative_power()->Resize(actual_array_size, 0); - response->mutable_upper_relative_power()->Resize(actual_array_size, 0); - response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); - response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); + response->mutable_upper_relative_power()->Resize(actual_array_size, 0); + response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); + response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -668,7 +668,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); @@ -679,13 +679,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -712,7 +712,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -723,13 +723,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -755,12 +755,12 @@ namespace nirfmxlte_grpc { float64 frequency {}; auto status = library_->ACPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_power(subblock_power); - response->set_integration_bandwidth(integration_bandwidth); - response->set_frequency(frequency); + response->set_subblock_power(subblock_power); + response->set_integration_bandwidth(integration_bandwidth); + response->set_frequency(frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -783,10 +783,10 @@ namespace nirfmxlte_grpc { float64 total_aggregated_power {}; auto status = library_->ACPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_aggregated_power(total_aggregated_power); + response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -808,11 +808,11 @@ namespace nirfmxlte_grpc { int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -833,7 +833,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -863,7 +863,7 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -893,7 +893,7 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -918,10 +918,10 @@ namespace nirfmxlte_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_level(reference_level); + response->set_reference_level(reference_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -943,7 +943,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -957,11 +957,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -984,7 +984,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildClusterString(selector_string, cluster_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -998,11 +998,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1025,7 +1025,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1039,11 +1039,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1066,7 +1066,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildPDSCHString(selector_string, pdsch_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1080,11 +1080,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1107,7 +1107,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -1121,11 +1121,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -1148,7 +1148,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSubblockString(selector_string, subblock_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1162,11 +1162,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1189,7 +1189,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->BuildSubframeString(selector_string, subframe_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1203,11 +1203,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1262,7 +1262,7 @@ namespace nirfmxlte_grpc { auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1301,7 +1301,7 @@ namespace nirfmxlte_grpc { auto status = library_->CHPCfgIntegrationBandwidthType(instrument, selector_string, integration_bandwidth_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1357,7 +1357,7 @@ namespace nirfmxlte_grpc { auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1397,7 +1397,7 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1423,11 +1423,11 @@ namespace nirfmxlte_grpc { float64 relative_power {}; auto status = library_->CHPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1451,7 +1451,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->CHPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); @@ -1464,12 +1464,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_power()->Resize(actual_array_size, 0); - response->mutable_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_power()->Resize(actual_array_size, 0); + response->mutable_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1496,7 +1496,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -1507,13 +1507,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1539,12 +1539,12 @@ namespace nirfmxlte_grpc { float64 frequency {}; auto status = library_->CHPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_power(subblock_power); - response->set_integration_bandwidth(integration_bandwidth); - response->set_frequency(frequency); + response->set_subblock_power(subblock_power); + response->set_integration_bandwidth(integration_bandwidth); + response->set_frequency(frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1567,10 +1567,10 @@ namespace nirfmxlte_grpc { float64 total_aggregated_power {}; auto status = library_->CHPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_aggregated_power(total_aggregated_power); + response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1592,11 +1592,11 @@ namespace nirfmxlte_grpc { int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1633,7 +1633,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgAutoDMRSDetectionEnabled(instrument, selector_string, auto_dmrs_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1672,7 +1672,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgAutoNPUSCHChannelDetectionEnabled(instrument, selector_string, auto_npusch_channel_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1711,7 +1711,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgAutoResourceBlockDetectionEnabled(instrument, selector_string, auto_resource_block_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1735,7 +1735,7 @@ namespace nirfmxlte_grpc { int32 band = request->band(); auto status = library_->CfgBand(instrument, selector_string, band); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1774,7 +1774,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgCellSpecificRatio(instrument, selector_string, cell_specific_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1800,7 +1800,7 @@ namespace nirfmxlte_grpc { int32 cell_id = request->cell_id(); auto status = library_->CfgComponentCarrier(instrument, selector_string, component_carrier_bandwidth, component_carrier_frequency, cell_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1845,7 +1845,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgComponentCarrierArray(instrument, selector_string, component_carrier_bandwidth, component_carrier_frequency, cell_id, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1885,7 +1885,7 @@ namespace nirfmxlte_grpc { int32 component_carrier_at_center_frequency = request->component_carrier_at_center_frequency(); auto status = library_->CfgComponentCarrierSpacing(instrument, selector_string, component_carrier_spacing_type, component_carrier_at_center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1946,7 +1946,7 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1985,7 +1985,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDownlinkAutoCellIDDetectionEnabled(instrument, selector_string, auto_cell_id_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2057,7 +2057,7 @@ namespace nirfmxlte_grpc { auto reserved = 0; auto status = library_->CfgDownlinkAutoChannelDetection(instrument, selector_string, auto_pdsch_channel_detection_enabled, auto_control_channel_power_detection_enabled, auto_pcfich_cfi_detection_enabled, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2096,7 +2096,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDownlinkChannelConfigurationMode(instrument, selector_string, channel_configuration_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2120,7 +2120,7 @@ namespace nirfmxlte_grpc { int32 number_of_subframes = request->number_of_subframes(); auto status = library_->CfgDownlinkNumberOfSubframes(instrument, selector_string, number_of_subframes); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2145,7 +2145,7 @@ namespace nirfmxlte_grpc { float64 sss_power = request->sss_power(); auto status = library_->CfgDownlinkSynchronizationSignal(instrument, selector_string, pss_power, sss_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2184,7 +2184,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDownlinkTestModel(instrument, selector_string, downlink_test_model); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2217,7 +2217,7 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->downlink_test_model().size()); auto status = library_->CfgDownlinkTestModelArray(instrument, selector_string, downlink_test_model, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2272,7 +2272,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgDuplexScheme(instrument, selector_string, duplex_scheme, uplink_downlink_configuration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2311,7 +2311,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgEMTCAnalysisEnabled(instrument, selector_string, emtc_analysis_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2335,7 +2335,7 @@ namespace nirfmxlte_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2359,7 +2359,7 @@ namespace nirfmxlte_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2400,7 +2400,7 @@ namespace nirfmxlte_grpc { int32 earfcn = request->earfcn(); auto status = library_->CfgFrequencyEARFCN(instrument, selector_string, link_direction, band, earfcn); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2444,7 +2444,7 @@ namespace nirfmxlte_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2520,7 +2520,7 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2559,7 +2559,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgLinkDirection(instrument, selector_string, link_direction); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2599,7 +2599,7 @@ namespace nirfmxlte_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2639,7 +2639,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgNBIoTComponentCarrier(instrument, selector_string, n_cell_id, uplink_subcarrier_spacing); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2697,7 +2697,7 @@ namespace nirfmxlte_grpc { int32 npusch_dmrs_delta_ss = request->npusch_dmrs_delta_ss(); auto status = library_->CfgNPUSCHDMRS(instrument, selector_string, npusch_dmrs_base_sequence_mode, npusch_dmrs_base_sequence_index, npusch_dmrs_cyclic_shift, npusch_dmrs_group_hopping_enabled, npusch_dmrs_delta_ss); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2721,7 +2721,7 @@ namespace nirfmxlte_grpc { int32 format = request->format(); auto status = library_->CfgNPUSCHFormat(instrument, selector_string, format); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2745,7 +2745,7 @@ namespace nirfmxlte_grpc { int32 starting_slot = request->starting_slot(); auto status = library_->CfgNPUSCHStartingSlot(instrument, selector_string, starting_slot); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2786,7 +2786,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgNPUSCHTones(instrument, selector_string, tone_offset, number_of_tones, modulation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2810,7 +2810,7 @@ namespace nirfmxlte_grpc { int32 number_of_component_carriers = request->number_of_component_carriers(); auto status = library_->CfgNumberOfComponentCarriers(instrument, selector_string, number_of_component_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2834,7 +2834,7 @@ namespace nirfmxlte_grpc { int32 number_of_dut_antennas = request->number_of_dut_antennas(); auto status = library_->CfgNumberOfDUTAntennas(instrument, selector_string, number_of_dut_antennas); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2858,7 +2858,7 @@ namespace nirfmxlte_grpc { int32 number_of_pdsch_channels = request->number_of_pdsch_channels(); auto status = library_->CfgNumberOfPDSCHChannels(instrument, selector_string, number_of_pdsch_channels); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2882,7 +2882,7 @@ namespace nirfmxlte_grpc { int32 number_of_resource_block_clusters = request->number_of_resource_block_clusters(); auto status = library_->CfgNumberOfPUSCHResourceBlockClusters(instrument, selector_string, number_of_resource_block_clusters); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2906,7 +2906,7 @@ namespace nirfmxlte_grpc { int32 number_of_subblocks = request->number_of_subblocks(); auto status = library_->CfgNumberOfSubblocks(instrument, selector_string, number_of_subblocks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2930,7 +2930,7 @@ namespace nirfmxlte_grpc { float64 pbch_power = request->pbch_power(); auto status = library_->CfgPBCH(instrument, selector_string, pbch_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2955,7 +2955,7 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPCFICH(instrument, selector_string, cfi, power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2979,7 +2979,7 @@ namespace nirfmxlte_grpc { float64 pdcch_power = request->pdcch_power(); auto status = library_->CfgPDCCH(instrument, selector_string, pdcch_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3020,7 +3020,7 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPDSCH(instrument, selector_string, cw0_modulation_type, resource_block_allocation, power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3076,7 +3076,7 @@ namespace nirfmxlte_grpc { float64 power = request->power(); auto status = library_->CfgPHICH(instrument, selector_string, resource, duration, power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3100,7 +3100,7 @@ namespace nirfmxlte_grpc { int32 modulation_type = request->modulation_type(); auto status = library_->CfgPSSCHModulationType(instrument, selector_string, modulation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3125,7 +3125,7 @@ namespace nirfmxlte_grpc { int32 number_of_resource_blocks = request->number_of_resource_blocks(); auto status = library_->CfgPSSCHResourceBlocks(instrument, selector_string, resource_block_offset, number_of_resource_blocks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3164,7 +3164,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgPUSCHModulationType(instrument, selector_string, modulation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3189,7 +3189,7 @@ namespace nirfmxlte_grpc { int32 number_of_resource_blocks = request->number_of_resource_blocks(); auto status = library_->CfgPUSCHResourceBlocks(instrument, selector_string, resource_block_offset, number_of_resource_blocks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3215,7 +3215,7 @@ namespace nirfmxlte_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3255,7 +3255,7 @@ namespace nirfmxlte_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3279,7 +3279,7 @@ namespace nirfmxlte_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3304,7 +3304,7 @@ namespace nirfmxlte_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3328,7 +3328,7 @@ namespace nirfmxlte_grpc { int32 transmit_antenna_to_analyze = request->transmit_antenna_to_analyze(); auto status = library_->CfgTransmitAntennaToAnalyze(instrument, selector_string, transmit_antenna_to_analyze); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3367,7 +3367,7 @@ namespace nirfmxlte_grpc { auto status = library_->CfgeNodeBCategory(instrument, selector_string, enodeb_category); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3391,10 +3391,10 @@ namespace nirfmxlte_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3415,7 +3415,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3438,7 +3438,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3461,7 +3461,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3485,7 +3485,7 @@ namespace nirfmxlte_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3509,7 +3509,7 @@ namespace nirfmxlte_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3532,7 +3532,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3555,7 +3555,7 @@ namespace nirfmxlte_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3578,7 +3578,7 @@ namespace nirfmxlte_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3601,7 +3601,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3627,7 +3627,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string result_names; if (actual_result_names_size > 0) { @@ -3640,13 +3640,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_actual_result_names_size(actual_result_names_size); - response->set_default_result_exists(default_result_exists); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_actual_result_names_size(actual_result_names_size); + response->set_default_result_exists(default_result_exists); return ::grpc::Status::OK; } } @@ -3670,10 +3670,10 @@ namespace nirfmxlte_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3697,7 +3697,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -3708,11 +3708,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3736,10 +3736,10 @@ namespace nirfmxlte_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3763,7 +3763,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -3774,11 +3774,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3802,10 +3802,10 @@ namespace nirfmxlte_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3828,16 +3828,16 @@ namespace nirfmxlte_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_attr_val(checked_convert_attr_val(attr_val)); - response->set_attr_val_raw(attr_val); + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_attr_val(checked_convert_attr_val(attr_val)); + response->set_attr_val_raw(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3861,7 +3861,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); @@ -3872,14 +3872,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxlte_grpc::NiRFmxLTEInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -3889,8 +3889,8 @@ namespace nirfmxlte_grpc { [&](auto x) { return checked_convert_attr_val(x); }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3914,10 +3914,10 @@ namespace nirfmxlte_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3941,7 +3941,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -3952,11 +3952,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3980,10 +3980,10 @@ namespace nirfmxlte_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4007,7 +4007,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; @@ -4017,7 +4017,7 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_attr_val()->Clear(); @@ -4029,8 +4029,8 @@ namespace nirfmxlte_grpc { [&](auto x) { return x; }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4055,7 +4055,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; @@ -4065,18 +4065,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4101,7 +4101,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4111,18 +4111,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4147,7 +4147,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -4161,11 +4161,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -4189,10 +4189,10 @@ namespace nirfmxlte_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4215,10 +4215,10 @@ namespace nirfmxlte_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4242,7 +4242,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -4253,11 +4253,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4282,7 +4282,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -4293,11 +4293,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4321,10 +4321,10 @@ namespace nirfmxlte_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4348,7 +4348,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; @@ -4358,12 +4358,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - response->mutable_attr_val()->resize(actual_array_size); - response->set_actual_array_size(actual_array_size); + response->set_attr_val(attr_val); + response->mutable_attr_val()->resize(actual_array_size); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4386,7 +4386,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -4401,12 +4401,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -4430,7 +4430,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -4444,11 +4444,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -4479,11 +4479,11 @@ namespace nirfmxlte_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXLTE_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); - response->set_is_new_session(is_new_session); + response->mutable_instrument()->set_id(session_id); + response->set_is_new_session(is_new_session); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4515,10 +4515,10 @@ namespace nirfmxlte_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXLTE_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4543,7 +4543,7 @@ namespace nirfmxlte_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4583,7 +4583,7 @@ namespace nirfmxlte_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->ModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4622,7 +4622,7 @@ namespace nirfmxlte_grpc { auto status = library_->ModAccCfgCommonClockSourceEnabled(instrument, selector_string, common_clock_source_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4661,7 +4661,7 @@ namespace nirfmxlte_grpc { auto status = library_->ModAccCfgEVMUnit(instrument, selector_string, evm_unit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4685,7 +4685,7 @@ namespace nirfmxlte_grpc { float64 fft_window_offset = request->fft_window_offset(); auto status = library_->ModAccCfgFFTWindowOffset(instrument, selector_string, fft_window_offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4726,7 +4726,7 @@ namespace nirfmxlte_grpc { float64 fft_window_length = request->fft_window_length(); auto status = library_->ModAccCfgFFTWindowPosition(instrument, selector_string, fft_window_type, fft_window_offset, fft_window_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4765,7 +4765,7 @@ namespace nirfmxlte_grpc { auto status = library_->ModAccCfgInBandEmissionMaskType(instrument, selector_string, in_band_emission_mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4806,7 +4806,7 @@ namespace nirfmxlte_grpc { int32 measurement_length = request->measurement_length(); auto status = library_->ModAccCfgSynchronizationModeAndInterval(instrument, selector_string, synchronization_mode, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4832,7 +4832,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchCSRSConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector csrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4842,18 +4842,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(csrs_constellation, response->mutable_csrs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_csrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_csrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(csrs_constellation, response->mutable_csrs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_csrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_csrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4877,10 +4877,10 @@ namespace nirfmxlte_grpc { float64 mean_rms_csrs_evm {}; auto status = library_->ModAccFetchCSRSEVM(instrument, selector_string, timeout, &mean_rms_csrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_csrs_evm(mean_rms_csrs_evm); + response->set_mean_rms_csrs_evm(mean_rms_csrs_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4904,7 +4904,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchCSRSEVMArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); float64* mean_rms_csrs_evm = response->mutable_mean_rms_csrs_evm()->mutable_data(); @@ -4915,11 +4915,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_csrs_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4948,15 +4948,15 @@ namespace nirfmxlte_grpc { int32 peak_composite_evm_slot_index {}; auto status = library_->ModAccFetchCompositeEVM(instrument, selector_string, timeout, &mean_rms_composite_evm, &maximum_peak_composite_evm, &mean_frequency_error, &peak_composite_evm_symbol_index, &peak_composite_evm_subcarrier_index, &peak_composite_evm_slot_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_composite_evm(mean_rms_composite_evm); - response->set_maximum_peak_composite_evm(maximum_peak_composite_evm); - response->set_mean_frequency_error(mean_frequency_error); - response->set_peak_composite_evm_symbol_index(peak_composite_evm_symbol_index); - response->set_peak_composite_evm_subcarrier_index(peak_composite_evm_subcarrier_index); - response->set_peak_composite_evm_slot_index(peak_composite_evm_slot_index); + response->set_mean_rms_composite_evm(mean_rms_composite_evm); + response->set_maximum_peak_composite_evm(maximum_peak_composite_evm); + response->set_mean_frequency_error(mean_frequency_error); + response->set_peak_composite_evm_symbol_index(peak_composite_evm_symbol_index); + response->set_peak_composite_evm_subcarrier_index(peak_composite_evm_subcarrier_index); + response->set_peak_composite_evm_slot_index(peak_composite_evm_slot_index); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4980,7 +4980,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchCompositeEVMArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); float64* mean_rms_composite_evm = response->mutable_mean_rms_composite_evm()->mutable_data(); @@ -5001,16 +5001,16 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); - response->mutable_maximum_peak_composite_evm()->Resize(actual_array_size, 0); - response->mutable_mean_frequency_error()->Resize(actual_array_size, 0); - response->mutable_peak_composite_evm_symbol_index()->Resize(actual_array_size, 0); - response->mutable_peak_composite_evm_subcarrier_index()->Resize(actual_array_size, 0); - response->mutable_peak_composite_evm_slot_index()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_composite_evm()->Resize(actual_array_size, 0); + response->mutable_maximum_peak_composite_evm()->Resize(actual_array_size, 0); + response->mutable_mean_frequency_error()->Resize(actual_array_size, 0); + response->mutable_peak_composite_evm_symbol_index()->Resize(actual_array_size, 0); + response->mutable_peak_composite_evm_subcarrier_index()->Resize(actual_array_size, 0); + response->mutable_peak_composite_evm_slot_index()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5037,13 +5037,13 @@ namespace nirfmxlte_grpc { float64 max_peak_composite_phase_error {}; auto status = library_->ModAccFetchCompositeMagnitudeAndPhaseError(instrument, selector_string, timeout, &mean_rms_composite_magnitude_error, &max_peak_composite_magnitude_error, &mean_rms_composite_phase_error, &max_peak_composite_phase_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_composite_magnitude_error(mean_rms_composite_magnitude_error); - response->set_max_peak_composite_magnitude_error(max_peak_composite_magnitude_error); - response->set_mean_rms_composite_phase_error(mean_rms_composite_phase_error); - response->set_max_peak_composite_phase_error(max_peak_composite_phase_error); + response->set_mean_rms_composite_magnitude_error(mean_rms_composite_magnitude_error); + response->set_max_peak_composite_magnitude_error(max_peak_composite_magnitude_error); + response->set_mean_rms_composite_phase_error(mean_rms_composite_phase_error); + response->set_max_peak_composite_phase_error(max_peak_composite_phase_error); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5067,7 +5067,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchCompositeMagnitudeAndPhaseErrorArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); float64* mean_rms_composite_magnitude_error = response->mutable_mean_rms_composite_magnitude_error()->mutable_data(); @@ -5084,14 +5084,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); - response->mutable_maximum_peak_composite_magnitude_error()->Resize(actual_array_size, 0); - response->mutable_mean_rms_composite_phase_error()->Resize(actual_array_size, 0); - response->mutable_maximum_peak_composite_phase_error()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_composite_magnitude_error()->Resize(actual_array_size, 0); + response->mutable_maximum_peak_composite_magnitude_error()->Resize(actual_array_size, 0); + response->mutable_mean_rms_composite_phase_error()->Resize(actual_array_size, 0); + response->mutable_maximum_peak_composite_phase_error()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5115,10 +5115,10 @@ namespace nirfmxlte_grpc { int32 detected_cell_id {}; auto status = library_->ModAccFetchDownlinkDetectedCellID(instrument, selector_string, timeout, &detected_cell_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_detected_cell_id(detected_cell_id); + response->set_detected_cell_id(detected_cell_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5142,7 +5142,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchDownlinkDetectedCellIDArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_detected_cell_id()->Resize(actual_array_size, 0); int32* detected_cell_id = reinterpret_cast(response->mutable_detected_cell_id()->mutable_data()); @@ -5153,11 +5153,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_detected_cell_id()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_detected_cell_id()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5182,7 +5182,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchDownlinkPBCHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pbch_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5192,18 +5192,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pbch_constellation, response->mutable_pbch_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pbch_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pbch_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pbch_constellation, response->mutable_pbch_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pbch_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pbch_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5228,7 +5228,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchDownlinkPCFICHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pcfich_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5238,18 +5238,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pcfich_constellation, response->mutable_pcfich_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pcfich_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pcfich_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pcfich_constellation, response->mutable_pcfich_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pcfich_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pcfich_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5274,7 +5274,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchDownlinkPDCCHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pdcch_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5284,18 +5284,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pdcch_constellation, response->mutable_pdcch_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pdcch_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pdcch_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pdcch_constellation, response->mutable_pdcch_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pdcch_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pdcch_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5320,7 +5320,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchDownlinkPHICHConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector phich_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5330,18 +5330,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(phich_constellation, response->mutable_phich_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_phich_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_phich_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(phich_constellation, response->mutable_phich_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_phich_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_phich_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5368,11 +5368,11 @@ namespace nirfmxlte_grpc { float64 ofdm_symbol_transmit_power {}; auto status = library_->ModAccFetchDownlinkTransmitPower(instrument, selector_string, timeout, &rs_transmit_power, &ofdm_symbol_transmit_power, reserved1, reserved2); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_rs_transmit_power(rs_transmit_power); - response->set_ofdm_symbol_transmit_power(ofdm_symbol_transmit_power); + response->set_rs_transmit_power(rs_transmit_power); + response->set_ofdm_symbol_transmit_power(ofdm_symbol_transmit_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5398,7 +5398,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchDownlinkTransmitPowerArray(instrument, selector_string, timeout, nullptr, nullptr, reserved1, reserved2, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); float64* rs_transmit_power = response->mutable_rs_transmit_power()->mutable_data(); @@ -5411,12 +5411,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); - response->mutable_ofdm_symbol_transmit_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_rs_transmit_power()->Resize(actual_array_size, 0); + response->mutable_ofdm_symbol_transmit_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5443,7 +5443,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchEVMHighPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_evm_high_per_symbol()->Resize(actual_array_size, 0); float32* evm_high_per_symbol = response->mutable_evm_high_per_symbol()->mutable_data(); @@ -5454,13 +5454,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_evm_high_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_evm_high_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5487,7 +5487,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchEVMLowPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_evm_low_per_symbol()->Resize(actual_array_size, 0); float32* evm_low_per_symbol = response->mutable_evm_low_per_symbol()->mutable_data(); @@ -5498,13 +5498,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_evm_low_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_evm_low_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5531,7 +5531,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchEVMPerSlotTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_per_slot()->Resize(actual_array_size, 0); float32* rms_evm_per_slot = response->mutable_rms_evm_per_slot()->mutable_data(); @@ -5542,13 +5542,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_per_slot()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_per_slot()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5575,7 +5575,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchEVMPerSubcarrierTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* mean_rms_evm_per_subcarrier = response->mutable_mean_rms_evm_per_subcarrier()->mutable_data(); @@ -5586,13 +5586,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_mean_rms_evm_per_subcarrier()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_mean_rms_evm_per_subcarrier()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5619,7 +5619,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchEVMPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_per_symbol()->Resize(actual_array_size, 0); float32* rms_evm_per_symbol = response->mutable_rms_evm_per_symbol()->mutable_data(); @@ -5630,13 +5630,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5662,12 +5662,12 @@ namespace nirfmxlte_grpc { float64 mean_iq_quadrature_error {}; auto status = library_->ModAccFetchIQImpairments(instrument, selector_string, timeout, &mean_iq_origin_offset, &mean_iq_gain_imbalance, &mean_iq_quadrature_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_iq_origin_offset(mean_iq_origin_offset); - response->set_mean_iq_gain_imbalance(mean_iq_gain_imbalance); - response->set_mean_iq_quadrature_error(mean_iq_quadrature_error); + response->set_mean_iq_origin_offset(mean_iq_origin_offset); + response->set_mean_iq_gain_imbalance(mean_iq_gain_imbalance); + response->set_mean_iq_quadrature_error(mean_iq_quadrature_error); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5691,7 +5691,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchIQImpairmentsArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); float64* mean_iq_origin_offset = response->mutable_mean_iq_origin_offset()->mutable_data(); @@ -5706,13 +5706,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); - response->mutable_mean_iq_gain_imbalance()->Resize(actual_array_size, 0); - response->mutable_mean_iq_quadrature_error()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_iq_origin_offset()->Resize(actual_array_size, 0); + response->mutable_mean_iq_gain_imbalance()->Resize(actual_array_size, 0); + response->mutable_mean_iq_quadrature_error()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5736,10 +5736,10 @@ namespace nirfmxlte_grpc { float64 in_band_emission_margin {}; auto status = library_->ModAccFetchInBandEmissionMargin(instrument, selector_string, timeout, &in_band_emission_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_in_band_emission_margin(in_band_emission_margin); + response->set_in_band_emission_margin(in_band_emission_margin); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5763,7 +5763,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchInBandEmissionMarginArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); float64* in_band_emission_margin = response->mutable_in_band_emission_margin()->mutable_data(); @@ -5774,11 +5774,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_in_band_emission_margin()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5805,7 +5805,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchInBandEmissionTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_in_band_emission()->Resize(actual_array_size, 0); float32* in_band_emission = response->mutable_in_band_emission()->mutable_data(); @@ -5818,14 +5818,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_in_band_emission()->Resize(actual_array_size, 0); - response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_in_band_emission()->Resize(actual_array_size, 0); + response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5852,7 +5852,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchMaximumEVMPerSlotTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_maximum_evm_per_slot()->Resize(actual_array_size, 0); float32* maximum_evm_per_slot = response->mutable_maximum_evm_per_slot()->mutable_data(); @@ -5863,13 +5863,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_maximum_evm_per_slot()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_maximum_evm_per_slot()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5896,7 +5896,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchMaximumEVMPerSubcarrierTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_maximum_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* maximum_evm_per_subcarrier = response->mutable_maximum_evm_per_subcarrier()->mutable_data(); @@ -5907,13 +5907,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_maximum_evm_per_subcarrier()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_maximum_evm_per_subcarrier()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5940,7 +5940,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchMaximumEVMPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_maximum_evm_per_symbol()->Resize(actual_array_size, 0); float32* maximum_evm_per_symbol = response->mutable_maximum_evm_per_symbol()->mutable_data(); @@ -5951,13 +5951,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_maximum_evm_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_maximum_evm_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5984,7 +5984,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchMaximumMagnitudeErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_maximum_magnitude_error_per_symbol()->Resize(actual_array_size, 0); float32* maximum_magnitude_error_per_symbol = response->mutable_maximum_magnitude_error_per_symbol()->mutable_data(); @@ -5995,13 +5995,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_maximum_magnitude_error_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_maximum_magnitude_error_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6028,7 +6028,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchMaximumPhaseErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_maximum_phase_error_per_symbol()->Resize(actual_array_size, 0); float32* maximum_phase_error_per_symbol = response->mutable_maximum_phase_error_per_symbol()->mutable_data(); @@ -6039,13 +6039,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_maximum_phase_error_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_maximum_phase_error_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6071,7 +6071,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchNPUSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); @@ -6083,27 +6083,27 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(data_constellation, response->mutable_data_constellation()); - { - auto shrunk_size = data_constellation_actual_array_size; - auto current_size = response->mutable_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(data_constellation, response->mutable_data_constellation()); + { + auto shrunk_size = data_constellation_actual_array_size; + auto current_size = response->mutable_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_data_constellation_actual_array_size(data_constellation_actual_array_size); - convert_to_grpc(dmrs_constellation, response->mutable_dmrs_constellation()); - { - auto shrunk_size = dmrs_constellation_actual_array_size; - auto current_size = response->mutable_dmrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + } + response->set_data_constellation_actual_array_size(data_constellation_actual_array_size); + convert_to_grpc(dmrs_constellation, response->mutable_dmrs_constellation()); + { + auto shrunk_size = dmrs_constellation_actual_array_size; + auto current_size = response->mutable_dmrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); + } + response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); return ::grpc::Status::OK; } } @@ -6128,11 +6128,11 @@ namespace nirfmxlte_grpc { float64 npusch_maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchNPUSCHDMRSEVM(instrument, selector_string, timeout, &npusch_mean_rms_dmrs_evm, &npusch_maximum_peak_dmrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_npusch_mean_rms_dmrs_evm(npusch_mean_rms_dmrs_evm); - response->set_npusch_maximum_peak_dmrs_evm(npusch_maximum_peak_dmrs_evm); + response->set_npusch_mean_rms_dmrs_evm(npusch_mean_rms_dmrs_evm); + response->set_npusch_maximum_peak_dmrs_evm(npusch_maximum_peak_dmrs_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6156,11 +6156,11 @@ namespace nirfmxlte_grpc { float64 npusch_maximum_peak_data_evm {}; auto status = library_->ModAccFetchNPUSCHDataEVM(instrument, selector_string, timeout, &npusch_mean_rms_data_evm, &npusch_maximum_peak_data_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_npusch_mean_rms_data_evm(npusch_mean_rms_data_evm); - response->set_npusch_maximum_peak_data_evm(npusch_maximum_peak_data_evm); + response->set_npusch_mean_rms_data_evm(npusch_mean_rms_data_evm); + response->set_npusch_maximum_peak_data_evm(npusch_maximum_peak_data_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6184,11 +6184,11 @@ namespace nirfmxlte_grpc { float64 npusch_mean_dmrs_power {}; auto status = library_->ModAccFetchNPUSCHSymbolPower(instrument, selector_string, timeout, &npusch_mean_data_power, &npusch_mean_dmrs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_npusch_mean_data_power(npusch_mean_data_power); - response->set_npusch_mean_dmrs_power(npusch_mean_dmrs_power); + response->set_npusch_mean_data_power(npusch_mean_data_power); + response->set_npusch_mean_dmrs_power(npusch_mean_dmrs_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6212,7 +6212,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCH1024QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam1024_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -6222,18 +6222,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam1024_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam1024_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam1024_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam1024_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6257,10 +6257,10 @@ namespace nirfmxlte_grpc { float64 mean_rms_1024qam_evm {}; auto status = library_->ModAccFetchPDSCH1024QAMEVM(instrument, selector_string, timeout, &mean_rms_1024qam_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_1024qam_evm(mean_rms_1024qam_evm); + response->set_mean_rms_1024qam_evm(mean_rms_1024qam_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6284,7 +6284,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCH1024QAMEVMArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); float64* mean_rms_1024qam_evm = response->mutable_mean_rms_1024qam_evm()->mutable_data(); @@ -6295,11 +6295,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_1024qam_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6324,7 +6324,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCH16QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam16_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -6334,18 +6334,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam16_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam16_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam16_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam16_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6370,7 +6370,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCH256QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam256_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -6380,18 +6380,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam256_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam256_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam256_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam256_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6416,7 +6416,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCH64QAMConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam64_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -6426,18 +6426,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam64_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam64_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam64_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam64_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6465,14 +6465,14 @@ namespace nirfmxlte_grpc { float64 mean_rms_256qam_evm {}; auto status = library_->ModAccFetchPDSCHEVM(instrument, selector_string, timeout, &mean_rms_evm, &mean_rms_qpsk_evm, &mean_rms_16qam_evm, &mean_rms_64qam_evm, &mean_rms_256qam_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_evm(mean_rms_evm); - response->set_mean_rms_qpsk_evm(mean_rms_qpsk_evm); - response->set_mean_rms_16qam_evm(mean_rms_16qam_evm); - response->set_mean_rms_64qam_evm(mean_rms_64qam_evm); - response->set_mean_rms_256qam_evm(mean_rms_256qam_evm); + response->set_mean_rms_evm(mean_rms_evm); + response->set_mean_rms_qpsk_evm(mean_rms_qpsk_evm); + response->set_mean_rms_16qam_evm(mean_rms_16qam_evm); + response->set_mean_rms_64qam_evm(mean_rms_64qam_evm); + response->set_mean_rms_256qam_evm(mean_rms_256qam_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6496,7 +6496,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCHEVMArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); float64* mean_rms_evm = response->mutable_mean_rms_evm()->mutable_data(); @@ -6515,15 +6515,15 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); - response->mutable_mean_rms_qpsk_evm()->Resize(actual_array_size, 0); - response->mutable_mean_rms_16qam_evm()->Resize(actual_array_size, 0); - response->mutable_mean_rms_64qam_evm()->Resize(actual_array_size, 0); - response->mutable_mean_rms_256qam_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_evm()->Resize(actual_array_size, 0); + response->mutable_mean_rms_qpsk_evm()->Resize(actual_array_size, 0); + response->mutable_mean_rms_16qam_evm()->Resize(actual_array_size, 0); + response->mutable_mean_rms_64qam_evm()->Resize(actual_array_size, 0); + response->mutable_mean_rms_256qam_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6548,7 +6548,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPDSCHQPSKConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qpsk_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -6558,18 +6558,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qpsk_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qpsk_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qpsk_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qpsk_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6595,7 +6595,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPSSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); @@ -6607,27 +6607,27 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(data_constellation, response->mutable_data_constellation()); - { - auto shrunk_size = data_constellation_actual_array_size; - auto current_size = response->mutable_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(data_constellation, response->mutable_data_constellation()); + { + auto shrunk_size = data_constellation_actual_array_size; + auto current_size = response->mutable_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_data_constellation_actual_array_size(data_constellation_actual_array_size); - convert_to_grpc(dmrs_constellation, response->mutable_dmrs_constellation()); - { - auto shrunk_size = dmrs_constellation_actual_array_size; - auto current_size = response->mutable_dmrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + } + response->set_data_constellation_actual_array_size(data_constellation_actual_array_size); + convert_to_grpc(dmrs_constellation, response->mutable_dmrs_constellation()); + { + auto shrunk_size = dmrs_constellation_actual_array_size; + auto current_size = response->mutable_dmrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); + } + response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); return ::grpc::Status::OK; } } @@ -6652,11 +6652,11 @@ namespace nirfmxlte_grpc { float64 pssch_maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchPSSCHDMRSEVM(instrument, selector_string, timeout, &pssch_mean_rms_dmrs_evm, &pssch_maximum_peak_dmrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pssch_mean_rms_dmrs_evm(pssch_mean_rms_dmrs_evm); - response->set_pssch_maximum_peak_dmrs_evm(pssch_maximum_peak_dmrs_evm); + response->set_pssch_mean_rms_dmrs_evm(pssch_mean_rms_dmrs_evm); + response->set_pssch_maximum_peak_dmrs_evm(pssch_maximum_peak_dmrs_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6680,7 +6680,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPSSCHDMRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); float64* pssch_mean_rms_dmrs_evm = response->mutable_pssch_mean_rms_dmrs_evm()->mutable_data(); @@ -6693,12 +6693,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); - response->mutable_pssch_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_pssch_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); + response->mutable_pssch_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6723,11 +6723,11 @@ namespace nirfmxlte_grpc { float64 pssch_maximum_peak_data_evm {}; auto status = library_->ModAccFetchPSSCHDataEVM(instrument, selector_string, timeout, &pssch_mean_rms_data_evm, &pssch_maximum_peak_data_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pssch_mean_rms_data_evm(pssch_mean_rms_data_evm); - response->set_pssch_maximum_peak_data_evm(pssch_maximum_peak_data_evm); + response->set_pssch_mean_rms_data_evm(pssch_mean_rms_data_evm); + response->set_pssch_maximum_peak_data_evm(pssch_maximum_peak_data_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6751,7 +6751,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPSSCHDataEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); float64* pssch_mean_rms_data_evm = response->mutable_pssch_mean_rms_data_evm()->mutable_data(); @@ -6764,12 +6764,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); - response->mutable_pssch_maximum_peak_data_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_pssch_mean_rms_data_evm()->Resize(actual_array_size, 0); + response->mutable_pssch_maximum_peak_data_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6794,11 +6794,11 @@ namespace nirfmxlte_grpc { float64 pssch_mean_dmrs_power {}; auto status = library_->ModAccFetchPSSCHSymbolPower(instrument, selector_string, timeout, &pssch_mean_data_power, &pssch_mean_dmrs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pssch_mean_data_power(pssch_mean_data_power); - response->set_pssch_mean_dmrs_power(pssch_mean_dmrs_power); + response->set_pssch_mean_data_power(pssch_mean_data_power); + response->set_pssch_mean_dmrs_power(pssch_mean_dmrs_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6822,7 +6822,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPSSCHSymbolPowerArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); float64* pssch_mean_data_power = response->mutable_pssch_mean_data_power()->mutable_data(); @@ -6835,12 +6835,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); - response->mutable_pssch_mean_dmrs_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_pssch_mean_data_power()->Resize(actual_array_size, 0); + response->mutable_pssch_mean_dmrs_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6866,7 +6866,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPUSCHConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &data_constellation_actual_array_size, nullptr, 0, &dmrs_constellation_actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector data_constellation(data_constellation_actual_array_size, NIComplexSingle()); std::vector dmrs_constellation(dmrs_constellation_actual_array_size, NIComplexSingle()); @@ -6878,27 +6878,27 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(data_constellation, response->mutable_data_constellation()); - { - auto shrunk_size = data_constellation_actual_array_size; - auto current_size = response->mutable_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(data_constellation, response->mutable_data_constellation()); + { + auto shrunk_size = data_constellation_actual_array_size; + auto current_size = response->mutable_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_data_constellation_actual_array_size(data_constellation_actual_array_size); - convert_to_grpc(dmrs_constellation, response->mutable_dmrs_constellation()); - { - auto shrunk_size = dmrs_constellation_actual_array_size; - auto current_size = response->mutable_dmrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + } + response->set_data_constellation_actual_array_size(data_constellation_actual_array_size); + convert_to_grpc(dmrs_constellation, response->mutable_dmrs_constellation()); + { + auto shrunk_size = dmrs_constellation_actual_array_size; + auto current_size = response->mutable_dmrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); + } + response->set_dmrs_constellation_actual_array_size(dmrs_constellation_actual_array_size); return ::grpc::Status::OK; } } @@ -6923,11 +6923,11 @@ namespace nirfmxlte_grpc { float64 maximum_peak_dmrs_evm {}; auto status = library_->ModAccFetchPUSCHDMRSEVM(instrument, selector_string, timeout, &mean_rms_dmrs_evm, &maximum_peak_dmrs_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_dmrs_evm(mean_rms_dmrs_evm); - response->set_maximum_peak_dmrs_evm(maximum_peak_dmrs_evm); + response->set_mean_rms_dmrs_evm(mean_rms_dmrs_evm); + response->set_maximum_peak_dmrs_evm(maximum_peak_dmrs_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6951,7 +6951,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPUSCHDMRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); float64* mean_rms_dmrs_evm = response->mutable_mean_rms_dmrs_evm()->mutable_data(); @@ -6964,12 +6964,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); - response->mutable_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_dmrs_evm()->Resize(actual_array_size, 0); + response->mutable_maximum_peak_dmrs_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6994,11 +6994,11 @@ namespace nirfmxlte_grpc { float64 maximum_peak_data_evm {}; auto status = library_->ModAccFetchPUSCHDataEVM(instrument, selector_string, timeout, &mean_rms_data_evm, &maximum_peak_data_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_data_evm(mean_rms_data_evm); - response->set_maximum_peak_data_evm(maximum_peak_data_evm); + response->set_mean_rms_data_evm(mean_rms_data_evm); + response->set_maximum_peak_data_evm(maximum_peak_data_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7022,7 +7022,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPUSCHDataEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); float64* mean_rms_data_evm = response->mutable_mean_rms_data_evm()->mutable_data(); @@ -7035,12 +7035,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); - response->mutable_maximum_peak_data_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_data_evm()->Resize(actual_array_size, 0); + response->mutable_maximum_peak_data_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7065,7 +7065,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector bits(actual_array_size); auto array_size = actual_array_size; @@ -7075,7 +7075,7 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_bits()->Clear(); @@ -7087,8 +7087,8 @@ namespace nirfmxlte_grpc { [&](auto x) { return x; }); - response->mutable_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7113,11 +7113,11 @@ namespace nirfmxlte_grpc { float64 pusch_mean_dmrs_power {}; auto status = library_->ModAccFetchPUSCHSymbolPower(instrument, selector_string, timeout, &pusch_mean_data_power, &pusch_mean_dmrs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pusch_mean_data_power(pusch_mean_data_power); - response->set_pusch_mean_dmrs_power(pusch_mean_dmrs_power); + response->set_pusch_mean_data_power(pusch_mean_data_power); + response->set_pusch_mean_dmrs_power(pusch_mean_dmrs_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7141,7 +7141,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchPUSCHSymbolPowerArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); float64* pusch_mean_data_power = response->mutable_pusch_mean_data_power()->mutable_data(); @@ -7154,12 +7154,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); - response->mutable_pusch_mean_dmrs_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_pusch_mean_data_power()->Resize(actual_array_size, 0); + response->mutable_pusch_mean_dmrs_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7186,7 +7186,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchRMSMagnitudeErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_magnitude_error_per_symbol()->Resize(actual_array_size, 0); float32* rms_magnitude_error_per_symbol = response->mutable_rms_magnitude_error_per_symbol()->mutable_data(); @@ -7197,13 +7197,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_magnitude_error_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_magnitude_error_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7230,7 +7230,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchRMSPhaseErrorPerSymbolTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_phase_error_per_symbol()->Resize(actual_array_size, 0); float32* rms_phase_error_per_symbol = response->mutable_rms_phase_error_per_symbol()->mutable_data(); @@ -7241,13 +7241,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_phase_error_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_phase_error_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7272,7 +7272,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSRSConstellation(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector srs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -7282,18 +7282,18 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(srs_constellation, response->mutable_srs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_srs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_srs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(srs_constellation, response->mutable_srs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_srs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_srs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7318,11 +7318,11 @@ namespace nirfmxlte_grpc { float64 mean_srs_power {}; auto status = library_->ModAccFetchSRSEVM(instrument, selector_string, timeout, &mean_rms_srs_evm, &mean_srs_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_srs_evm(mean_rms_srs_evm); - response->set_mean_srs_power(mean_srs_power); + response->set_mean_rms_srs_evm(mean_rms_srs_evm); + response->set_mean_srs_power(mean_srs_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7346,7 +7346,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSRSEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); float64* mean_rms_srs_evm = response->mutable_mean_rms_srs_evm()->mutable_data(); @@ -7359,12 +7359,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); - response->mutable_mean_srs_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_srs_evm()->Resize(actual_array_size, 0); + response->mutable_mean_srs_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7391,13 +7391,13 @@ namespace nirfmxlte_grpc { float64 range2_maximum_to_range1_minimum {}; auto status = library_->ModAccFetchSpectralFlatness(instrument, selector_string, timeout, &range1_maximum_to_range1_minimum, &range2_maximum_to_range2_minimum, &range1_maximum_to_range2_minimum, &range2_maximum_to_range1_minimum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_range1_maximum_to_range1_minimum(range1_maximum_to_range1_minimum); - response->set_range2_maximum_to_range2_minimum(range2_maximum_to_range2_minimum); - response->set_range1_maximum_to_range2_minimum(range1_maximum_to_range2_minimum); - response->set_range2_maximum_to_range1_minimum(range2_maximum_to_range1_minimum); + response->set_range1_maximum_to_range1_minimum(range1_maximum_to_range1_minimum); + response->set_range2_maximum_to_range2_minimum(range2_maximum_to_range2_minimum); + response->set_range1_maximum_to_range2_minimum(range1_maximum_to_range2_minimum); + response->set_range2_maximum_to_range1_minimum(range2_maximum_to_range1_minimum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7421,7 +7421,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSpectralFlatnessArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); float64* range1_maximum_to_range1_minimum = response->mutable_range1_maximum_to_range1_minimum()->mutable_data(); @@ -7438,14 +7438,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); - response->mutable_range2_maximum_to_range2_minimum()->Resize(actual_array_size, 0); - response->mutable_range1_maximum_to_range2_minimum()->Resize(actual_array_size, 0); - response->mutable_range2_maximum_to_range1_minimum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_range1_maximum_to_range1_minimum()->Resize(actual_array_size, 0); + response->mutable_range2_maximum_to_range2_minimum()->Resize(actual_array_size, 0); + response->mutable_range1_maximum_to_range2_minimum()->Resize(actual_array_size, 0); + response->mutable_range2_maximum_to_range1_minimum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7472,7 +7472,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSpectralFlatnessTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectral_flatness()->Resize(actual_array_size, 0); float32* spectral_flatness = response->mutable_spectral_flatness()->mutable_data(); @@ -7487,15 +7487,15 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectral_flatness()->Resize(actual_array_size, 0); - response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); - response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectral_flatness()->Resize(actual_array_size, 0); + response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); + response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7521,12 +7521,12 @@ namespace nirfmxlte_grpc { float64 subblock_mean_iq_quadrature_error {}; auto status = library_->ModAccFetchSubblockIQImpairments(instrument, selector_string, timeout, &subblock_mean_iq_origin_offset, &subblock_mean_iq_gain_imbalance, &subblock_mean_iq_quadrature_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_mean_iq_origin_offset(subblock_mean_iq_origin_offset); - response->set_subblock_mean_iq_gain_imbalance(subblock_mean_iq_gain_imbalance); - response->set_subblock_mean_iq_quadrature_error(subblock_mean_iq_quadrature_error); + response->set_subblock_mean_iq_origin_offset(subblock_mean_iq_origin_offset); + response->set_subblock_mean_iq_gain_imbalance(subblock_mean_iq_gain_imbalance); + response->set_subblock_mean_iq_quadrature_error(subblock_mean_iq_quadrature_error); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7549,10 +7549,10 @@ namespace nirfmxlte_grpc { float64 subblock_in_band_emission_margin {}; auto status = library_->ModAccFetchSubblockInBandEmissionMargin(instrument, selector_string, timeout, &subblock_in_band_emission_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_in_band_emission_margin(subblock_in_band_emission_margin); + response->set_subblock_in_band_emission_margin(subblock_in_band_emission_margin); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7576,7 +7576,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSubblockInBandEmissionTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); float64* subblock_in_band_emission = response->mutable_subblock_in_band_emission()->mutable_data(); @@ -7591,13 +7591,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); - response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); - response->mutable_subblock_in_band_emission_rb_indices()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); + response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); + response->mutable_subblock_in_band_emission_rb_indices()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7622,7 +7622,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSynchronizationSignalConstellation(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector sss_constellation(actual_array_size, NIComplexSingle()); std::vector pss_constellation(actual_array_size, NIComplexSingle()); @@ -7633,26 +7633,26 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_sss_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_sss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_sss_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_sss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - convert_to_grpc(pss_constellation, response->mutable_pss_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pss_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + } + convert_to_grpc(pss_constellation, response->mutable_pss_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pss_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7677,11 +7677,11 @@ namespace nirfmxlte_grpc { float64 mean_rms_sss_evm {}; auto status = library_->ModAccFetchSynchronizationSignalEVM(instrument, selector_string, timeout, &mean_rms_pss_evm, &mean_rms_sss_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_rms_pss_evm(mean_rms_pss_evm); - response->set_mean_rms_sss_evm(mean_rms_sss_evm); + response->set_mean_rms_pss_evm(mean_rms_pss_evm); + response->set_mean_rms_sss_evm(mean_rms_sss_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7705,7 +7705,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->ModAccFetchSynchronizationSignalEVMArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); float64* mean_rms_pss_evm = response->mutable_mean_rms_pss_evm()->mutable_data(); @@ -7718,12 +7718,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); - response->mutable_mean_rms_sss_evm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_rms_pss_evm()->Resize(actual_array_size, 0); + response->mutable_mean_rms_sss_evm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7778,7 +7778,7 @@ namespace nirfmxlte_grpc { auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7834,7 +7834,7 @@ namespace nirfmxlte_grpc { auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7874,7 +7874,7 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7902,13 +7902,13 @@ namespace nirfmxlte_grpc { float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &absolute_power, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_occupied_bandwidth(occupied_bandwidth); - response->set_absolute_power(absolute_power); - response->set_start_frequency(start_frequency); - response->set_stop_frequency(stop_frequency); + response->set_occupied_bandwidth(occupied_bandwidth); + response->set_absolute_power(absolute_power); + response->set_start_frequency(start_frequency); + response->set_stop_frequency(stop_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7934,7 +7934,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->OBWFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -7945,13 +7945,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -8006,7 +8006,7 @@ namespace nirfmxlte_grpc { auto status = library_->PVTCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8045,7 +8045,7 @@ namespace nirfmxlte_grpc { auto status = library_->PVTCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8070,7 +8070,7 @@ namespace nirfmxlte_grpc { float64 off_power_exclusion_after = request->off_power_exclusion_after(); auto status = library_->PVTCfgOFFPowerExclusionPeriods(instrument, selector_string, off_power_exclusion_before, off_power_exclusion_after); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8099,15 +8099,15 @@ namespace nirfmxlte_grpc { float64 burst_width {}; auto status = library_->PVTFetchMeasurement(instrument, selector_string, timeout, &measurement_status, &mean_absolute_off_power_before, &mean_absolute_off_power_after, &mean_absolute_on_power, &burst_width); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_mean_absolute_off_power_before(mean_absolute_off_power_before); - response->set_mean_absolute_off_power_after(mean_absolute_off_power_after); - response->set_mean_absolute_on_power(mean_absolute_on_power); - response->set_burst_width(burst_width); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_mean_absolute_off_power_before(mean_absolute_off_power_before); + response->set_mean_absolute_off_power_after(mean_absolute_off_power_after); + response->set_mean_absolute_on_power(mean_absolute_on_power); + response->set_burst_width(burst_width); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8131,7 +8131,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->PVTFetchMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -8150,7 +8150,7 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -8162,12 +8162,12 @@ namespace nirfmxlte_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_mean_absolute_off_power_before()->Resize(actual_array_size, 0); - response->mutable_mean_absolute_off_power_after()->Resize(actual_array_size, 0); - response->mutable_mean_absolute_on_power()->Resize(actual_array_size, 0); - response->mutable_burst_width()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_mean_absolute_off_power_before()->Resize(actual_array_size, 0); + response->mutable_mean_absolute_off_power_after()->Resize(actual_array_size, 0); + response->mutable_mean_absolute_on_power()->Resize(actual_array_size, 0); + response->mutable_burst_width()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -8194,7 +8194,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->PVTFetchSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_signal_power()->Resize(actual_array_size, 0); float32* signal_power = response->mutable_signal_power()->mutable_data(); @@ -8207,14 +8207,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_signal_power()->Resize(actual_array_size, 0); - response->mutable_absolute_limit()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_signal_power()->Resize(actual_array_size, 0); + response->mutable_absolute_limit()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -8237,7 +8237,7 @@ namespace nirfmxlte_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8260,7 +8260,7 @@ namespace nirfmxlte_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8316,7 +8316,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8340,7 +8340,7 @@ namespace nirfmxlte_grpc { float64 component_carrier_maximum_output_power = request->component_carrier_maximum_output_power(); auto status = library_->SEMCfgComponentCarrierMaximumOutputPower(instrument, selector_string, component_carrier_maximum_output_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8365,7 +8365,7 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->component_carrier_maximum_output_power().size()); auto status = library_->SEMCfgComponentCarrierMaximumOutputPowerArray(instrument, selector_string, component_carrier_maximum_output_power, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8406,7 +8406,7 @@ namespace nirfmxlte_grpc { float64 aggregated_maximum_power = request->aggregated_maximum_power(); auto status = library_->SEMCfgDownlinkMask(instrument, selector_string, downlink_mask_type, delta_f_maximum, aggregated_maximum_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8430,7 +8430,7 @@ namespace nirfmxlte_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8455,7 +8455,7 @@ namespace nirfmxlte_grpc { float64 offset_absolute_limit_stop = request->offset_absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, offset_absolute_limit_start, offset_absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8497,7 +8497,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, offset_absolute_limit_start, offset_absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8521,7 +8521,7 @@ namespace nirfmxlte_grpc { int32 offset_bandwidth_integral = request->offset_bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, offset_bandwidth_integral); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8546,7 +8546,7 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->offset_bandwidth_integral().size()); auto status = library_->SEMCfgOffsetBandwidthIntegralArray(instrument, selector_string, offset_bandwidth_integral, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8587,7 +8587,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8640,7 +8640,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8679,7 +8679,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8712,7 +8712,7 @@ namespace nirfmxlte_grpc { int32 number_of_elements = static_cast(request->limit_fail_mask().size()); auto status = library_->SEMCfgOffsetLimitFailMaskArray(instrument, selector_string, limit_fail_mask, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8752,7 +8752,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, offset_rbw, offset_rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8802,7 +8802,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, offset_rbw, offset_rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8827,7 +8827,7 @@ namespace nirfmxlte_grpc { float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_start, relative_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8869,7 +8869,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8909,7 +8909,7 @@ namespace nirfmxlte_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8948,7 +8948,7 @@ namespace nirfmxlte_grpc { auto status = library_->SEMCfgUplinkMaskType(instrument, selector_string, uplink_mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8974,11 +8974,11 @@ namespace nirfmxlte_grpc { float64 relative_integrated_power {}; auto status = library_->SEMFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_integrated_power(absolute_integrated_power); - response->set_relative_integrated_power(relative_integrated_power); + response->set_absolute_integrated_power(absolute_integrated_power); + response->set_relative_integrated_power(relative_integrated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9002,7 +9002,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SEMFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); @@ -9015,12 +9015,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); - response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); + response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9048,15 +9048,15 @@ namespace nirfmxlte_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9080,7 +9080,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -9099,7 +9099,7 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -9111,12 +9111,12 @@ namespace nirfmxlte_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9144,14 +9144,14 @@ namespace nirfmxlte_grpc { float64 relative_peak_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power, &absolute_peak_power, &peak_frequency, &relative_peak_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_integrated_power(absolute_integrated_power); - response->set_relative_integrated_power(relative_integrated_power); - response->set_absolute_peak_power(absolute_peak_power); - response->set_peak_frequency(peak_frequency); - response->set_relative_peak_power(relative_peak_power); + response->set_absolute_integrated_power(absolute_integrated_power); + response->set_relative_integrated_power(relative_integrated_power); + response->set_absolute_peak_power(absolute_peak_power); + response->set_peak_frequency(peak_frequency); + response->set_relative_peak_power(relative_peak_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9175,7 +9175,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); @@ -9194,15 +9194,15 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); - response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); - response->mutable_absolute_peak_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_relative_peak_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); + response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); + response->mutable_absolute_peak_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_relative_peak_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9226,11 +9226,11 @@ namespace nirfmxlte_grpc { int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9256,7 +9256,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -9269,14 +9269,14 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->mutable_composite_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->mutable_composite_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9302,12 +9302,12 @@ namespace nirfmxlte_grpc { float64 frequency {}; auto status = library_->SEMFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_power(subblock_power); - response->set_integration_bandwidth(integration_bandwidth); - response->set_frequency(frequency); + response->set_subblock_power(subblock_power); + response->set_integration_bandwidth(integration_bandwidth); + response->set_frequency(frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9330,10 +9330,10 @@ namespace nirfmxlte_grpc { float64 total_aggregated_power {}; auto status = library_->SEMFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_aggregated_power(total_aggregated_power); + response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9360,15 +9360,15 @@ namespace nirfmxlte_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9392,7 +9392,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -9411,7 +9411,7 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -9423,12 +9423,12 @@ namespace nirfmxlte_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9456,14 +9456,14 @@ namespace nirfmxlte_grpc { float64 relative_peak_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &absolute_integrated_power, &relative_integrated_power, &absolute_peak_power, &peak_frequency, &relative_peak_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_integrated_power(absolute_integrated_power); - response->set_relative_integrated_power(relative_integrated_power); - response->set_absolute_peak_power(absolute_peak_power); - response->set_peak_frequency(peak_frequency); - response->set_relative_peak_power(relative_peak_power); + response->set_absolute_integrated_power(absolute_integrated_power); + response->set_relative_integrated_power(relative_integrated_power); + response->set_absolute_peak_power(absolute_peak_power); + response->set_peak_frequency(peak_frequency); + response->set_relative_peak_power(relative_peak_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9487,7 +9487,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); float64* absolute_integrated_power = response->mutable_absolute_integrated_power()->mutable_data(); @@ -9506,15 +9506,15 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); - response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); - response->mutable_absolute_peak_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_relative_peak_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_integrated_power()->Resize(actual_array_size, 0); + response->mutable_relative_integrated_power()->Resize(actual_array_size, 0); + response->mutable_absolute_peak_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_relative_peak_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9553,7 +9553,7 @@ namespace nirfmxlte_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9575,7 +9575,7 @@ namespace nirfmxlte_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9600,7 +9600,7 @@ namespace nirfmxlte_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9626,7 +9626,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9651,7 +9651,7 @@ namespace nirfmxlte_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9677,7 +9677,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9711,7 +9711,7 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9754,7 +9754,7 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9788,7 +9788,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9813,7 +9813,7 @@ namespace nirfmxlte_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9839,7 +9839,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9873,7 +9873,7 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9919,7 +9919,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9948,7 +9948,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9974,7 +9974,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10018,7 +10018,7 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10052,7 +10052,7 @@ namespace nirfmxlte_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10080,7 +10080,7 @@ namespace nirfmxlte_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10106,7 +10106,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10132,7 +10132,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10157,7 +10157,7 @@ namespace nirfmxlte_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10183,7 +10183,7 @@ namespace nirfmxlte_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10224,7 +10224,7 @@ namespace nirfmxlte_grpc { int32 measurement_length = request->measurement_length(); auto status = library_->SlotPhaseCfgSynchronizationModeAndInterval(instrument, selector_string, synchronization_mode, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10249,10 +10249,10 @@ namespace nirfmxlte_grpc { float64 maximum_phase_discontinuity {}; auto status = library_->SlotPhaseFetchMaximumPhaseDiscontinuity(instrument, selector_string, timeout, &maximum_phase_discontinuity); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_maximum_phase_discontinuity(maximum_phase_discontinuity); + response->set_maximum_phase_discontinuity(maximum_phase_discontinuity); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10276,7 +10276,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SlotPhaseFetchMaximumPhaseDiscontinuityArray(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); float64* maximum_phase_discontinuity = response->mutable_maximum_phase_discontinuity()->mutable_data(); @@ -10287,11 +10287,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_maximum_phase_discontinuity()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10316,7 +10316,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SlotPhaseFetchPhaseDiscontinuities(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); float64* slot_phase_discontinuity = response->mutable_slot_phase_discontinuity()->mutable_data(); @@ -10327,11 +10327,11 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_slot_phase_discontinuity()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10358,7 +10358,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SlotPhaseFetchSamplePhaseError(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_sample_phase_error()->Resize(actual_array_size, 0); float32* sample_phase_error = response->mutable_sample_phase_error()->mutable_data(); @@ -10369,13 +10369,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_sample_phase_error()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_sample_phase_error()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10402,7 +10402,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SlotPhaseFetchSamplePhaseErrorLinearFitTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_sample_phase_error_linear_fit()->Resize(actual_array_size, 0); float32* sample_phase_error_linear_fit = response->mutable_sample_phase_error_linear_fit()->mutable_data(); @@ -10413,13 +10413,13 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_sample_phase_error_linear_fit()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_sample_phase_error_linear_fit()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10443,7 +10443,7 @@ namespace nirfmxlte_grpc { int32 measurement_length = request->measurement_length(); auto status = library_->SlotPowerCfgMeasurementInterval(instrument, selector_string, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10469,7 +10469,7 @@ namespace nirfmxlte_grpc { while (true) { auto status = library_->SlotPowerFetchPowers(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_subframe_power()->Resize(actual_array_size, 0); float64* subframe_power = response->mutable_subframe_power()->mutable_data(); @@ -10482,12 +10482,12 @@ namespace nirfmxlte_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_subframe_power()->Resize(actual_array_size, 0); - response->mutable_subframe_power_delta()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_subframe_power()->Resize(actual_array_size, 0); + response->mutable_subframe_power_delta()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10509,7 +10509,7 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10533,7 +10533,7 @@ namespace nirfmxlte_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nirfmxlte/nirfmxlte_service.h b/generated/nirfmxlte/nirfmxlte_service.h index dafa9303a..c2e726c87 100644 --- a/generated/nirfmxlte/nirfmxlte_service.h +++ b/generated/nirfmxlte/nirfmxlte_service.h @@ -332,7 +332,7 @@ class NiRFmxLTEService final : public NiRFmxLTE::Service { NiRFmxLTELibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXIe_DStarB", 12},{"TimerEvent", 13}, }; std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; diff --git a/generated/nirfmxnr/nirfmxnr_service.cpp b/generated/nirfmxnr/nirfmxnr_service.cpp index e91e1c363..49bc2331a 100644 --- a/generated/nirfmxnr/nirfmxnr_service.cpp +++ b/generated/nirfmxnr/nirfmxnr_service.cpp @@ -93,7 +93,7 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -132,7 +132,7 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -171,7 +171,7 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -195,7 +195,7 @@ namespace nirfmxnr_grpc { int32 number_of_endc_offsets = request->number_of_endc_offsets(); auto status = library_->ACPCfgNumberOfENDCOffsets(instrument, selector_string, number_of_endc_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -219,7 +219,7 @@ namespace nirfmxnr_grpc { int32 number_of_eutra_offsets = request->number_of_eutra_offsets(); auto status = library_->ACPCfgNumberOfEUTRAOffsets(instrument, selector_string, number_of_eutra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -243,7 +243,7 @@ namespace nirfmxnr_grpc { int32 number_of_nr_offsets = request->number_of_nr_offsets(); auto status = library_->ACPCfgNumberOfNROffsets(instrument, selector_string, number_of_nr_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -267,7 +267,7 @@ namespace nirfmxnr_grpc { int32 number_of_utra_offsets = request->number_of_utra_offsets(); auto status = library_->ACPCfgNumberOfUTRAOffsets(instrument, selector_string, number_of_utra_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -306,7 +306,7 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -362,7 +362,7 @@ namespace nirfmxnr_grpc { auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -402,7 +402,7 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -431,7 +431,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); @@ -442,13 +442,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -473,11 +473,11 @@ namespace nirfmxnr_grpc { float64 relative_power {}; auto status = library_->ACPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -501,7 +501,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ACPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); @@ -514,12 +514,12 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_power()->Resize(actual_array_size, 0); - response->mutable_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_power()->Resize(actual_array_size, 0); + response->mutable_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -546,13 +546,13 @@ namespace nirfmxnr_grpc { float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_lower_relative_power(lower_relative_power); - response->set_upper_relative_power(upper_relative_power); - response->set_lower_absolute_power(lower_absolute_power); - response->set_upper_absolute_power(upper_absolute_power); + response->set_lower_relative_power(lower_relative_power); + response->set_upper_relative_power(upper_relative_power); + response->set_lower_absolute_power(lower_absolute_power); + response->set_upper_absolute_power(upper_absolute_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -576,7 +576,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); @@ -593,14 +593,14 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_lower_relative_power()->Resize(actual_array_size, 0); - response->mutable_upper_relative_power()->Resize(actual_array_size, 0); - response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); - response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); + response->mutable_upper_relative_power()->Resize(actual_array_size, 0); + response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); + response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -628,7 +628,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); @@ -639,13 +639,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -672,7 +672,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -683,13 +683,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -715,12 +715,12 @@ namespace nirfmxnr_grpc { float64 frequency {}; auto status = library_->ACPFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_power(subblock_power); - response->set_integration_bandwidth(integration_bandwidth); - response->set_frequency(frequency); + response->set_subblock_power(subblock_power); + response->set_integration_bandwidth(integration_bandwidth); + response->set_frequency(frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -743,10 +743,10 @@ namespace nirfmxnr_grpc { float64 total_aggregated_power {}; auto status = library_->ACPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_aggregated_power(total_aggregated_power); + response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -768,11 +768,11 @@ namespace nirfmxnr_grpc { int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -793,7 +793,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -823,7 +823,7 @@ namespace nirfmxnr_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -853,7 +853,7 @@ namespace nirfmxnr_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -878,10 +878,10 @@ namespace nirfmxnr_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_level(reference_level); + response->set_reference_level(reference_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -903,7 +903,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildBandwidthPartString(selector_string, bandwidth_part_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -917,11 +917,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -944,7 +944,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCORESETClusterString(selector_string, coreset_cluster_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -958,11 +958,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -985,7 +985,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCORESETString(selector_string, coreset_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -999,11 +999,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1026,7 +1026,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1040,11 +1040,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1068,7 +1068,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildListStepString(list_name, result_name, step_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -1082,11 +1082,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -1109,7 +1109,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildListString(list_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -1123,11 +1123,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -1150,7 +1150,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1164,11 +1164,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1191,7 +1191,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDCCHString(selector_string, pdcch_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1205,11 +1205,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1232,7 +1232,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDSCHClusterString(selector_string, pdsch_cluster_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1246,11 +1246,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1273,7 +1273,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPDSCHString(selector_string, pdsch_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1287,11 +1287,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1314,7 +1314,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPUSCHClusterString(selector_string, pusch_cluster_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1328,11 +1328,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1355,7 +1355,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildPUSCHString(selector_string, pusch_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1369,11 +1369,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1396,7 +1396,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -1410,11 +1410,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -1437,7 +1437,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildSubblockString(selector_string, subblock_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1451,11 +1451,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1478,7 +1478,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->BuildUserString(selector_string, user_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -1492,11 +1492,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -1551,7 +1551,7 @@ namespace nirfmxnr_grpc { auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1607,7 +1607,7 @@ namespace nirfmxnr_grpc { auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1647,7 +1647,7 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1673,11 +1673,11 @@ namespace nirfmxnr_grpc { float64 relative_power {}; auto status = library_->CHPFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1701,7 +1701,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->CHPFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); @@ -1714,12 +1714,12 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_power()->Resize(actual_array_size, 0); - response->mutable_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_power()->Resize(actual_array_size, 0); + response->mutable_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1746,7 +1746,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -1757,13 +1757,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1787,10 +1787,10 @@ namespace nirfmxnr_grpc { float64 subblock_power {}; auto status = library_->CHPFetchSubblockPower(instrument, selector_string, timeout, &subblock_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_power(subblock_power); + response->set_subblock_power(subblock_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1813,10 +1813,10 @@ namespace nirfmxnr_grpc { float64 total_aggregated_power {}; auto status = library_->CHPFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_aggregated_power(total_aggregated_power); + response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1838,11 +1838,11 @@ namespace nirfmxnr_grpc { int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1901,7 +1901,7 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1925,7 +1925,7 @@ namespace nirfmxnr_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1949,7 +1949,7 @@ namespace nirfmxnr_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1993,7 +1993,7 @@ namespace nirfmxnr_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2069,7 +2069,7 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2109,7 +2109,7 @@ namespace nirfmxnr_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2135,7 +2135,7 @@ namespace nirfmxnr_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2175,7 +2175,7 @@ namespace nirfmxnr_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2199,7 +2199,7 @@ namespace nirfmxnr_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2224,7 +2224,7 @@ namespace nirfmxnr_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2263,7 +2263,7 @@ namespace nirfmxnr_grpc { auto status = library_->CfggNodeBCategory(instrument, selector_string, gnodeb_category); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2287,10 +2287,10 @@ namespace nirfmxnr_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2311,7 +2311,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2334,7 +2334,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2357,7 +2357,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2381,7 +2381,7 @@ namespace nirfmxnr_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2405,7 +2405,7 @@ namespace nirfmxnr_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2428,7 +2428,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2451,7 +2451,7 @@ namespace nirfmxnr_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->CreateList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2475,10 +2475,10 @@ namespace nirfmxnr_grpc { int32 created_step_index {}; auto status = library_->CreateListStep(instrument, selector_string, &created_step_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_created_step_index(created_step_index); + response->set_created_step_index(created_step_index); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2499,7 +2499,7 @@ namespace nirfmxnr_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2522,7 +2522,7 @@ namespace nirfmxnr_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->DeleteList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2545,7 +2545,7 @@ namespace nirfmxnr_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2568,7 +2568,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2594,7 +2594,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string result_names; if (actual_result_names_size > 0) { @@ -2607,13 +2607,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_actual_result_names_size(actual_result_names_size); - response->set_default_result_exists(default_result_exists); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_actual_result_names_size(actual_result_names_size); + response->set_default_result_exists(default_result_exists); return ::grpc::Status::OK; } } @@ -2637,10 +2637,10 @@ namespace nirfmxnr_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2664,7 +2664,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -2675,11 +2675,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2703,10 +2703,10 @@ namespace nirfmxnr_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2730,7 +2730,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -2741,11 +2741,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2769,10 +2769,10 @@ namespace nirfmxnr_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2795,16 +2795,16 @@ namespace nirfmxnr_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_attr_val(checked_convert_attr_val(attr_val)); - response->set_attr_val_raw(attr_val); + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_attr_val(checked_convert_attr_val(attr_val)); + response->set_attr_val_raw(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2828,7 +2828,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); @@ -2839,14 +2839,14 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxnr_grpc::NiRFmxNRInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -2856,8 +2856,8 @@ namespace nirfmxnr_grpc { [&](auto x) { return checked_convert_attr_val(x); }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2881,10 +2881,10 @@ namespace nirfmxnr_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2908,7 +2908,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -2919,11 +2919,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2947,10 +2947,10 @@ namespace nirfmxnr_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2974,7 +2974,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; @@ -2984,7 +2984,7 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_attr_val()->Clear(); @@ -2996,8 +2996,8 @@ namespace nirfmxnr_grpc { [&](auto x) { return x; }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3022,7 +3022,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; @@ -3032,18 +3032,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3068,7 +3068,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -3078,18 +3078,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3114,7 +3114,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -3128,11 +3128,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -3156,10 +3156,10 @@ namespace nirfmxnr_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3182,10 +3182,10 @@ namespace nirfmxnr_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3209,7 +3209,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -3220,11 +3220,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3249,7 +3249,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -3260,11 +3260,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3288,10 +3288,10 @@ namespace nirfmxnr_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3315,7 +3315,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; @@ -3325,12 +3325,12 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - response->mutable_attr_val()->resize(actual_array_size); - response->set_actual_array_size(actual_array_size); + response->set_attr_val(attr_val); + response->mutable_attr_val()->resize(actual_array_size); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3353,7 +3353,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -3368,12 +3368,12 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -3397,7 +3397,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -3411,11 +3411,11 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -3446,11 +3446,11 @@ namespace nirfmxnr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXNR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); - response->set_is_new_session(is_new_session); + response->mutable_instrument()->set_id(session_id); + response->set_is_new_session(is_new_session); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3482,10 +3482,10 @@ namespace nirfmxnr_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXNR_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3510,7 +3510,7 @@ namespace nirfmxnr_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3534,7 +3534,7 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); auto status = library_->ModAccAutoLevel(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3573,7 +3573,7 @@ namespace nirfmxnr_grpc { auto status = library_->ModAccCfgMeasurementMode(instrument, selector_string, measurement_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3612,7 +3612,7 @@ namespace nirfmxnr_grpc { auto status = library_->ModAccCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3639,7 +3639,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->reference_waveform().size()); auto status = library_->ModAccCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3661,7 +3661,7 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->ModAccClearNoiseCalibrationDatabase(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3687,11 +3687,11 @@ namespace nirfmxnr_grpc { float64 composite_peak_evm_maximum {}; auto status = library_->ModAccFetchCompositeEVM(instrument, selector_string, timeout, &composite_rms_evm_mean, &composite_peak_evm_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_composite_rms_evm_mean(composite_rms_evm_mean); - response->set_composite_peak_evm_maximum(composite_peak_evm_maximum); + response->set_composite_rms_evm_mean(composite_rms_evm_mean); + response->set_composite_peak_evm_maximum(composite_peak_evm_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3714,10 +3714,10 @@ namespace nirfmxnr_grpc { float64 frequency_error_mean {}; auto status = library_->ModAccFetchFrequencyErrorMean(instrument, selector_string, timeout, &frequency_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_frequency_error_mean(frequency_error_mean); + response->set_frequency_error_mean(frequency_error_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3743,7 +3743,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchIQGainImbalancePerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_gain_imbalance_per_subcarrier_mean = response->mutable_iq_gain_imbalance_per_subcarrier_mean()->mutable_data(); @@ -3754,13 +3754,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3787,7 +3787,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_quadrature_error_per_subcarrier_mean = response->mutable_iq_quadrature_error_per_subcarrier_mean()->mutable_data(); @@ -3798,13 +3798,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3831,7 +3831,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchInBandEmissionTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_in_band_emission()->Resize(actual_array_size, 0); float32* in_band_emission = response->mutable_in_band_emission()->mutable_data(); @@ -3844,14 +3844,14 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_in_band_emission()->Resize(actual_array_size, 0); - response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_in_band_emission()->Resize(actual_array_size, 0); + response->mutable_in_band_emission_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3876,7 +3876,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPBCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pbch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -3886,18 +3886,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pbch_dmrs_constellation, response->mutable_pbch_dmrs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pbch_dmrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pbch_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pbch_dmrs_constellation, response->mutable_pbch_dmrs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pbch_dmrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pbch_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3924,7 +3924,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPBCHDMRSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pbch_dmrs_rms_evm_per_subcarrier_mean = response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -3935,13 +3935,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_pbch_dmrs_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3968,7 +3968,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPBCHDMRSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pbch_dmrs_rms_evm_per_symbol_mean = response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->mutable_data(); @@ -3979,13 +3979,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_pbch_dmrs_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4010,7 +4010,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPBCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pbch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4020,18 +4020,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pbch_data_constellation, response->mutable_pbch_data_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pbch_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pbch_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pbch_data_constellation, response->mutable_pbch_data_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pbch_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pbch_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4058,7 +4058,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPBCHDataRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pbch_data_rms_evm_per_subcarrier_mean = response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -4069,13 +4069,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_pbch_data_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4102,7 +4102,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPBCHDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pbch_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pbch_data_rms_evm_per_symbol_mean = response->mutable_pbch_data_rms_evm_per_symbol_mean()->mutable_data(); @@ -4113,13 +4113,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_pbch_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_pbch_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4144,7 +4144,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCH1024QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam1024_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4154,18 +4154,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam1024_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam1024_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam1024_constellation, response->mutable_qam1024_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam1024_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam1024_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4190,7 +4190,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCH16QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam16_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4200,18 +4200,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam16_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam16_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam16_constellation, response->mutable_qam16_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam16_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam16_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4236,7 +4236,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCH256QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam256_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4246,18 +4246,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam256_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam256_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam256_constellation, response->mutable_qam256_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam256_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam256_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4282,7 +4282,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCH64QAMConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qam64_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4292,18 +4292,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qam64_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qam64_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qam64_constellation, response->mutable_qam64_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qam64_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qam64_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4328,7 +4328,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCH8PSKConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector psk8_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4338,18 +4338,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(psk8_constellation, response->mutable_psk8_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_psk8_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_psk8_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(psk8_constellation, response->mutable_psk8_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_psk8_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_psk8_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4374,7 +4374,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pdsch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4384,18 +4384,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pdsch_dmrs_constellation, response->mutable_pdsch_dmrs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pdsch_dmrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pdsch_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pdsch_dmrs_constellation, response->mutable_pdsch_dmrs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pdsch_dmrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pdsch_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4420,7 +4420,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pdsch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4430,18 +4430,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pdsch_data_constellation, response->mutable_pdsch_data_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pdsch_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pdsch_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pdsch_data_constellation, response->mutable_pdsch_data_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pdsch_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pdsch_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4466,7 +4466,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector bits(actual_array_size); auto array_size = actual_array_size; @@ -4476,7 +4476,7 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_bits()->Clear(); @@ -4488,8 +4488,8 @@ namespace nirfmxnr_grpc { [&](auto x) { return x; }); - response->mutable_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4514,7 +4514,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCHPTRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pdsch_ptrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4524,18 +4524,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pdsch_ptrs_constellation, response->mutable_pdsch_ptrs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pdsch_ptrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pdsch_ptrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pdsch_ptrs_constellation, response->mutable_pdsch_ptrs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pdsch_ptrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pdsch_ptrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4560,7 +4560,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPDSCHQPSKConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector qpsk_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4570,18 +4570,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_qpsk_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_qpsk_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(qpsk_constellation, response->mutable_qpsk_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_qpsk_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_qpsk_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4606,7 +4606,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPSSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4616,18 +4616,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pss_constellation, response->mutable_pss_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pss_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pss_constellation, response->mutable_pss_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pss_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4654,7 +4654,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPSSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* pss_rms_evm_per_subcarrier_mean = response->mutable_pss_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -4665,13 +4665,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_pss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_pss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4698,7 +4698,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPSSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_pss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* pss_rms_evm_per_symbol_mean = response->mutable_pss_rms_evm_per_symbol_mean()->mutable_data(); @@ -4709,13 +4709,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_pss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_pss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4740,7 +4740,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPUSCHDMRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pusch_dmrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4750,18 +4750,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pusch_dmrs_constellation, response->mutable_pusch_dmrs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pusch_dmrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pusch_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pusch_dmrs_constellation, response->mutable_pusch_dmrs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pusch_dmrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pusch_dmrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4786,7 +4786,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPUSCHDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pusch_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4796,18 +4796,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pusch_data_constellation, response->mutable_pusch_data_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pusch_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pusch_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pusch_data_constellation, response->mutable_pusch_data_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pusch_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pusch_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4832,7 +4832,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPUSCHDemodulatedBits(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector bits(actual_array_size); auto array_size = actual_array_size; @@ -4842,7 +4842,7 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_bits()->Clear(); @@ -4854,8 +4854,8 @@ namespace nirfmxnr_grpc { [&](auto x) { return x; }); - response->mutable_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4880,7 +4880,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPUSCHPTRSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pusch_ptrs_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4890,18 +4890,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pusch_ptrs_constellation, response->mutable_pusch_ptrs_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pusch_ptrs_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pusch_ptrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pusch_ptrs_constellation, response->mutable_pusch_ptrs_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pusch_ptrs_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pusch_ptrs_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4928,7 +4928,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPeakEVMPerSlotMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_peak_evm_per_slot_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_slot_maximum = response->mutable_peak_evm_per_slot_maximum()->mutable_data(); @@ -4939,13 +4939,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_peak_evm_per_slot_maximum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_peak_evm_per_slot_maximum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4972,7 +4972,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPeakEVMPerSubcarrierMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_peak_evm_per_subcarrier_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_subcarrier_maximum = response->mutable_peak_evm_per_subcarrier_maximum()->mutable_data(); @@ -4983,13 +4983,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_peak_evm_per_subcarrier_maximum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_peak_evm_per_subcarrier_maximum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5016,7 +5016,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchPeakEVMPerSymbolMaximumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_peak_evm_per_symbol_maximum()->Resize(actual_array_size, 0); float32* peak_evm_per_symbol_maximum = response->mutable_peak_evm_per_symbol_maximum()->mutable_data(); @@ -5027,13 +5027,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_peak_evm_per_symbol_maximum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_peak_evm_per_symbol_maximum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5060,7 +5060,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchRMSEVMHighPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_high_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_high_per_symbol_mean = response->mutable_rms_evm_high_per_symbol_mean()->mutable_data(); @@ -5071,13 +5071,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_high_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_high_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5104,7 +5104,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchRMSEVMLowPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_low_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_low_per_symbol_mean = response->mutable_rms_evm_low_per_symbol_mean()->mutable_data(); @@ -5115,13 +5115,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_low_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_low_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5148,7 +5148,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchRMSEVMPerSlotMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_per_slot_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_slot_mean = response->mutable_rms_evm_per_slot_mean()->mutable_data(); @@ -5159,13 +5159,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_per_slot_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_per_slot_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5192,7 +5192,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_subcarrier_mean = response->mutable_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -5203,13 +5203,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5236,7 +5236,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* rms_evm_per_symbol_mean = response->mutable_rms_evm_per_symbol_mean()->mutable_data(); @@ -5247,13 +5247,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5278,7 +5278,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchSSSConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector sss_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5288,18 +5288,18 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_sss_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_sss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(sss_constellation, response->mutable_sss_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_sss_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_sss_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5326,7 +5326,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchSSSRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_sss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* sss_rms_evm_per_subcarrier_mean = response->mutable_sss_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -5337,13 +5337,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_sss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_sss_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5370,7 +5370,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchSSSRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_sss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* sss_rms_evm_per_symbol_mean = response->mutable_sss_rms_evm_per_symbol_mean()->mutable_data(); @@ -5381,13 +5381,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_sss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_sss_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5414,7 +5414,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchSpectralFlatnessTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectral_flatness()->Resize(actual_array_size, 0); float32* spectral_flatness = response->mutable_spectral_flatness()->mutable_data(); @@ -5429,15 +5429,15 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectral_flatness()->Resize(actual_array_size, 0); - response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); - response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectral_flatness()->Resize(actual_array_size, 0); + response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); + response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5462,7 +5462,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->ModAccFetchSubblockInBandEmissionTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); float64* subblock_in_band_emission = response->mutable_subblock_in_band_emission()->mutable_data(); @@ -5477,13 +5477,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); - response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); - response->mutable_subblock_in_band_emission_rb_indices()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_subblock_in_band_emission()->Resize(actual_array_size, 0); + response->mutable_subblock_in_band_emission_mask()->Resize(actual_array_size, 0); + response->mutable_subblock_in_band_emission_rb_indices()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5506,11 +5506,11 @@ namespace nirfmxnr_grpc { int32 calibration_data_valid {}; auto status = library_->ModAccValidateCalibrationData(instrument, selector_string, &calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_calibration_data_valid(static_cast(calibration_data_valid)); - response->set_calibration_data_valid_raw(calibration_data_valid); + response->set_calibration_data_valid(static_cast(calibration_data_valid)); + response->set_calibration_data_valid_raw(calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5564,7 +5564,7 @@ namespace nirfmxnr_grpc { auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5620,7 +5620,7 @@ namespace nirfmxnr_grpc { auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5660,7 +5660,7 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5688,13 +5688,13 @@ namespace nirfmxnr_grpc { float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &absolute_power, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_occupied_bandwidth(occupied_bandwidth); - response->set_absolute_power(absolute_power); - response->set_start_frequency(start_frequency); - response->set_stop_frequency(stop_frequency); + response->set_occupied_bandwidth(occupied_bandwidth); + response->set_absolute_power(absolute_power); + response->set_start_frequency(start_frequency); + response->set_stop_frequency(stop_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5720,7 +5720,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->OBWFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -5731,13 +5731,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5792,7 +5792,7 @@ namespace nirfmxnr_grpc { auto status = library_->PVTCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5831,7 +5831,7 @@ namespace nirfmxnr_grpc { auto status = library_->PVTCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5856,7 +5856,7 @@ namespace nirfmxnr_grpc { float64 off_power_exclusion_after = request->off_power_exclusion_after(); auto status = library_->PVTCfgOFFPowerExclusionPeriods(instrument, selector_string, off_power_exclusion_before, off_power_exclusion_after); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5885,15 +5885,15 @@ namespace nirfmxnr_grpc { float64 burst_width {}; auto status = library_->PVTFetchMeasurement(instrument, selector_string, timeout, &measurement_status, &absolute_off_power_before, &absolute_off_power_after, &absolute_on_power, &burst_width); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_absolute_off_power_before(absolute_off_power_before); - response->set_absolute_off_power_after(absolute_off_power_after); - response->set_absolute_on_power(absolute_on_power); - response->set_burst_width(burst_width); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_absolute_off_power_before(absolute_off_power_before); + response->set_absolute_off_power_after(absolute_off_power_after); + response->set_absolute_on_power(absolute_on_power); + response->set_burst_width(burst_width); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5917,7 +5917,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->PVTFetchMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -5936,7 +5936,7 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -5948,12 +5948,12 @@ namespace nirfmxnr_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_absolute_off_power_before()->Resize(actual_array_size, 0); - response->mutable_absolute_off_power_after()->Resize(actual_array_size, 0); - response->mutable_absolute_on_power()->Resize(actual_array_size, 0); - response->mutable_burst_width()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_absolute_off_power_before()->Resize(actual_array_size, 0); + response->mutable_absolute_off_power_after()->Resize(actual_array_size, 0); + response->mutable_absolute_on_power()->Resize(actual_array_size, 0); + response->mutable_burst_width()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5980,7 +5980,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->PVTFetchSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_signal_power()->Resize(actual_array_size, 0); float32* signal_power = response->mutable_signal_power()->mutable_data(); @@ -5993,14 +5993,14 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_signal_power()->Resize(actual_array_size, 0); - response->mutable_absolute_limit()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_signal_power()->Resize(actual_array_size, 0); + response->mutable_absolute_limit()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6027,7 +6027,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->PVTFetchWindowedSignalPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_windowed_signal_power()->Resize(actual_array_size, 0); float32* windowed_signal_power = response->mutable_windowed_signal_power()->mutable_data(); @@ -6038,13 +6038,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_windowed_signal_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_windowed_signal_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6067,7 +6067,7 @@ namespace nirfmxnr_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6090,7 +6090,7 @@ namespace nirfmxnr_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6146,7 +6146,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6170,7 +6170,7 @@ namespace nirfmxnr_grpc { float64 component_carrier_rated_output_power = request->component_carrier_rated_output_power(); auto status = library_->SEMCfgComponentCarrierRatedOutputPower(instrument, selector_string, component_carrier_rated_output_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6195,7 +6195,7 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->component_carrier_rated_output_power().size()); auto status = library_->SEMCfgComponentCarrierRatedOutputPowerArray(instrument, selector_string, component_carrier_rated_output_power, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6219,7 +6219,7 @@ namespace nirfmxnr_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6244,7 +6244,7 @@ namespace nirfmxnr_grpc { float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, absolute_limit_start, absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6286,7 +6286,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, absolute_limit_start, absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6310,7 +6310,7 @@ namespace nirfmxnr_grpc { int32 bandwidth_integral = request->bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, bandwidth_integral); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6335,7 +6335,7 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->bandwidth_integral().size()); auto status = library_->SEMCfgOffsetBandwidthIntegralArray(instrument, selector_string, bandwidth_integral, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6376,7 +6376,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6429,7 +6429,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6468,7 +6468,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6501,7 +6501,7 @@ namespace nirfmxnr_grpc { int32 number_of_elements = static_cast(request->limit_fail_mask().size()); auto status = library_->SEMCfgOffsetLimitFailMaskArray(instrument, selector_string, limit_fail_mask, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6541,7 +6541,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, offset_rbw, offset_rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6591,7 +6591,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, offset_rbw, offset_rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6616,7 +6616,7 @@ namespace nirfmxnr_grpc { float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_start, relative_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6658,7 +6658,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6698,7 +6698,7 @@ namespace nirfmxnr_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6737,7 +6737,7 @@ namespace nirfmxnr_grpc { auto status = library_->SEMCfgUplinkMaskType(instrument, selector_string, uplink_mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6765,13 +6765,13 @@ namespace nirfmxnr_grpc { float64 relative_power {}; auto status = library_->SEMFetchComponentCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &peak_absolute_power, &peak_frequency, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6795,7 +6795,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->SEMFetchComponentCarrierMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_power()->Resize(actual_array_size, 0); float64* absolute_power = response->mutable_absolute_power()->mutable_data(); @@ -6812,14 +6812,14 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6847,15 +6847,15 @@ namespace nirfmxnr_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6879,7 +6879,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -6898,7 +6898,7 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -6910,12 +6910,12 @@ namespace nirfmxnr_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6943,14 +6943,14 @@ namespace nirfmxnr_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_absolute_power(total_absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_peak_relative_power(peak_relative_power); + response->set_total_absolute_power(total_absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_peak_relative_power(peak_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6974,7 +6974,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); @@ -6993,15 +6993,15 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_total_absolute_power()->Resize(actual_array_size, 0); - response->mutable_total_relative_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_peak_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); + response->mutable_total_relative_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_peak_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7025,11 +7025,11 @@ namespace nirfmxnr_grpc { int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7055,7 +7055,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -7068,14 +7068,14 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->mutable_composite_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->mutable_composite_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7101,12 +7101,12 @@ namespace nirfmxnr_grpc { float64 frequency {}; auto status = library_->SEMFetchSubblockMeasurement(instrument, selector_string, timeout, &subblock_power, &integration_bandwidth, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_subblock_power(subblock_power); - response->set_integration_bandwidth(integration_bandwidth); - response->set_frequency(frequency); + response->set_subblock_power(subblock_power); + response->set_integration_bandwidth(integration_bandwidth); + response->set_frequency(frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7129,10 +7129,10 @@ namespace nirfmxnr_grpc { float64 total_aggregated_power {}; auto status = library_->SEMFetchTotalAggregatedPower(instrument, selector_string, timeout, &total_aggregated_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_aggregated_power(total_aggregated_power); + response->set_total_aggregated_power(total_aggregated_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7159,15 +7159,15 @@ namespace nirfmxnr_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7191,7 +7191,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -7210,7 +7210,7 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -7222,12 +7222,12 @@ namespace nirfmxnr_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7255,14 +7255,14 @@ namespace nirfmxnr_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_absolute_power(total_absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_peak_relative_power(peak_relative_power); + response->set_total_absolute_power(total_absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_peak_relative_power(peak_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7286,7 +7286,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); @@ -7305,15 +7305,15 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_total_absolute_power()->Resize(actual_array_size, 0); - response->mutable_total_relative_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_peak_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); + response->mutable_total_relative_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_peak_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7352,7 +7352,7 @@ namespace nirfmxnr_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7374,7 +7374,7 @@ namespace nirfmxnr_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7399,7 +7399,7 @@ namespace nirfmxnr_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7425,7 +7425,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7450,7 +7450,7 @@ namespace nirfmxnr_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7476,7 +7476,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7510,7 +7510,7 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7553,7 +7553,7 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7587,7 +7587,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7612,7 +7612,7 @@ namespace nirfmxnr_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7638,7 +7638,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7672,7 +7672,7 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7718,7 +7718,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7747,7 +7747,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7773,7 +7773,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7817,7 +7817,7 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7851,7 +7851,7 @@ namespace nirfmxnr_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7879,7 +7879,7 @@ namespace nirfmxnr_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7905,7 +7905,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7931,7 +7931,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7956,7 +7956,7 @@ namespace nirfmxnr_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7982,7 +7982,7 @@ namespace nirfmxnr_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8008,11 +8008,11 @@ namespace nirfmxnr_grpc { float64 peak_power_maximum {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_power_mean, &peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_power_mean(average_power_mean); - response->set_peak_power_maximum(peak_power_maximum); + response->set_average_power_mean(average_power_mean); + response->set_peak_power_maximum(peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8038,7 +8038,7 @@ namespace nirfmxnr_grpc { while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); @@ -8049,13 +8049,13 @@ namespace nirfmxnr_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -8077,7 +8077,7 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8101,7 +8101,7 @@ namespace nirfmxnr_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nirfmxnr/nirfmxnr_service.h b/generated/nirfmxnr/nirfmxnr_service.h index d77c11230..feac307dc 100644 --- a/generated/nirfmxnr/nirfmxnr_service.h +++ b/generated/nirfmxnr/nirfmxnr_service.h @@ -264,7 +264,7 @@ class NiRFmxNRService final : public NiRFmxNR::Service { NiRFmxNRLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXIe_DStarB", 12},{"TimerEvent", 13}, }; std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"},{5, "RefIn2"},{6, "PXI_Clk_Master"}, }; diff --git a/generated/nirfmxspecan/nirfmxspecan_service.cpp b/generated/nirfmxspecan/nirfmxspecan_service.cpp index 1db0fb391..081035f2a 100644 --- a/generated/nirfmxspecan/nirfmxspecan_service.cpp +++ b/generated/nirfmxspecan/nirfmxspecan_service.cpp @@ -93,7 +93,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -119,7 +119,7 @@ namespace nirfmxspecan_grpc { float64 channel_spacing = request->channel_spacing(); auto status = library_->ACPCfgCarrierAndOffsets(instrument, selector_string, integration_bandwidth, number_of_offsets, channel_spacing); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -143,7 +143,7 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency = request->carrier_frequency(); auto status = library_->ACPCfgCarrierFrequency(instrument, selector_string, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -167,7 +167,7 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->ACPCfgCarrierIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -206,7 +206,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgCarrierMode(instrument, selector_string, carrier_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -246,7 +246,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->ACPCfgCarrierRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -286,7 +286,7 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->ACPCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -325,7 +325,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -364,7 +364,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -388,7 +388,7 @@ namespace nirfmxspecan_grpc { int32 number_of_carriers = request->number_of_carriers(); auto status = library_->ACPCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -412,7 +412,7 @@ namespace nirfmxspecan_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->ACPCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -468,7 +468,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffset(instrument, selector_string, offset_frequency, offset_sideband, offset_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -529,7 +529,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetArray(instrument, selector_string, offset_frequency, offset_sideband, offset_enabled, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -568,7 +568,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetFrequencyDefinition(instrument, selector_string, offset_frequency_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -592,7 +592,7 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->ACPCfgOffsetIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -617,7 +617,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->integration_bandwidth().size()); auto status = library_->ACPCfgOffsetIntegrationBandwidthArray(instrument, selector_string, integration_bandwidth, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -657,7 +657,7 @@ namespace nirfmxspecan_grpc { int32 offset_reference_specific = request->offset_reference_specific(); auto status = library_->ACPCfgOffsetPowerReference(instrument, selector_string, offset_reference_carrier, offset_reference_specific); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -707,7 +707,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetPowerReferenceArray(instrument, selector_string, offset_power_reference_carrier, offset_power_reference_specific, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -747,7 +747,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->ACPCfgOffsetRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -797,7 +797,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgOffsetRRCFilterArray(instrument, selector_string, rrc_filter_enabled, rrc_alpha, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -821,7 +821,7 @@ namespace nirfmxspecan_grpc { float64 relative_attenuation = request->relative_attenuation(); auto status = library_->ACPCfgOffsetRelativeAttenuation(instrument, selector_string, relative_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -846,7 +846,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->ACPCfgOffsetRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -885,7 +885,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -941,7 +941,7 @@ namespace nirfmxspecan_grpc { auto status = library_->ACPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -981,7 +981,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->ACPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1010,7 +1010,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->ACPFetchAbsolutePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); float32* absolute_powers_trace = response->mutable_absolute_powers_trace()->mutable_data(); @@ -1021,13 +1021,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_absolute_powers_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1054,13 +1054,13 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth {}; auto status = library_->ACPFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &total_relative_power, &carrier_offset, &integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_carrier_offset(carrier_offset); - response->set_integration_bandwidth(integration_bandwidth); + response->set_absolute_power(absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_carrier_offset(carrier_offset); + response->set_integration_bandwidth(integration_bandwidth); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1083,10 +1083,10 @@ namespace nirfmxspecan_grpc { float64 frequency_resolution {}; auto status = library_->ACPFetchFrequencyResolution(instrument, selector_string, timeout, &frequency_resolution); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_frequency_resolution(frequency_resolution); + response->set_frequency_resolution(frequency_resolution); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1112,13 +1112,13 @@ namespace nirfmxspecan_grpc { float64 upper_absolute_power {}; auto status = library_->ACPFetchOffsetMeasurement(instrument, selector_string, timeout, &lower_relative_power, &upper_relative_power, &lower_absolute_power, &upper_absolute_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_lower_relative_power(lower_relative_power); - response->set_upper_relative_power(upper_relative_power); - response->set_lower_absolute_power(lower_absolute_power); - response->set_upper_absolute_power(upper_absolute_power); + response->set_lower_relative_power(lower_relative_power); + response->set_upper_relative_power(upper_relative_power); + response->set_lower_absolute_power(lower_absolute_power); + response->set_upper_absolute_power(upper_absolute_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1142,7 +1142,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->ACPFetchOffsetMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_lower_relative_power()->Resize(actual_array_size, 0); float64* lower_relative_power = response->mutable_lower_relative_power()->mutable_data(); @@ -1159,14 +1159,14 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_lower_relative_power()->Resize(actual_array_size, 0); - response->mutable_upper_relative_power()->Resize(actual_array_size, 0); - response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); - response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_lower_relative_power()->Resize(actual_array_size, 0); + response->mutable_upper_relative_power()->Resize(actual_array_size, 0); + response->mutable_lower_absolute_power()->Resize(actual_array_size, 0); + response->mutable_upper_absolute_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1194,7 +1194,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->ACPFetchRelativePowersTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); float32* relative_powers_trace = response->mutable_relative_powers_trace()->mutable_data(); @@ -1205,13 +1205,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_relative_powers_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1238,7 +1238,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->ACPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -1249,13 +1249,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1279,10 +1279,10 @@ namespace nirfmxspecan_grpc { float64 total_carrier_power {}; auto status = library_->ACPFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_carrier_power(total_carrier_power); + response->set_total_carrier_power(total_carrier_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1309,14 +1309,14 @@ namespace nirfmxspecan_grpc { float64 offset_ch1_upper_relative_power {}; auto status = library_->ACPRead(instrument, selector_string, timeout, &carrier_absolute_power, &offset_ch0_lower_relative_power, &offset_ch0_upper_relative_power, &offset_ch1_lower_relative_power, &offset_ch1_upper_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_carrier_absolute_power(carrier_absolute_power); - response->set_offset_ch0_lower_relative_power(offset_ch0_lower_relative_power); - response->set_offset_ch0_upper_relative_power(offset_ch0_upper_relative_power); - response->set_offset_ch1_lower_relative_power(offset_ch1_lower_relative_power); - response->set_offset_ch1_upper_relative_power(offset_ch1_upper_relative_power); + response->set_carrier_absolute_power(carrier_absolute_power); + response->set_offset_ch0_lower_relative_power(offset_ch0_lower_relative_power); + response->set_offset_ch0_upper_relative_power(offset_ch0_upper_relative_power); + response->set_offset_ch1_lower_relative_power(offset_ch1_lower_relative_power); + response->set_offset_ch1_upper_relative_power(offset_ch1_upper_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1338,11 +1338,11 @@ namespace nirfmxspecan_grpc { int32 noise_calibration_data_valid {}; auto status = library_->ACPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1380,7 +1380,7 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgAMToAMCurveFit(instrument, selector_string, am_to_am_curve_fit_order, am_to_am_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1420,7 +1420,7 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgAMToPMCurveFit(instrument, selector_string, am_to_pm_curve_fit_order, am_to_pm_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1460,7 +1460,7 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->AMPMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1501,7 +1501,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->compression_level().size()); auto status = library_->AMPMCfgCompressionPoints(instrument, selector_string, compression_point_enabled, compression_level, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1525,7 +1525,7 @@ namespace nirfmxspecan_grpc { float64 dut_average_input_power = request->dut_average_input_power(); auto status = library_->AMPMCfgDUTAverageInputPower(instrument, selector_string, dut_average_input_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1549,7 +1549,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->AMPMCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1589,7 +1589,7 @@ namespace nirfmxspecan_grpc { float64 sample_rate = request->sample_rate(); auto status = library_->AMPMCfgMeasurementSampleRate(instrument, selector_string, sample_rate_mode, sample_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1628,7 +1628,7 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgReferencePowerType(instrument, selector_string, reference_power_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1687,7 +1687,7 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size, idle_duration_present, signal_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1726,7 +1726,7 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgSynchronizationMethod(instrument, selector_string, synchronization_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1782,7 +1782,7 @@ namespace nirfmxspecan_grpc { auto status = library_->AMPMCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1808,7 +1808,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchAMToAMTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_reference_powers()->Resize(actual_array_size, 0); float32* reference_powers = response->mutable_reference_powers()->mutable_data(); @@ -1823,13 +1823,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_reference_powers()->Resize(actual_array_size, 0); - response->mutable_measured_am_to_am()->Resize(actual_array_size, 0); - response->mutable_curve_fit_am_to_am()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_reference_powers()->Resize(actual_array_size, 0); + response->mutable_measured_am_to_am()->Resize(actual_array_size, 0); + response->mutable_curve_fit_am_to_am()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1854,7 +1854,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchAMToPMTrace(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_reference_powers()->Resize(actual_array_size, 0); float32* reference_powers = response->mutable_reference_powers()->mutable_data(); @@ -1869,13 +1869,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_reference_powers()->Resize(actual_array_size, 0); - response->mutable_measured_am_to_pm()->Resize(actual_array_size, 0); - response->mutable_curve_fit_am_to_pm()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_reference_powers()->Resize(actual_array_size, 0); + response->mutable_measured_am_to_pm()->Resize(actual_array_size, 0); + response->mutable_curve_fit_am_to_pm()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1900,7 +1900,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchCompressionPoints(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_input_compression_point()->Resize(actual_array_size, 0); float64* input_compression_point = response->mutable_input_compression_point()->mutable_data(); @@ -1913,12 +1913,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_input_compression_point()->Resize(actual_array_size, 0); - response->mutable_output_compression_point()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_input_compression_point()->Resize(actual_array_size, 0); + response->mutable_output_compression_point()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1943,7 +1943,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchCurveFitCoefficients(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); float32* am_to_am_coefficients = response->mutable_am_to_am_coefficients()->mutable_data(); @@ -1956,12 +1956,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); - response->mutable_am_to_pm_coefficients()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_am_to_am_coefficients()->Resize(actual_array_size, 0); + response->mutable_am_to_pm_coefficients()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1986,11 +1986,11 @@ namespace nirfmxspecan_grpc { float64 am_to_pm_residual {}; auto status = library_->AMPMFetchCurveFitResidual(instrument, selector_string, timeout, &am_to_am_residual, &am_to_pm_residual); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_am_to_am_residual(am_to_am_residual); - response->set_am_to_pm_residual(am_to_pm_residual); + response->set_am_to_am_residual(am_to_am_residual); + response->set_am_to_pm_residual(am_to_pm_residual); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2015,12 +2015,12 @@ namespace nirfmxspecan_grpc { float64 mean_rms_evm {}; auto status = library_->AMPMFetchDUTCharacteristics(instrument, selector_string, timeout, &mean_linear_gain, &one_db_compression_point, &mean_rms_evm); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_linear_gain(mean_linear_gain); - response->set_one_db_compression_point(one_db_compression_point); - response->set_mean_rms_evm(mean_rms_evm); + response->set_mean_linear_gain(mean_linear_gain); + response->set_one_db_compression_point(one_db_compression_point); + response->set_mean_rms_evm(mean_rms_evm); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2045,12 +2045,12 @@ namespace nirfmxspecan_grpc { float64 mean_phase_error {}; auto status = library_->AMPMFetchError(instrument, selector_string, timeout, &gain_error_range, &phase_error_range, &mean_phase_error); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_gain_error_range(gain_error_range); - response->set_phase_error_range(phase_error_range); - response->set_mean_phase_error(mean_phase_error); + response->set_gain_error_range(gain_error_range); + response->set_phase_error_range(phase_error_range); + response->set_mean_phase_error(mean_phase_error); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2076,7 +2076,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector processed_mean_acquired_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -2086,20 +2086,20 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - convert_to_grpc(processed_mean_acquired_waveform, response->mutable_processed_mean_acquired_waveform()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_processed_mean_acquired_waveform()->size(); - if (shrunk_size != current_size) { - response->mutable_processed_mean_acquired_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_x0(x0); + response->set_dx(dx); + convert_to_grpc(processed_mean_acquired_waveform, response->mutable_processed_mean_acquired_waveform()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_processed_mean_acquired_waveform()->size(); + if (shrunk_size != current_size) { + response->mutable_processed_mean_acquired_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2126,7 +2126,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector processed_reference_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -2136,20 +2136,20 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - convert_to_grpc(processed_reference_waveform, response->mutable_processed_reference_waveform()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_processed_reference_waveform()->size(); - if (shrunk_size != current_size) { - response->mutable_processed_reference_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_x0(x0); + response->set_dx(dx); + convert_to_grpc(processed_reference_waveform, response->mutable_processed_reference_waveform()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_processed_reference_waveform()->size(); + if (shrunk_size != current_size) { + response->mutable_processed_reference_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2176,7 +2176,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchRelativePhaseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_relative_phase()->Resize(actual_array_size, 0); float32* relative_phase = response->mutable_relative_phase()->mutable_data(); @@ -2187,13 +2187,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_relative_phase()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_relative_phase()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2220,7 +2220,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->AMPMFetchRelativePowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_relative_power()->Resize(actual_array_size, 0); float32* relative_power = response->mutable_relative_power()->mutable_data(); @@ -2231,13 +2231,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2259,7 +2259,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2289,7 +2289,7 @@ namespace nirfmxspecan_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2319,7 +2319,7 @@ namespace nirfmxspecan_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2345,10 +2345,10 @@ namespace nirfmxspecan_grpc { float64 reference_level {}; auto status = library_->AutoLevel(instrument, selector_string, bandwidth, measurement_interval, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_level(reference_level); + response->set_reference_level(reference_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2370,7 +2370,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildCarrierString(selector_string, carrier_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2384,11 +2384,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2411,7 +2411,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildHarmonicString(selector_string, harmonic_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2425,11 +2425,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2452,7 +2452,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildIntermodString(selector_string, intermod_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2466,11 +2466,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2494,7 +2494,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildListStepString(list_name, result_name, step_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -2508,11 +2508,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -2535,7 +2535,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildListString(list_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -2549,11 +2549,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -2576,7 +2576,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildMarkerString(selector_string, marker_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2590,11 +2590,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2617,7 +2617,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2631,11 +2631,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2660,7 +2660,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildRangeSpurString(signal_name, result_name, range_number, spur_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -2674,11 +2674,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -2701,7 +2701,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildRangeString(selector_string, range_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2715,11 +2715,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2742,7 +2742,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSegmentString(selector_string, segment_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2756,11 +2756,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2783,7 +2783,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -2797,11 +2797,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -2824,7 +2824,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->BuildSpurString(selector_string, spur_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -2838,11 +2838,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -2865,7 +2865,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->CCDFCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2889,7 +2889,7 @@ namespace nirfmxspecan_grpc { int32 number_of_records = request->number_of_records(); auto status = library_->CCDFCfgNumberOfRecords(instrument, selector_string, number_of_records); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2930,7 +2930,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->CCDFCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2986,7 +2986,7 @@ namespace nirfmxspecan_grpc { auto status = library_->CCDFCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3016,15 +3016,15 @@ namespace nirfmxspecan_grpc { float64 one_ten_thousandth_percent_power {}; auto status = library_->CCDFFetchBasicPowerProbabilities(instrument, selector_string, timeout, &ten_percent_power, &one_percent_power, &one_tenth_percent_power, &one_hundredth_percent_power, &one_thousandth_percent_power, &one_ten_thousandth_percent_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ten_percent_power(ten_percent_power); - response->set_one_percent_power(one_percent_power); - response->set_one_tenth_percent_power(one_tenth_percent_power); - response->set_one_hundredth_percent_power(one_hundredth_percent_power); - response->set_one_thousandth_percent_power(one_thousandth_percent_power); - response->set_one_ten_thousandth_percent_power(one_ten_thousandth_percent_power); + response->set_ten_percent_power(ten_percent_power); + response->set_one_percent_power(one_percent_power); + response->set_one_tenth_percent_power(one_tenth_percent_power); + response->set_one_hundredth_percent_power(one_hundredth_percent_power); + response->set_one_thousandth_percent_power(one_thousandth_percent_power); + response->set_one_ten_thousandth_percent_power(one_ten_thousandth_percent_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3050,7 +3050,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->CCDFFetchGaussianProbabilitiesTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_gaussian_probabilities()->Resize(actual_array_size, 0); float32* gaussian_probabilities = response->mutable_gaussian_probabilities()->mutable_data(); @@ -3061,13 +3061,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_gaussian_probabilities()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_gaussian_probabilities()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3094,13 +3094,13 @@ namespace nirfmxspecan_grpc { int32 measured_samples_count {}; auto status = library_->CCDFFetchPower(instrument, selector_string, timeout, &mean_power, &mean_power_percentile, &peak_power, &measured_samples_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_power(mean_power); - response->set_mean_power_percentile(mean_power_percentile); - response->set_peak_power(peak_power); - response->set_measured_samples_count(measured_samples_count); + response->set_mean_power(mean_power); + response->set_mean_power_percentile(mean_power_percentile); + response->set_peak_power(peak_power); + response->set_measured_samples_count(measured_samples_count); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3126,7 +3126,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->CCDFFetchProbabilitiesTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_probabilities()->Resize(actual_array_size, 0); float32* probabilities = response->mutable_probabilities()->mutable_data(); @@ -3137,13 +3137,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_probabilities()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_probabilities()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3170,13 +3170,13 @@ namespace nirfmxspecan_grpc { int32 measured_samples_count {}; auto status = library_->CCDFRead(instrument, selector_string, timeout, &mean_power, &mean_power_percentile, &peak_power, &measured_samples_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_power(mean_power); - response->set_mean_power_percentile(mean_power_percentile); - response->set_peak_power(peak_power); - response->set_measured_samples_count(measured_samples_count); + response->set_mean_power(mean_power); + response->set_mean_power_percentile(mean_power_percentile); + response->set_peak_power(peak_power); + response->set_measured_samples_count(measured_samples_count); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3230,7 +3230,7 @@ namespace nirfmxspecan_grpc { auto status = library_->CHPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3254,7 +3254,7 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency = request->carrier_frequency(); auto status = library_->CHPCfgCarrierOffset(instrument, selector_string, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3294,7 +3294,7 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->CHPCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3318,7 +3318,7 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->CHPCfgIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3342,7 +3342,7 @@ namespace nirfmxspecan_grpc { int32 number_of_carriers = request->number_of_carriers(); auto status = library_->CHPCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3398,7 +3398,7 @@ namespace nirfmxspecan_grpc { auto status = library_->CHPCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3438,7 +3438,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->CHPCfgRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3462,7 +3462,7 @@ namespace nirfmxspecan_grpc { float64 span = request->span(); auto status = library_->CHPCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3502,7 +3502,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->CHPCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3529,12 +3529,12 @@ namespace nirfmxspecan_grpc { float64 relative_power {}; auto status = library_->CHPFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &psd, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_psd(psd); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_psd(psd); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3560,7 +3560,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->CHPFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -3571,13 +3571,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3601,10 +3601,10 @@ namespace nirfmxspecan_grpc { float64 total_carrier_power {}; auto status = library_->CHPFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_carrier_power(total_carrier_power); + response->set_total_carrier_power(total_carrier_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3628,11 +3628,11 @@ namespace nirfmxspecan_grpc { float64 psd {}; auto status = library_->CHPRead(instrument, selector_string, timeout, &absolute_power, &psd); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_psd(psd); + response->set_absolute_power(absolute_power); + response->set_psd(psd); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3654,11 +3654,11 @@ namespace nirfmxspecan_grpc { int32 noise_calibration_data_valid {}; auto status = library_->CHPValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3717,7 +3717,7 @@ namespace nirfmxspecan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3741,7 +3741,7 @@ namespace nirfmxspecan_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3765,7 +3765,7 @@ namespace nirfmxspecan_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3809,7 +3809,7 @@ namespace nirfmxspecan_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3869,7 +3869,7 @@ namespace nirfmxspecan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_level, iq_power_edge_slope, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3909,7 +3909,7 @@ namespace nirfmxspecan_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3935,7 +3935,7 @@ namespace nirfmxspecan_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgRF(instrument, selector_string, center_frequency, reference_level, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3975,7 +3975,7 @@ namespace nirfmxspecan_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3999,7 +3999,7 @@ namespace nirfmxspecan_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4024,7 +4024,7 @@ namespace nirfmxspecan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4048,10 +4048,10 @@ namespace nirfmxspecan_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4072,7 +4072,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4095,7 +4095,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4118,7 +4118,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNoiseCalibrationDatabase(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4142,7 +4142,7 @@ namespace nirfmxspecan_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4166,7 +4166,7 @@ namespace nirfmxspecan_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4189,7 +4189,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4212,7 +4212,7 @@ namespace nirfmxspecan_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->CreateList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4236,10 +4236,10 @@ namespace nirfmxspecan_grpc { int32 created_step_index {}; auto status = library_->CreateListStep(instrument, selector_string, &created_step_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_created_step_index(created_step_index); + response->set_created_step_index(created_step_index); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4260,7 +4260,7 @@ namespace nirfmxspecan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4310,7 +4310,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->DPDApplyDigitalPredistortion(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, measurement_timeout, &x0_out, &dx_out, nullptr, 0, &actual_array_size, &papr, &power_offset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector waveform_out(actual_array_size, NIComplexSingle()); auto array_size_out = actual_array_size; @@ -4320,22 +4320,22 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0_out(x0_out); - response->set_dx_out(dx_out); - convert_to_grpc(waveform_out, response->mutable_waveform_out()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_waveform_out()->size(); - if (shrunk_size != current_size) { - response->mutable_waveform_out()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_x0_out(x0_out); + response->set_dx_out(dx_out); + convert_to_grpc(waveform_out, response->mutable_waveform_out()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_waveform_out()->size(); + if (shrunk_size != current_size) { + response->mutable_waveform_out()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); - response->set_papr(papr); - response->set_power_offset(power_offset); + } + response->set_actual_array_size(actual_array_size); + response->set_papr(papr); + response->set_power_offset(power_offset); return ::grpc::Status::OK; } } @@ -4382,7 +4382,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->DPDApplyPreDPDSignalConditioning(instrument, selector_string, x0_in, dx_in, waveform_in.data(), array_size_in, idle_duration_present, &x0_out, &dx_out, nullptr, 0, &actual_array_size, &papr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector waveform_out(actual_array_size, NIComplexSingle()); auto array_size_out = actual_array_size; @@ -4392,21 +4392,21 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0_out(x0_out); - response->set_dx_out(dx_out); - convert_to_grpc(waveform_out, response->mutable_waveform_out()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_waveform_out()->size(); - if (shrunk_size != current_size) { - response->mutable_waveform_out()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_x0_out(x0_out); + response->set_dx_out(dx_out); + convert_to_grpc(waveform_out, response->mutable_waveform_out()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_waveform_out()->size(); + if (shrunk_size != current_size) { + response->mutable_waveform_out()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); - response->set_papr(papr); + } + response->set_actual_array_size(actual_array_size); + response->set_papr(papr); return ::grpc::Status::OK; } } @@ -4444,7 +4444,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDConfigurationInput(instrument, selector_string, configuration_input); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4483,7 +4483,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDLookupTableCorrectionType(instrument, selector_string, lut_correction_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4522,7 +4522,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDMemoryModelCorrectionType(instrument, selector_string, memory_model_correction_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4547,7 +4547,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->dpd_polynomial().size()); auto status = library_->DPDCfgApplyDPDUserDPDPolynomial(instrument, selector_string, dpd_polynomial.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4589,7 +4589,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgApplyDPDUserLookupTable(instrument, selector_string, lut_input_powers, lut_complex_gains.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4629,7 +4629,7 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->DPDCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4668,7 +4668,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgDPDModel(instrument, selector_string, dpd_model); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4692,7 +4692,7 @@ namespace nirfmxspecan_grpc { float64 dut_average_input_power = request->dut_average_input_power(); auto status = library_->DPDCfgDUTAverageInputPower(instrument, selector_string, dut_average_input_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4721,7 +4721,7 @@ namespace nirfmxspecan_grpc { int32 memory_polynomial_maximum_lag = request->memory_polynomial_maximum_lag(); auto status = library_->DPDCfgGeneralizedMemoryPolynomialCrossTerms(instrument, selector_string, memory_polynomial_lead_order, memory_polynomial_lag_order, memory_polynomial_lead_memory_depth, memory_polynomial_lag_memory_depth, memory_polynomial_maximum_lead, memory_polynomial_maximum_lag); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4760,7 +4760,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgIterativeDPDEnabled(instrument, selector_string, iterative_dpd_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4800,7 +4800,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableAMToAMCurveFit(instrument, selector_string, am_to_am_curve_fit_order, am_to_am_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4840,7 +4840,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableAMToPMCurveFit(instrument, selector_string, am_to_pm_curve_fit_order, am_to_pm_curve_fit_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4864,7 +4864,7 @@ namespace nirfmxspecan_grpc { float64 step_size = request->step_size(); auto status = library_->DPDCfgLookupTableStepSize(instrument, selector_string, step_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4920,7 +4920,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4959,7 +4959,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgLookupTableType(instrument, selector_string, lookup_table_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -4983,7 +4983,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->DPDCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5023,7 +5023,7 @@ namespace nirfmxspecan_grpc { float64 sample_rate = request->sample_rate(); auto status = library_->DPDCfgMeasurementSampleRate(instrument, selector_string, sample_rate_mode, sample_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5048,7 +5048,7 @@ namespace nirfmxspecan_grpc { int32 memory_polynomial_memory_depth = request->memory_polynomial_memory_depth(); auto status = library_->DPDCfgMemoryPolynomial(instrument, selector_string, memory_polynomial_order, memory_polynomial_memory_depth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5073,7 +5073,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->previous_dpd_polynomial().size()); auto status = library_->DPDCfgPreviousDPDPolynomial(instrument, selector_string, previous_dpd_polynomial.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5132,7 +5132,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size, idle_duration_present, signal_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5171,7 +5171,7 @@ namespace nirfmxspecan_grpc { auto status = library_->DPDCfgSynchronizationMethod(instrument, selector_string, synchronization_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5196,10 +5196,10 @@ namespace nirfmxspecan_grpc { float64 pre_cfr_papr {}; auto status = library_->DPDFetchApplyDPDPreCFRPAPR(instrument, selector_string, timeout, &pre_cfr_papr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pre_cfr_papr(pre_cfr_papr); + response->set_pre_cfr_papr(pre_cfr_papr); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5222,10 +5222,10 @@ namespace nirfmxspecan_grpc { float64 average_gain {}; auto status = library_->DPDFetchAverageGain(instrument, selector_string, timeout, &average_gain); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_gain(average_gain); + response->set_average_gain(average_gain); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5249,7 +5249,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->DPDFetchDPDPolynomial(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector dpd_polynomial(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5259,18 +5259,18 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(dpd_polynomial, response->mutable_dpd_polynomial()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_dpd_polynomial()->size(); - if (shrunk_size != current_size) { - response->mutable_dpd_polynomial()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(dpd_polynomial, response->mutable_dpd_polynomial()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_dpd_polynomial()->size(); + if (shrunk_size != current_size) { + response->mutable_dpd_polynomial()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5295,7 +5295,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->DPDFetchLookupTable(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_input_powers()->Resize(actual_array_size, 0); float32* input_powers = response->mutable_input_powers()->mutable_data(); @@ -5307,19 +5307,19 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_input_powers()->Resize(actual_array_size, 0); - convert_to_grpc(complex_gains, response->mutable_complex_gains()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_complex_gains()->size(); - if (shrunk_size != current_size) { - response->mutable_complex_gains()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->mutable_input_powers()->Resize(actual_array_size, 0); + convert_to_grpc(complex_gains, response->mutable_complex_gains()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_complex_gains()->size(); + if (shrunk_size != current_size) { + response->mutable_complex_gains()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5343,10 +5343,10 @@ namespace nirfmxspecan_grpc { float64 nmse {}; auto status = library_->DPDFetchNMSE(instrument, selector_string, timeout, &nmse); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_nmse(nmse); + response->set_nmse(nmse); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5372,7 +5372,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->DPDFetchProcessedMeanAcquiredWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector processed_mean_acquired_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5382,20 +5382,20 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - convert_to_grpc(processed_mean_acquired_waveform, response->mutable_processed_mean_acquired_waveform()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_processed_mean_acquired_waveform()->size(); - if (shrunk_size != current_size) { - response->mutable_processed_mean_acquired_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_x0(x0); + response->set_dx(dx); + convert_to_grpc(processed_mean_acquired_waveform, response->mutable_processed_mean_acquired_waveform()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_processed_mean_acquired_waveform()->size(); + if (shrunk_size != current_size) { + response->mutable_processed_mean_acquired_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5422,7 +5422,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->DPDFetchProcessedReferenceWaveform(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector processed_reference_waveform(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5432,20 +5432,20 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - convert_to_grpc(processed_reference_waveform, response->mutable_processed_reference_waveform()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_processed_reference_waveform()->size(); - if (shrunk_size != current_size) { - response->mutable_processed_reference_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_x0(x0); + response->set_dx(dx); + convert_to_grpc(processed_reference_waveform, response->mutable_processed_reference_waveform()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_processed_reference_waveform()->size(); + if (shrunk_size != current_size) { + response->mutable_processed_reference_waveform()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5467,7 +5467,7 @@ namespace nirfmxspecan_grpc { char* list_name = (char*)request->list_name().c_str(); auto status = library_->DeleteList(instrument, list_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5490,7 +5490,7 @@ namespace nirfmxspecan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5513,7 +5513,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5569,7 +5569,7 @@ namespace nirfmxspecan_grpc { auto status = library_->FCntCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5593,7 +5593,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->FCntCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5634,7 +5634,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->FCntCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5690,7 +5690,7 @@ namespace nirfmxspecan_grpc { auto status = library_->FCntCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -5715,10 +5715,10 @@ namespace nirfmxspecan_grpc { float64 allan_deviation {}; auto status = library_->FCntFetchAllanDeviation(instrument, selector_string, timeout, &allan_deviation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_allan_deviation(allan_deviation); + response->set_allan_deviation(allan_deviation); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5744,7 +5744,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->FCntFetchFrequencyTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_frequency_trace()->Resize(actual_array_size, 0); float32* frequency_trace = response->mutable_frequency_trace()->mutable_data(); @@ -5755,13 +5755,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_frequency_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_frequency_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5787,12 +5787,12 @@ namespace nirfmxspecan_grpc { float64 mean_phase {}; auto status = library_->FCntFetchMeasurement(instrument, selector_string, timeout, &average_relative_frequency, &average_absolute_frequency, &mean_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_relative_frequency(average_relative_frequency); - response->set_average_absolute_frequency(average_absolute_frequency); - response->set_mean_phase(mean_phase); + response->set_average_relative_frequency(average_relative_frequency); + response->set_average_absolute_frequency(average_absolute_frequency); + response->set_mean_phase(mean_phase); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5818,7 +5818,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->FCntFetchPhaseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_phase_trace()->Resize(actual_array_size, 0); float32* phase_trace = response->mutable_phase_trace()->mutable_data(); @@ -5829,13 +5829,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_phase_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_phase_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5862,7 +5862,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->FCntFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power_trace()->Resize(actual_array_size, 0); float32* power_trace = response->mutable_power_trace()->mutable_data(); @@ -5873,13 +5873,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power_trace()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power_trace()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5905,12 +5905,12 @@ namespace nirfmxspecan_grpc { float64 mean_phase {}; auto status = library_->FCntRead(instrument, selector_string, timeout, &average_relative_frequency, &average_absolute_frequency, &mean_phase); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_relative_frequency(average_relative_frequency); - response->set_average_absolute_frequency(average_absolute_frequency); - response->set_mean_phase(mean_phase); + response->set_average_relative_frequency(average_relative_frequency); + response->set_average_absolute_frequency(average_absolute_frequency); + response->set_mean_phase(mean_phase); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5934,7 +5934,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string result_names; if (actual_result_names_size > 0) { @@ -5947,13 +5947,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_actual_result_names_size(actual_result_names_size); - response->set_default_result_exists(default_result_exists); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_actual_result_names_size(actual_result_names_size); + response->set_default_result_exists(default_result_exists); return ::grpc::Status::OK; } } @@ -5977,10 +5977,10 @@ namespace nirfmxspecan_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6004,7 +6004,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -6015,11 +6015,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6043,10 +6043,10 @@ namespace nirfmxspecan_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6070,7 +6070,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -6081,11 +6081,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6109,10 +6109,10 @@ namespace nirfmxspecan_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6135,16 +6135,16 @@ namespace nirfmxspecan_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_attr_val(checked_convert_attr_val(attr_val)); - response->set_attr_val_raw(attr_val); + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_attr_val(checked_convert_attr_val(attr_val)); + response->set_attr_val_raw(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6168,7 +6168,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); @@ -6179,14 +6179,14 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxspecan_grpc::NiRFmxSpecAnInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -6196,8 +6196,8 @@ namespace nirfmxspecan_grpc { [&](auto x) { return checked_convert_attr_val(x); }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6221,10 +6221,10 @@ namespace nirfmxspecan_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6248,7 +6248,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -6259,11 +6259,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6287,10 +6287,10 @@ namespace nirfmxspecan_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6314,7 +6314,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; @@ -6324,7 +6324,7 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_attr_val()->Clear(); @@ -6336,8 +6336,8 @@ namespace nirfmxspecan_grpc { [&](auto x) { return x; }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6362,7 +6362,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; @@ -6372,18 +6372,18 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6408,7 +6408,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -6418,18 +6418,18 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6454,7 +6454,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -6468,11 +6468,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -6496,10 +6496,10 @@ namespace nirfmxspecan_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6522,10 +6522,10 @@ namespace nirfmxspecan_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6549,7 +6549,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -6560,11 +6560,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6589,7 +6589,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -6600,11 +6600,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6628,10 +6628,10 @@ namespace nirfmxspecan_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6655,7 +6655,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; @@ -6665,12 +6665,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - response->mutable_attr_val()->resize(actual_array_size); - response->set_actual_array_size(actual_array_size); + response->set_attr_val(attr_val); + response->mutable_attr_val()->resize(actual_array_size); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6693,7 +6693,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -6708,12 +6708,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -6737,7 +6737,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -6751,11 +6751,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -6793,7 +6793,7 @@ namespace nirfmxspecan_grpc { auto status = library_->HarmCfgAutoHarmonics(instrument, selector_string, auto_harmonics_setup_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6849,7 +6849,7 @@ namespace nirfmxspecan_grpc { auto status = library_->HarmCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6873,7 +6873,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->HarmCfgFundamentalMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6914,7 +6914,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->HarmCfgFundamentalRBW(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6956,7 +6956,7 @@ namespace nirfmxspecan_grpc { float64 harmonic_measurement_interval = request->harmonic_measurement_interval(); auto status = library_->HarmCfgHarmonic(instrument, selector_string, harmonic_order, harmonic_bandwidth, harmonic_enabled, harmonic_measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7012,7 +7012,7 @@ namespace nirfmxspecan_grpc { auto status = library_->HarmCfgHarmonicArray(instrument, selector_string, harmonic_order, harmonic_bandwidth, harmonic_enabled, harmonic_measurement_interval, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7036,7 +7036,7 @@ namespace nirfmxspecan_grpc { int32 number_of_harmonics = request->number_of_harmonics(); auto status = library_->HarmCfgNumberOfHarmonics(instrument, selector_string, number_of_harmonics); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7064,13 +7064,13 @@ namespace nirfmxspecan_grpc { float64 frequency {}; auto status = library_->HarmFetchHarmonicMeasurement(instrument, selector_string, timeout, &average_relative_power, &average_absolute_power, &rbw, &frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_relative_power(average_relative_power); - response->set_average_absolute_power(average_absolute_power); - response->set_rbw(rbw); - response->set_frequency(frequency); + response->set_average_relative_power(average_relative_power); + response->set_average_absolute_power(average_absolute_power); + response->set_rbw(rbw); + response->set_frequency(frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7094,7 +7094,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->HarmFetchHarmonicMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_average_relative_power()->Resize(actual_array_size, 0); float64* average_relative_power = response->mutable_average_relative_power()->mutable_data(); @@ -7111,14 +7111,14 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_average_relative_power()->Resize(actual_array_size, 0); - response->mutable_average_absolute_power()->Resize(actual_array_size, 0); - response->mutable_rbw()->Resize(actual_array_size, 0); - response->mutable_frequency()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_average_relative_power()->Resize(actual_array_size, 0); + response->mutable_average_absolute_power()->Resize(actual_array_size, 0); + response->mutable_rbw()->Resize(actual_array_size, 0); + response->mutable_frequency()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7145,7 +7145,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->HarmFetchHarmonicPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); @@ -7156,13 +7156,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7188,12 +7188,12 @@ namespace nirfmxspecan_grpc { float64 fundamental_frequency {}; auto status = library_->HarmFetchTHD(instrument, selector_string, timeout, &total_harmonic_distortion, &average_fundamental_power, &fundamental_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_harmonic_distortion(total_harmonic_distortion); - response->set_average_fundamental_power(average_fundamental_power); - response->set_fundamental_frequency(fundamental_frequency); + response->set_total_harmonic_distortion(total_harmonic_distortion); + response->set_average_fundamental_power(average_fundamental_power); + response->set_fundamental_frequency(fundamental_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7217,11 +7217,11 @@ namespace nirfmxspecan_grpc { float64 average_fundamental_power {}; auto status = library_->HarmRead(instrument, selector_string, timeout, &total_harmonic_distortion, &average_fundamental_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_harmonic_distortion(total_harmonic_distortion); - response->set_average_fundamental_power(average_fundamental_power); + response->set_total_harmonic_distortion(total_harmonic_distortion); + response->set_average_fundamental_power(average_fundamental_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7259,7 +7259,7 @@ namespace nirfmxspecan_grpc { int32 maximum_intermod_order = request->maximum_intermod_order(); auto status = library_->IMCfgAutoIntermodsSetup(instrument, selector_string, auto_intermods_setup_enabled, maximum_intermod_order); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7315,7 +7315,7 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7355,7 +7355,7 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->IMCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7394,7 +7394,7 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgFrequencyDefinition(instrument, selector_string, frequency_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7419,7 +7419,7 @@ namespace nirfmxspecan_grpc { float64 upper_tone_frequency = request->upper_tone_frequency(); auto status = library_->IMCfgFundamentalTones(instrument, selector_string, lower_tone_frequency, upper_tone_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7477,7 +7477,7 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgIntermod(instrument, selector_string, intermod_order, lower_intermod_frequency, upper_intermod_frequency, intermod_side, intermod_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7544,7 +7544,7 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgIntermodArray(instrument, selector_string, intermod_order, lower_intermod_frequency, upper_intermod_frequency, intermod_side, intermod_enabled, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7583,7 +7583,7 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7607,7 +7607,7 @@ namespace nirfmxspecan_grpc { int32 number_of_intermods = request->number_of_intermods(); auto status = library_->IMCfgNumberOfIntermods(instrument, selector_string, number_of_intermods); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7663,7 +7663,7 @@ namespace nirfmxspecan_grpc { auto status = library_->IMCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7703,7 +7703,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->IMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7729,11 +7729,11 @@ namespace nirfmxspecan_grpc { float64 upper_tone_power {}; auto status = library_->IMFetchFundamentalMeasurement(instrument, selector_string, timeout, &lower_tone_power, &upper_tone_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_lower_tone_power(lower_tone_power); - response->set_upper_tone_power(upper_tone_power); + response->set_lower_tone_power(lower_tone_power); + response->set_upper_tone_power(upper_tone_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7759,13 +7759,13 @@ namespace nirfmxspecan_grpc { float64 upper_output_intercept_power {}; auto status = library_->IMFetchInterceptPower(instrument, selector_string, timeout, &intermod_order, &worst_case_output_intercept_power, &lower_output_intercept_power, &upper_output_intercept_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_intermod_order(intermod_order); - response->set_worst_case_output_intercept_power(worst_case_output_intercept_power); - response->set_lower_output_intercept_power(lower_output_intercept_power); - response->set_upper_output_intercept_power(upper_output_intercept_power); + response->set_intermod_order(intermod_order); + response->set_worst_case_output_intercept_power(worst_case_output_intercept_power); + response->set_lower_output_intercept_power(lower_output_intercept_power); + response->set_upper_output_intercept_power(upper_output_intercept_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7789,7 +7789,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->IMFetchInterceptPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_intermod_order()->Resize(actual_array_size, 0); int32* intermod_order = reinterpret_cast(response->mutable_intermod_order()->mutable_data()); @@ -7806,14 +7806,14 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_intermod_order()->Resize(actual_array_size, 0); - response->mutable_worst_case_output_intercept_power()->Resize(actual_array_size, 0); - response->mutable_lower_output_intercept_power()->Resize(actual_array_size, 0); - response->mutable_upper_output_intercept_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_intermod_order()->Resize(actual_array_size, 0); + response->mutable_worst_case_output_intercept_power()->Resize(actual_array_size, 0); + response->mutable_lower_output_intercept_power()->Resize(actual_array_size, 0); + response->mutable_upper_output_intercept_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7839,12 +7839,12 @@ namespace nirfmxspecan_grpc { float64 upper_intermod_power {}; auto status = library_->IMFetchIntermodMeasurement(instrument, selector_string, timeout, &intermod_order, &lower_intermod_power, &upper_intermod_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_intermod_order(intermod_order); - response->set_lower_intermod_power(lower_intermod_power); - response->set_upper_intermod_power(upper_intermod_power); + response->set_intermod_order(intermod_order); + response->set_lower_intermod_power(lower_intermod_power); + response->set_upper_intermod_power(upper_intermod_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7868,7 +7868,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->IMFetchIntermodMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_intermod_order()->Resize(actual_array_size, 0); int32* intermod_order = reinterpret_cast(response->mutable_intermod_order()->mutable_data()); @@ -7883,13 +7883,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_intermod_order()->Resize(actual_array_size, 0); - response->mutable_lower_intermod_power()->Resize(actual_array_size, 0); - response->mutable_upper_intermod_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_intermod_order()->Resize(actual_array_size, 0); + response->mutable_lower_intermod_power()->Resize(actual_array_size, 0); + response->mutable_upper_intermod_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7917,7 +7917,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->IMFetchSpectrum(instrument, selector_string, timeout, spectrum_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -7928,13 +7928,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7960,7 +7960,7 @@ namespace nirfmxspecan_grpc { float64 pretrigger_time = request->pretrigger_time(); auto status = library_->IQCfgAcquisition(instrument, selector_string, sample_rate, number_of_records, acquisition_time, pretrigger_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8000,7 +8000,7 @@ namespace nirfmxspecan_grpc { float64 bandwidth = request->bandwidth(); auto status = library_->IQCfgBandwidth(instrument, selector_string, bandwidth_auto, bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8030,7 +8030,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->IQFetchData(instrument, selector_string, timeout, record_to_fetch, samples_to_read, &t0, &dt, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector data(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -8040,20 +8040,20 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_t0(t0); - response->set_dt(dt); - convert_to_grpc(data, response->mutable_data()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_data()->size(); - if (shrunk_size != current_size) { - response->mutable_data()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_t0(t0); + response->set_dt(dt); + convert_to_grpc(data, response->mutable_data()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_data()->size(); + if (shrunk_size != current_size) { + response->mutable_data()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -8076,10 +8076,10 @@ namespace nirfmxspecan_grpc { int32 records_done {}; auto status = library_->IQGetRecordsDone(instrument, selector_string, &records_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_records_done(records_done); + response->set_records_done(records_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8109,11 +8109,11 @@ namespace nirfmxspecan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXSPECAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); - response->set_is_new_session(is_new_session); + response->mutable_instrument()->set_id(session_id); + response->set_is_new_session(is_new_session); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8145,10 +8145,10 @@ namespace nirfmxspecan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXSPECAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8173,7 +8173,7 @@ namespace nirfmxspecan_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8197,7 +8197,7 @@ namespace nirfmxspecan_grpc { int32 number_of_markers = request->number_of_markers(); auto status = library_->MarkerCfgNumberOfMarkers(instrument, selector_string, number_of_markers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8237,7 +8237,7 @@ namespace nirfmxspecan_grpc { float64 peak_excursion = request->peak_excursion(); auto status = library_->MarkerCfgPeakExcursion(instrument, selector_string, peak_excursion_enabled, peak_excursion); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8261,7 +8261,7 @@ namespace nirfmxspecan_grpc { int32 reference_marker = request->reference_marker(); auto status = library_->MarkerCfgReferenceMarker(instrument, selector_string, reference_marker); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8301,7 +8301,7 @@ namespace nirfmxspecan_grpc { float64 threshold = request->threshold(); auto status = library_->MarkerCfgThreshold(instrument, selector_string, threshold_enabled, threshold); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8340,7 +8340,7 @@ namespace nirfmxspecan_grpc { auto status = library_->MarkerCfgTrace(instrument, selector_string, trace); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8379,7 +8379,7 @@ namespace nirfmxspecan_grpc { auto status = library_->MarkerCfgType(instrument, selector_string, marker_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8403,7 +8403,7 @@ namespace nirfmxspecan_grpc { float64 marker_x_location = request->marker_x_location(); auto status = library_->MarkerCfgXLocation(instrument, selector_string, marker_x_location); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8428,11 +8428,11 @@ namespace nirfmxspecan_grpc { float64 marker_y_location {}; auto status = library_->MarkerFetchXY(instrument, selector_string, &marker_x_location, &marker_y_location); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_marker_x_location(marker_x_location); - response->set_marker_y_location(marker_y_location); + response->set_marker_x_location(marker_x_location); + response->set_marker_y_location(marker_y_location); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8470,10 +8470,10 @@ namespace nirfmxspecan_grpc { int32 next_peak_found {}; auto status = library_->MarkerNextPeak(instrument, selector_string, next_peak, &next_peak_found); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_next_peak_found(next_peak_found); + response->set_next_peak_found(next_peak_found); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8495,10 +8495,10 @@ namespace nirfmxspecan_grpc { int32 number_of_peaks {}; auto status = library_->MarkerPeakSearch(instrument, selector_string, &number_of_peaks); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_number_of_peaks(number_of_peaks); + response->set_number_of_peaks(number_of_peaks); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8536,7 +8536,7 @@ namespace nirfmxspecan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->NFCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8595,7 +8595,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgCalibrationLoss(instrument, selector_string, calibration_loss_compensation_enabled, calibration_loss_frequency, calibration_loss, calibration_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8646,7 +8646,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgColdSourceDUTSParameters(instrument, selector_string, dut_s_parameters_frequency, dut_s21, dut_s12, dut_s11, dut_s22, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8689,7 +8689,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgColdSourceInputTermination(instrument, selector_string, termination_vswr, termination_vswr_frequency, termination_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8728,7 +8728,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgColdSourceMode(instrument, selector_string, cold_source_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8787,7 +8787,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgDUTInputLoss(instrument, selector_string, dut_input_loss_compensation_enabled, dut_input_loss_frequency, dut_input_loss, dut_input_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8846,7 +8846,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgDUTOutputLoss(instrument, selector_string, dut_output_loss_compensation_enabled, dut_output_loss_frequency, dut_output_loss, dut_output_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8871,7 +8871,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->frequency_list().size()); auto status = library_->NFCfgFrequencyList(instrument, selector_string, frequency_list, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8897,7 +8897,7 @@ namespace nirfmxspecan_grpc { int32 number_of_points = request->number_of_points(); auto status = library_->NFCfgFrequencyListStartStopPoints(instrument, selector_string, start_frequency, stop_frequency, number_of_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8923,7 +8923,7 @@ namespace nirfmxspecan_grpc { float64 step_size = request->step_size(); auto status = library_->NFCfgFrequencyListStartStopStep(instrument, selector_string, start_frequency, stop_frequency, step_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8947,7 +8947,7 @@ namespace nirfmxspecan_grpc { float64 measurement_bandwidth = request->measurement_bandwidth(); auto status = library_->NFCfgMeasurementBandwidth(instrument, selector_string, measurement_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8971,7 +8971,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->NFCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9010,7 +9010,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgMeasurementMethod(instrument, selector_string, measurement_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9049,7 +9049,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgYFactorMode(instrument, selector_string, y_factor_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9093,7 +9093,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgYFactorNoiseSourceENR(instrument, selector_string, enr_frequency, enr, cold_temperature, off_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9152,7 +9152,7 @@ namespace nirfmxspecan_grpc { auto status = library_->NFCfgYFactorNoiseSourceLoss(instrument, selector_string, noise_source_loss_compensation_enabled, noise_source_loss_frequency, noise_source_loss, noise_source_loss_temperature, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9176,7 +9176,7 @@ namespace nirfmxspecan_grpc { float64 settling_time = request->settling_time(); auto status = library_->NFCfgYFactorNoiseSourceSettlingTime(instrument, selector_string, settling_time); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9199,7 +9199,7 @@ namespace nirfmxspecan_grpc { char* calibration_setup_id = (char*)request->calibration_setup_id().c_str(); auto status = library_->NFClearCalibrationDatabase(instrument, calibration_setup_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9225,7 +9225,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->NFFetchAnalyzerNoiseFigure(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); float64* analyzer_noise_figure = response->mutable_analyzer_noise_figure()->mutable_data(); @@ -9236,11 +9236,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_analyzer_noise_figure()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9265,7 +9265,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->NFFetchColdSourcePower(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_cold_source_power()->Resize(actual_array_size, 0); float64* cold_source_power = response->mutable_cold_source_power()->mutable_data(); @@ -9276,11 +9276,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_cold_source_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_cold_source_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9305,7 +9305,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->NFFetchDUTNoiseFigureAndGain(instrument, selector_string, timeout, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); float64* dut_noise_figure = response->mutable_dut_noise_figure()->mutable_data(); @@ -9320,13 +9320,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); - response->mutable_dut_noise_temperature()->Resize(actual_array_size, 0); - response->mutable_dut_gain()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_dut_noise_figure()->Resize(actual_array_size, 0); + response->mutable_dut_noise_temperature()->Resize(actual_array_size, 0); + response->mutable_dut_gain()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9351,7 +9351,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->NFFetchYFactorPowers(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_hot_power()->Resize(actual_array_size, 0); float64* hot_power = response->mutable_hot_power()->mutable_data(); @@ -9364,12 +9364,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_hot_power()->Resize(actual_array_size, 0); - response->mutable_cold_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_hot_power()->Resize(actual_array_size, 0); + response->mutable_cold_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9394,7 +9394,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->NFFetchYFactors(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); float64* measurement_y_factor = response->mutable_measurement_y_factor()->mutable_data(); @@ -9407,12 +9407,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); - response->mutable_calibration_y_factor()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_y_factor()->Resize(actual_array_size, 0); + response->mutable_calibration_y_factor()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9437,10 +9437,10 @@ namespace nirfmxspecan_grpc { float64 reference_level {}; auto status = library_->NFRecommendReferenceLevel(instrument, selector_string, dut_max_gain, dut_max_noise_figure, &reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_reference_level(reference_level); + response->set_reference_level(reference_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9462,11 +9462,11 @@ namespace nirfmxspecan_grpc { int32 calibration_data_valid {}; auto status = library_->NFValidateCalibrationData(instrument, selector_string, &calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_calibration_data_valid(static_cast(calibration_data_valid)); - response->set_calibration_data_valid_raw(calibration_data_valid); + response->set_calibration_data_valid(static_cast(calibration_data_valid)); + response->set_calibration_data_valid_raw(calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9520,7 +9520,7 @@ namespace nirfmxspecan_grpc { auto status = library_->OBWCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9544,7 +9544,7 @@ namespace nirfmxspecan_grpc { float64 bandwidth_percentage = request->bandwidth_percentage(); auto status = library_->OBWCfgBandwidthPercentage(instrument, selector_string, bandwidth_percentage); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9584,7 +9584,7 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->OBWCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9623,7 +9623,7 @@ namespace nirfmxspecan_grpc { auto status = library_->OBWCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9679,7 +9679,7 @@ namespace nirfmxspecan_grpc { auto status = library_->OBWCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9703,7 +9703,7 @@ namespace nirfmxspecan_grpc { float64 span = request->span(); auto status = library_->OBWCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9743,7 +9743,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->OBWCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9772,14 +9772,14 @@ namespace nirfmxspecan_grpc { float64 stop_frequency {}; auto status = library_->OBWFetchMeasurement(instrument, selector_string, timeout, &occupied_bandwidth, &average_power, &frequency_resolution, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_occupied_bandwidth(occupied_bandwidth); - response->set_average_power(average_power); - response->set_frequency_resolution(frequency_resolution); - response->set_start_frequency(start_frequency); - response->set_stop_frequency(stop_frequency); + response->set_occupied_bandwidth(occupied_bandwidth); + response->set_average_power(average_power); + response->set_frequency_resolution(frequency_resolution); + response->set_start_frequency(start_frequency); + response->set_stop_frequency(stop_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9805,7 +9805,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->OBWFetchSpectrumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -9816,13 +9816,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -9850,14 +9850,14 @@ namespace nirfmxspecan_grpc { float64 stop_frequency {}; auto status = library_->OBWRead(instrument, selector_string, timeout, &occupied_bandwidth, &average_power, &frequency_resolution, &start_frequency, &stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_occupied_bandwidth(occupied_bandwidth); - response->set_average_power(average_power); - response->set_frequency_resolution(frequency_resolution); - response->set_start_frequency(start_frequency); - response->set_stop_frequency(stop_frequency); + response->set_occupied_bandwidth(occupied_bandwidth); + response->set_average_power(average_power); + response->set_frequency_resolution(frequency_resolution); + response->set_start_frequency(start_frequency); + response->set_stop_frequency(stop_frequency); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -9879,7 +9879,7 @@ namespace nirfmxspecan_grpc { float64 measurement_bandwidth = request->measurement_bandwidth(); auto status = library_->PAVTCfgMeasurementBandwidth(instrument, selector_string, measurement_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9904,7 +9904,7 @@ namespace nirfmxspecan_grpc { float64 measurement_length = request->measurement_length(); auto status = library_->PAVTCfgMeasurementInterval(instrument, selector_string, measurement_offset, measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9943,7 +9943,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgMeasurementIntervalMode(instrument, selector_string, measurement_interval_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -9982,7 +9982,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgMeasurementLocationType(instrument, selector_string, measurement_location_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10006,7 +10006,7 @@ namespace nirfmxspecan_grpc { int32 number_of_segments = request->number_of_segments(); auto status = library_->PAVTCfgNumberOfSegments(instrument, selector_string, number_of_segments); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10031,7 +10031,7 @@ namespace nirfmxspecan_grpc { float64 segment_measurement_length = request->segment_measurement_length(); auto status = library_->PAVTCfgSegmentMeasurementInterval(instrument, selector_string, segment_measurement_offset, segment_measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10073,7 +10073,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgSegmentMeasurementIntervalArray(instrument, selector_string, segment_measurement_offset, segment_measurement_length, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10098,7 +10098,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->segment_start_time().size()); auto status = library_->PAVTCfgSegmentStartTimeList(instrument, selector_string, segment_start_time, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10124,7 +10124,7 @@ namespace nirfmxspecan_grpc { float64 segment_interval = request->segment_interval(); auto status = library_->PAVTCfgSegmentStartTimeStep(instrument, selector_string, number_of_segments, segment0_start_time, segment_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10163,7 +10163,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PAVTCfgSegmentType(instrument, selector_string, segment_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10196,7 +10196,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->segment_type().size()); auto status = library_->PAVTCfgSegmentTypeArray(instrument, selector_string, segment_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10225,7 +10225,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PAVTFetchAmplitudeTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_amplitude()->Resize(actual_array_size, 0); float32* amplitude = response->mutable_amplitude()->mutable_data(); @@ -10236,13 +10236,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_amplitude()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_amplitude()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10269,13 +10269,13 @@ namespace nirfmxspecan_grpc { float64 mean_absolute_amplitude {}; auto status = library_->PAVTFetchPhaseAndAmplitude(instrument, selector_string, timeout, &mean_relative_phase, &mean_relative_amplitude, &mean_absolute_phase, &mean_absolute_amplitude); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mean_relative_phase(mean_relative_phase); - response->set_mean_relative_amplitude(mean_relative_amplitude); - response->set_mean_absolute_phase(mean_absolute_phase); - response->set_mean_absolute_amplitude(mean_absolute_amplitude); + response->set_mean_relative_phase(mean_relative_phase); + response->set_mean_relative_amplitude(mean_relative_amplitude); + response->set_mean_absolute_phase(mean_absolute_phase); + response->set_mean_absolute_amplitude(mean_absolute_amplitude); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10299,7 +10299,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PAVTFetchPhaseAndAmplitudeArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); float64* mean_relative_phase = response->mutable_mean_relative_phase()->mutable_data(); @@ -10316,14 +10316,14 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); - response->mutable_mean_relative_amplitude()->Resize(actual_array_size, 0); - response->mutable_mean_absolute_phase()->Resize(actual_array_size, 0); - response->mutable_mean_absolute_amplitude()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_mean_relative_phase()->Resize(actual_array_size, 0); + response->mutable_mean_relative_amplitude()->Resize(actual_array_size, 0); + response->mutable_mean_absolute_phase()->Resize(actual_array_size, 0); + response->mutable_mean_absolute_amplitude()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10351,7 +10351,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PAVTFetchPhaseTrace(instrument, selector_string, timeout, trace_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_phase()->Resize(actual_array_size, 0); float32* phase = response->mutable_phase()->mutable_data(); @@ -10362,13 +10362,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_phase()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_phase()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10393,7 +10393,7 @@ namespace nirfmxspecan_grpc { float64 rbw_percentage = request->rbw_percentage(); auto status = library_->PhaseNoiseCfgAutoRange(instrument, selector_string, start_frequency, stop_frequency, rbw_percentage); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10417,7 +10417,7 @@ namespace nirfmxspecan_grpc { int32 averaging_multiplier = request->averaging_multiplier(); auto status = library_->PhaseNoiseCfgAveragingMultiplier(instrument, selector_string, averaging_multiplier); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10476,7 +10476,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgCancellation(instrument, selector_string, cancellation_enabled, cancellation_threshold, frequency, reference_phase_noise, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10534,7 +10534,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgIntegratedNoise(instrument, selector_string, integrated_noise_range_definition, integrated_noise_start_frequency, integrated_noise_stop_frequency, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10558,7 +10558,7 @@ namespace nirfmxspecan_grpc { int32 number_of_ranges = request->number_of_ranges(); auto status = library_->PhaseNoiseCfgNumberOfRanges(instrument, selector_string, number_of_ranges); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10606,7 +10606,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgRangeArray(instrument, selector_string, range_start_frequency, range_stop_frequency, range_rbw_percentage, range_averaging_count, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10645,7 +10645,7 @@ namespace nirfmxspecan_grpc { auto status = library_->PhaseNoiseCfgRangeDefinition(instrument, selector_string, range_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10685,7 +10685,7 @@ namespace nirfmxspecan_grpc { float64 smoothing_percentage = request->smoothing_percentage(); auto status = library_->PhaseNoiseCfgSmoothing(instrument, selector_string, smoothing_type, smoothing_percentage); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10710,7 +10710,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->frequency_list().size()); auto status = library_->PhaseNoiseCfgSpotNoiseFrequencyList(instrument, selector_string, frequency_list, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10750,7 +10750,7 @@ namespace nirfmxspecan_grpc { float64 peak_excursion = request->peak_excursion(); auto status = library_->PhaseNoiseCfgSpurRemoval(instrument, selector_string, spur_removal_enabled, peak_excursion); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -10776,11 +10776,11 @@ namespace nirfmxspecan_grpc { float64 carrier_power {}; auto status = library_->PhaseNoiseFetchCarrierMeasurement(instrument, selector_string, timeout, &carrier_frequency, &carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_carrier_frequency(carrier_frequency); - response->set_carrier_power(carrier_power); + response->set_carrier_frequency(carrier_frequency); + response->set_carrier_power(carrier_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -10804,7 +10804,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PhaseNoiseFetchIntegratedNoise(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); float64* integrated_phase_noise = response->mutable_integrated_phase_noise()->mutable_data(); @@ -10823,15 +10823,15 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); - response->mutable_residual_pm_in_radian()->Resize(actual_array_size, 0); - response->mutable_residual_pm_in_degree()->Resize(actual_array_size, 0); - response->mutable_residual_fm()->Resize(actual_array_size, 0); - response->mutable_jitter()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_integrated_phase_noise()->Resize(actual_array_size, 0); + response->mutable_residual_pm_in_radian()->Resize(actual_array_size, 0); + response->mutable_residual_pm_in_degree()->Resize(actual_array_size, 0); + response->mutable_residual_fm()->Resize(actual_array_size, 0); + response->mutable_jitter()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10856,7 +10856,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PhaseNoiseFetchMeasuredLogPlotTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); @@ -10869,12 +10869,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_frequency()->Resize(actual_array_size, 0); - response->mutable_measured_phase_noise()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_frequency()->Resize(actual_array_size, 0); + response->mutable_measured_phase_noise()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10899,7 +10899,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PhaseNoiseFetchSmoothedLogPlotTrace(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_frequency()->Resize(actual_array_size, 0); float32* frequency = response->mutable_frequency()->mutable_data(); @@ -10912,12 +10912,12 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_frequency()->Resize(actual_array_size, 0); - response->mutable_smoothed_phase_noise()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_frequency()->Resize(actual_array_size, 0); + response->mutable_smoothed_phase_noise()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10942,7 +10942,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->PhaseNoiseFetchSpotNoise(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); float64* spot_phase_noise = response->mutable_spot_phase_noise()->mutable_data(); @@ -10953,11 +10953,11 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_spot_phase_noise()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -10980,7 +10980,7 @@ namespace nirfmxspecan_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11003,7 +11003,7 @@ namespace nirfmxspecan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11059,7 +11059,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11083,7 +11083,7 @@ namespace nirfmxspecan_grpc { float64 carrier_channel_bandwidth = request->carrier_channel_bandwidth(); auto status = library_->SEMCfgCarrierChannelBandwidth(instrument, selector_string, carrier_channel_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11122,7 +11122,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgCarrierEnabled(instrument, selector_string, carrier_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11146,7 +11146,7 @@ namespace nirfmxspecan_grpc { float64 carrier_frequency = request->carrier_frequency(); auto status = library_->SEMCfgCarrierFrequency(instrument, selector_string, carrier_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11170,7 +11170,7 @@ namespace nirfmxspecan_grpc { float64 integration_bandwidth = request->integration_bandwidth(); auto status = library_->SEMCfgCarrierIntegrationBandwidth(instrument, selector_string, integration_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11226,7 +11226,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgCarrierRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11266,7 +11266,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->SEMCfgCarrierRRCFilter(instrument, selector_string, rrc_filter_enabled, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11306,7 +11306,7 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->SEMCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11330,7 +11330,7 @@ namespace nirfmxspecan_grpc { int32 number_of_carriers = request->number_of_carriers(); auto status = library_->SEMCfgNumberOfCarriers(instrument, selector_string, number_of_carriers); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11354,7 +11354,7 @@ namespace nirfmxspecan_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11395,7 +11395,7 @@ namespace nirfmxspecan_grpc { float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SEMCfgOffsetAbsoluteLimit(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11448,7 +11448,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetAbsoluteLimitArray(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11472,7 +11472,7 @@ namespace nirfmxspecan_grpc { int32 bandwidth_integral = request->bandwidth_integral(); auto status = library_->SEMCfgOffsetBandwidthIntegral(instrument, selector_string, bandwidth_integral); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11529,7 +11529,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetFrequency(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_enabled, offset_sideband); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11593,7 +11593,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_enabled, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11632,7 +11632,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetFrequencyDefinition(instrument, selector_string, offset_frequency_definition); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11671,7 +11671,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetLimitFailMask(instrument, selector_string, limit_fail_mask); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11727,7 +11727,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11788,7 +11788,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetRBWFilterArray(instrument, selector_string, rbw_auto, rbw, rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11812,7 +11812,7 @@ namespace nirfmxspecan_grpc { float64 relative_attenuation = request->relative_attenuation(); auto status = library_->SEMCfgOffsetRelativeAttenuation(instrument, selector_string, relative_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11837,7 +11837,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->SEMCfgOffsetRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11878,7 +11878,7 @@ namespace nirfmxspecan_grpc { float64 relative_limit_stop = request->relative_limit_stop(); auto status = library_->SEMCfgOffsetRelativeLimit(instrument, selector_string, relative_limit_mode, relative_limit_start, relative_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11931,7 +11931,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_mode, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -11970,7 +11970,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgPowerUnits(instrument, selector_string, power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12009,7 +12009,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SEMCfgReferenceType(instrument, selector_string, reference_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12049,7 +12049,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12077,7 +12077,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchAbsoluteMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_mask()->Resize(actual_array_size, 0); float32* absolute_mask = response->mutable_absolute_mask()->mutable_data(); @@ -12088,13 +12088,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_absolute_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_absolute_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12121,13 +12121,13 @@ namespace nirfmxspecan_grpc { float64 total_relative_power {}; auto status = library_->SEMFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &peak_absolute_power, &peak_frequency, &total_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_total_relative_power(total_relative_power); + response->set_absolute_power(absolute_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_total_relative_power(total_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12150,11 +12150,11 @@ namespace nirfmxspecan_grpc { int32 composite_measurement_status {}; auto status = library_->SEMFetchCompositeMeasurementStatus(instrument, selector_string, timeout, &composite_measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_composite_measurement_status(static_cast(composite_measurement_status)); - response->set_composite_measurement_status_raw(composite_measurement_status); + response->set_composite_measurement_status(static_cast(composite_measurement_status)); + response->set_composite_measurement_status_raw(composite_measurement_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12177,10 +12177,10 @@ namespace nirfmxspecan_grpc { float64 frequency_resolution {}; auto status = library_->SEMFetchFrequencyResolution(instrument, selector_string, timeout, &frequency_resolution); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_frequency_resolution(frequency_resolution); + response->set_frequency_resolution(frequency_resolution); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12207,15 +12207,15 @@ namespace nirfmxspecan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12239,7 +12239,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -12258,7 +12258,7 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -12270,12 +12270,12 @@ namespace nirfmxspecan_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12303,14 +12303,14 @@ namespace nirfmxspecan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_absolute_power(total_absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_peak_relative_power(peak_relative_power); + response->set_total_absolute_power(total_absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_peak_relative_power(peak_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12334,7 +12334,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); @@ -12353,15 +12353,15 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_total_absolute_power()->Resize(actual_array_size, 0); - response->mutable_total_relative_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_peak_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); + response->mutable_total_relative_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_peak_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12388,7 +12388,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchRelativeMaskTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_relative_mask()->Resize(actual_array_size, 0); float32* relative_mask = response->mutable_relative_mask()->mutable_data(); @@ -12399,13 +12399,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_relative_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_relative_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12432,7 +12432,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -12443,13 +12443,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12473,10 +12473,10 @@ namespace nirfmxspecan_grpc { float64 total_carrier_power {}; auto status = library_->SEMFetchTotalCarrierPower(instrument, selector_string, timeout, &total_carrier_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_carrier_power(total_carrier_power); + response->set_total_carrier_power(total_carrier_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12503,15 +12503,15 @@ namespace nirfmxspecan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12535,7 +12535,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -12554,7 +12554,7 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -12566,12 +12566,12 @@ namespace nirfmxspecan_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12599,14 +12599,14 @@ namespace nirfmxspecan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_absolute_power(total_absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_peak_relative_power(peak_relative_power); + response->set_total_absolute_power(total_absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_peak_relative_power(peak_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -12630,7 +12630,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); @@ -12649,15 +12649,15 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_total_absolute_power()->Resize(actual_array_size, 0); - response->mutable_total_relative_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_peak_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); + response->mutable_total_relative_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_peak_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -12696,7 +12696,7 @@ namespace nirfmxspecan_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12718,7 +12718,7 @@ namespace nirfmxspecan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12743,7 +12743,7 @@ namespace nirfmxspecan_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12769,7 +12769,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12794,7 +12794,7 @@ namespace nirfmxspecan_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12820,7 +12820,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12854,7 +12854,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12897,7 +12897,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12931,7 +12931,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12956,7 +12956,7 @@ namespace nirfmxspecan_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -12982,7 +12982,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13016,7 +13016,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13062,7 +13062,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13091,7 +13091,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13117,7 +13117,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13161,7 +13161,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13195,7 +13195,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13223,7 +13223,7 @@ namespace nirfmxspecan_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13249,7 +13249,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13275,7 +13275,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13300,7 +13300,7 @@ namespace nirfmxspecan_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13326,7 +13326,7 @@ namespace nirfmxspecan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13382,7 +13382,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13422,7 +13422,7 @@ namespace nirfmxspecan_grpc { int32 detector_points = request->detector_points(); auto status = library_->SpectrumCfgDetector(instrument, selector_string, detector_type, detector_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13462,7 +13462,7 @@ namespace nirfmxspecan_grpc { float64 fft_padding = request->fft_padding(); auto status = library_->SpectrumCfgFFT(instrument, selector_string, fft_window, fft_padding); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13487,7 +13487,7 @@ namespace nirfmxspecan_grpc { float64 stop_frequency = request->stop_frequency(); auto status = library_->SpectrumCfgFrequencyStartStop(instrument, selector_string, start_frequency, stop_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13526,7 +13526,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13565,7 +13565,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgPowerUnits(instrument, selector_string, spectrum_power_units); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13621,7 +13621,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpectrumCfgRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13645,7 +13645,7 @@ namespace nirfmxspecan_grpc { float64 span = request->span(); auto status = library_->SpectrumCfgSpan(instrument, selector_string, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13685,7 +13685,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SpectrumCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13726,7 +13726,7 @@ namespace nirfmxspecan_grpc { float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->SpectrumCfgVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -13753,12 +13753,12 @@ namespace nirfmxspecan_grpc { float64 frequency_resolution {}; auto status = library_->SpectrumFetchMeasurement(instrument, selector_string, timeout, &peak_amplitude, &peak_frequency, &frequency_resolution); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_peak_amplitude(peak_amplitude); - response->set_peak_frequency(peak_frequency); - response->set_frequency_resolution(frequency_resolution); + response->set_peak_amplitude(peak_amplitude); + response->set_peak_frequency(peak_frequency); + response->set_frequency_resolution(frequency_resolution); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13784,7 +13784,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpectrumFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); @@ -13795,13 +13795,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -13828,7 +13828,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpectrumFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -13839,13 +13839,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -13872,7 +13872,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpectrumRead(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -13883,13 +13883,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -13912,11 +13912,11 @@ namespace nirfmxspecan_grpc { int32 noise_calibration_data_valid {}; auto status = library_->SpectrumValidateNoiseCalibrationData(instrument, selector_string, &noise_calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); - response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); + response->set_noise_calibration_data_valid(static_cast(noise_calibration_data_valid)); + response->set_noise_calibration_data_valid_raw(noise_calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -13970,7 +13970,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14009,7 +14009,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgFFTWindowType(instrument, selector_string, fft_window); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14033,7 +14033,7 @@ namespace nirfmxspecan_grpc { int32 number_of_ranges = request->number_of_ranges(); auto status = library_->SpurCfgNumberOfRanges(instrument, selector_string, number_of_ranges); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14074,7 +14074,7 @@ namespace nirfmxspecan_grpc { float64 absolute_limit_stop = request->absolute_limit_stop(); auto status = library_->SpurCfgRangeAbsoluteLimit(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14127,7 +14127,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeAbsoluteLimitArray(instrument, selector_string, absolute_limit_mode, absolute_limit_start, absolute_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14167,7 +14167,7 @@ namespace nirfmxspecan_grpc { int32 detector_points = request->detector_points(); auto status = library_->SpurCfgRangeDetector(instrument, selector_string, detector_type, detector_points); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14217,7 +14217,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeDetectorArray(instrument, selector_string, detector_type, detector_points, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14258,7 +14258,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeFrequency(instrument, selector_string, start_frequency, stop_frequency, range_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14311,7 +14311,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeFrequencyArray(instrument, selector_string, start_frequency, stop_frequency, range_enabled, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14335,7 +14335,7 @@ namespace nirfmxspecan_grpc { int32 number_of_spurs_to_report = request->number_of_spurs_to_report(); auto status = library_->SpurCfgRangeNumberOfSpursToReport(instrument, selector_string, number_of_spurs_to_report); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14360,7 +14360,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->number_of_spurs_to_report().size()); auto status = library_->SpurCfgRangeNumberOfSpursToReportArray(instrument, selector_string, number_of_spurs_to_report, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14385,7 +14385,7 @@ namespace nirfmxspecan_grpc { float64 excursion = request->excursion(); auto status = library_->SpurCfgRangePeakCriteria(instrument, selector_string, threshold, excursion); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14427,7 +14427,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangePeakCriteriaArray(instrument, selector_string, threshold, excursion, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14488,7 +14488,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeRBWArray(instrument, selector_string, rbw_auto, rbw, rbw_filter_type, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14544,7 +14544,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeRBWFilter(instrument, selector_string, rbw_auto, rbw, rbw_filter_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14568,7 +14568,7 @@ namespace nirfmxspecan_grpc { float64 relative_attenuation = request->relative_attenuation(); auto status = library_->SpurCfgRangeRelativeAttenuation(instrument, selector_string, relative_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14593,7 +14593,7 @@ namespace nirfmxspecan_grpc { int32 number_of_elements = static_cast(request->relative_attenuation().size()); auto status = library_->SpurCfgRangeRelativeAttenuationArray(instrument, selector_string, relative_attenuation, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14633,7 +14633,7 @@ namespace nirfmxspecan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SpurCfgRangeSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14683,7 +14683,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeSweepTimeArray(instrument, selector_string, sweep_time_auto, sweep_time_interval, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14724,7 +14724,7 @@ namespace nirfmxspecan_grpc { float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->SpurCfgRangeVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14777,7 +14777,7 @@ namespace nirfmxspecan_grpc { auto status = library_->SpurCfgRangeVBWFilterArray(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14801,7 +14801,7 @@ namespace nirfmxspecan_grpc { int32 trace_range_index = request->trace_range_index(); auto status = library_->SpurCfgTraceRangeIndex(instrument, selector_string, trace_range_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -14827,7 +14827,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpurFetchAllSpurs(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spur_frequency()->Resize(actual_array_size, 0); float64* spur_frequency = response->mutable_spur_frequency()->mutable_data(); @@ -14846,15 +14846,15 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_spur_frequency()->Resize(actual_array_size, 0); - response->mutable_spur_amplitude()->Resize(actual_array_size, 0); - response->mutable_spur_margin()->Resize(actual_array_size, 0); - response->mutable_spur_absolute_limit()->Resize(actual_array_size, 0); - response->mutable_spur_range_index()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_spur_frequency()->Resize(actual_array_size, 0); + response->mutable_spur_amplitude()->Resize(actual_array_size, 0); + response->mutable_spur_margin()->Resize(actual_array_size, 0); + response->mutable_spur_absolute_limit()->Resize(actual_array_size, 0); + response->mutable_spur_range_index()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -14878,11 +14878,11 @@ namespace nirfmxspecan_grpc { int32 measurement_status {}; auto status = library_->SpurFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -14908,7 +14908,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpurFetchRangeAbsoluteLimitTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_absolute_limit()->Resize(actual_array_size, 0); float32* absolute_limit = response->mutable_absolute_limit()->mutable_data(); @@ -14919,13 +14919,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_absolute_limit()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_absolute_limit()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -14952,7 +14952,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpurFetchRangeSpectrumTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_range_spectrum()->Resize(actual_array_size, 0); float32* range_spectrum = response->mutable_range_spectrum()->mutable_data(); @@ -14963,13 +14963,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_range_spectrum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_range_spectrum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -14994,12 +14994,12 @@ namespace nirfmxspecan_grpc { int32 detected_spurs {}; auto status = library_->SpurFetchRangeStatus(instrument, selector_string, timeout, &range_status, &detected_spurs); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_range_status(static_cast(range_status)); - response->set_range_status_raw(range_status); - response->set_detected_spurs(detected_spurs); + response->set_range_status(static_cast(range_status)); + response->set_range_status_raw(range_status); + response->set_detected_spurs(detected_spurs); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -15023,7 +15023,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpurFetchRangeStatusArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_range_status_raw()->Resize(actual_array_size, 0); int32* range_status = reinterpret_cast(response->mutable_range_status_raw()->mutable_data()); @@ -15036,7 +15036,7 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_range_status()->Clear(); @@ -15048,9 +15048,9 @@ namespace nirfmxspecan_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_range_status()->Resize(actual_array_size, 0); - response->mutable_number_of_detected_spurs()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_range_status()->Resize(actual_array_size, 0); + response->mutable_number_of_detected_spurs()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -15077,13 +15077,13 @@ namespace nirfmxspecan_grpc { float64 spur_absolute_limit {}; auto status = library_->SpurFetchSpurMeasurement(instrument, selector_string, timeout, &spur_frequency, &spur_amplitude, &spur_margin, &spur_absolute_limit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_spur_frequency(spur_frequency); - response->set_spur_amplitude(spur_amplitude); - response->set_spur_margin(spur_margin); - response->set_spur_absolute_limit(spur_absolute_limit); + response->set_spur_frequency(spur_frequency); + response->set_spur_amplitude(spur_amplitude); + response->set_spur_margin(spur_margin); + response->set_spur_absolute_limit(spur_absolute_limit); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -15107,7 +15107,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->SpurFetchSpurMeasurementArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spur_frequency()->Resize(actual_array_size, 0); float64* spur_frequency = response->mutable_spur_frequency()->mutable_data(); @@ -15124,14 +15124,14 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_spur_frequency()->Resize(actual_array_size, 0); - response->mutable_spur_amplitude()->Resize(actual_array_size, 0); - response->mutable_spur_absolute_limit()->Resize(actual_array_size, 0); - response->mutable_spur_margin()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_spur_frequency()->Resize(actual_array_size, 0); + response->mutable_spur_amplitude()->Resize(actual_array_size, 0); + response->mutable_spur_absolute_limit()->Resize(actual_array_size, 0); + response->mutable_spur_margin()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -15186,7 +15186,7 @@ namespace nirfmxspecan_grpc { auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -15210,7 +15210,7 @@ namespace nirfmxspecan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->TXPCfgMeasurementInterval(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -15251,7 +15251,7 @@ namespace nirfmxspecan_grpc { float64 rrc_alpha = request->rrc_alpha(); auto status = library_->TXPCfgRBWFilter(instrument, selector_string, rbw, rbw_filter_type, rrc_alpha); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -15307,7 +15307,7 @@ namespace nirfmxspecan_grpc { auto status = library_->TXPCfgThreshold(instrument, selector_string, threshold_enabled, threshold_level, threshold_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -15348,7 +15348,7 @@ namespace nirfmxspecan_grpc { float64 vbw_to_rbw_ratio = request->vbw_to_rbw_ratio(); auto status = library_->TXPCfgVBWFilter(instrument, selector_string, vbw_auto, vbw, vbw_to_rbw_ratio); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -15376,13 +15376,13 @@ namespace nirfmxspecan_grpc { float64 minimum_power {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_mean_power, &peak_to_average_ratio, &maximum_power, &minimum_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_mean_power(average_mean_power); - response->set_peak_to_average_ratio(peak_to_average_ratio); - response->set_maximum_power(maximum_power); - response->set_minimum_power(minimum_power); + response->set_average_mean_power(average_mean_power); + response->set_peak_to_average_ratio(peak_to_average_ratio); + response->set_maximum_power(maximum_power); + response->set_minimum_power(minimum_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -15408,7 +15408,7 @@ namespace nirfmxspecan_grpc { while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); @@ -15419,13 +15419,13 @@ namespace nirfmxspecan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -15452,13 +15452,13 @@ namespace nirfmxspecan_grpc { float64 minimum_power {}; auto status = library_->TXPRead(instrument, selector_string, timeout, &average_mean_power, &peak_to_average_ratio, &maximum_power, &minimum_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_mean_power(average_mean_power); - response->set_peak_to_average_ratio(peak_to_average_ratio); - response->set_maximum_power(maximum_power); - response->set_minimum_power(minimum_power); + response->set_average_mean_power(average_mean_power); + response->set_peak_to_average_ratio(peak_to_average_ratio); + response->set_maximum_power(maximum_power); + response->set_minimum_power(minimum_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -15479,7 +15479,7 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -15503,7 +15503,7 @@ namespace nirfmxspecan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nirfmxspecan/nirfmxspecan_service.h b/generated/nirfmxspecan/nirfmxspecan_service.h index 07031debf..55342d717 100644 --- a/generated/nirfmxspecan/nirfmxspecan_service.h +++ b/generated/nirfmxspecan/nirfmxspecan_service.h @@ -460,7 +460,7 @@ class NiRFmxSpecAnService final : public NiRFmxSpecAn::Service { NiRFmxSpecAnLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map digitaledgetriggersource_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; std::map digitaledgetriggersource_output_map_ { {"PFI0", 1},{"PFI1", 2},{"PXI_Trig0", 3},{"PXI_Trig1", 4},{"PXI_Trig2", 5},{"PXI_Trig3", 6},{"PXI_Trig4", 7},{"PXI_Trig5", 8},{"PXI_Trig6", 9},{"PXI_Trig7", 10},{"PXI_STAR", 11},{"PXIe_DStarB", 12},{"TimerEvent", 13}, }; std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; diff --git a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp index 6ac3e5556..fe37263ec 100644 --- a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp +++ b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.cpp @@ -62,11 +62,11 @@ namespace nirfmxspecan_restricted_grpc { } auto status = library_->CacheResult(instrument, selector_string, selector_string_out_size, (char*)selector_string_out.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -95,7 +95,7 @@ namespace nirfmxspecan_restricted_grpc { while (true) { auto status = library_->IQFetchDataOverrideBehavior(instrument, selector_string, timeout, record_to_fetch, samples_to_read, delete_on_fetch, &t0, &dt, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector data(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -105,20 +105,20 @@ namespace nirfmxspecan_restricted_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_t0(t0); - response->set_dt(dt); - convert_to_grpc(data, response->mutable_data()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_data()->size(); - if (shrunk_size != current_size) { - response->mutable_data()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + response->set_t0(t0); + response->set_dt(dt); + convert_to_grpc(data, response->mutable_data()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_data()->size(); + if (shrunk_size != current_size) { + response->mutable_data()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } diff --git a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h index d65cfba1d..c86e49c44 100644 --- a/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h +++ b/generated/nirfmxspecan_restricted/nirfmxspecan_restricted_service.h @@ -46,7 +46,7 @@ class NiRFmxSpecAnRestrictedService final : public NiRFmxSpecAnRestricted::Servi private: NiRFmxSpecAnRestrictedLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); NiRFmxSpecAnRestrictedFeatureToggles feature_toggles_; }; diff --git a/generated/nirfmxwlan/nirfmxwlan_service.cpp b/generated/nirfmxwlan/nirfmxwlan_service.cpp index 3f933954c..259a1cb5f 100644 --- a/generated/nirfmxwlan/nirfmxwlan_service.cpp +++ b/generated/nirfmxwlan/nirfmxwlan_service.cpp @@ -61,7 +61,7 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->AbortMeasurements(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -91,7 +91,7 @@ namespace nirfmxwlan_grpc { auto reserved = 0; auto status = library_->AnalyzeIQ1Waveform(instrument, selector_string, result_name, x0, dx, iq.data(), array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -139,7 +139,7 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto status = library_->AnalyzeNWaveformsIQ(instrument, selector_string, result_name, x0, dx, iq.data(), iq_sizes, array_size, reset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -187,7 +187,7 @@ namespace nirfmxwlan_grpc { int32 reset = request->reset(); auto status = library_->AnalyzeNWaveformsSpectrum(instrument, selector_string, result_name, x0, dx, spectrum, spectrum_sizes, array_size, reset); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -217,7 +217,7 @@ namespace nirfmxwlan_grpc { auto reserved = 0; auto status = library_->AnalyzeSpectrum1Waveform(instrument, selector_string, result_name, x0, dx, spectrum, array_size, reset, reserved); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -241,7 +241,7 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->AutoDetectSignal(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -265,7 +265,7 @@ namespace nirfmxwlan_grpc { float64 measurement_interval = request->measurement_interval(); auto status = library_->AutoLevel(instrument, selector_string, measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -289,7 +289,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildChainString(selector_string, chain_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -303,11 +303,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -330,7 +330,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildGateString(selector_string, gate_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -344,11 +344,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -371,7 +371,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildOffsetString(selector_string, offset_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -385,11 +385,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -412,7 +412,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildSegmentString(selector_string, segment_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -426,11 +426,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -453,7 +453,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildSignalString(signal_name, result_name, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_length = status; @@ -467,11 +467,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string(selector_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); + response->set_selector_string(selector_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string())); return ::grpc::Status::OK; } } @@ -494,7 +494,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildStreamString(selector_string, stream_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -508,11 +508,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -535,7 +535,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->BuildUserString(selector_string, user_number, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status; @@ -549,11 +549,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -576,7 +576,7 @@ namespace nirfmxwlan_grpc { float64 channel_bandwidth = request->channel_bandwidth(); auto status = library_->CfgChannelBandwidth(instrument, selector_string, channel_bandwidth); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -618,7 +618,7 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgDigitalEdgeTrigger(instrument, selector_string, digital_edge_source, digital_edge, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -642,7 +642,7 @@ namespace nirfmxwlan_grpc { float64 external_attenuation = request->external_attenuation(); auto status = library_->CfgExternalAttenuation(instrument, selector_string, external_attenuation); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -666,7 +666,7 @@ namespace nirfmxwlan_grpc { float64 center_frequency = request->center_frequency(); auto status = library_->CfgFrequency(instrument, selector_string, center_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -691,7 +691,7 @@ namespace nirfmxwlan_grpc { int32 number_of_elements = static_cast(request->center_frequency().size()); auto status = library_->CfgFrequencyArray(instrument, selector_string, center_frequency, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -735,7 +735,7 @@ namespace nirfmxwlan_grpc { float64 frequency_reference_frequency = request->frequency_reference_frequency(); auto status = library_->CfgFrequencyReference(instrument, channel_name, frequency_reference_source, frequency_reference_frequency); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -811,7 +811,7 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgIQPowerEdgeTrigger(instrument, selector_string, iq_power_edge_source, iq_power_edge_slope, iq_power_edge_level, trigger_delay, trigger_min_quiet_time_mode, trigger_min_quiet_time_duration, iq_power_edge_level_type, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -851,7 +851,7 @@ namespace nirfmxwlan_grpc { float64 mechanical_attenuation_value = request->mechanical_attenuation_value(); auto status = library_->CfgMechanicalAttenuation(instrument, channel_name, mechanical_attenuation_auto, mechanical_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -876,7 +876,7 @@ namespace nirfmxwlan_grpc { int32 number_of_receive_chains = request->number_of_receive_chains(); auto status = library_->CfgNumberOfFrequencySegmentsAndReceiveChains(instrument, selector_string, number_of_frequency_segments, number_of_receive_chains); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -916,7 +916,7 @@ namespace nirfmxwlan_grpc { float64 rf_attenuation_value = request->rf_attenuation_value(); auto status = library_->CfgRFAttenuation(instrument, channel_name, rf_attenuation_auto, rf_attenuation_value); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -940,7 +940,7 @@ namespace nirfmxwlan_grpc { float64 reference_level = request->reference_level(); auto status = library_->CfgReferenceLevel(instrument, selector_string, reference_level); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -964,7 +964,7 @@ namespace nirfmxwlan_grpc { char* selected_ports = (char*)request->selected_ports().c_str(); auto status = library_->CfgSelectedPortsMultiple(instrument, selector_string, selected_ports); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -989,7 +989,7 @@ namespace nirfmxwlan_grpc { int32 enable_trigger = request->enable_trigger(); auto status = library_->CfgSoftwareEdgeTrigger(instrument, selector_string, trigger_delay, enable_trigger); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1028,7 +1028,7 @@ namespace nirfmxwlan_grpc { auto status = library_->CfgStandard(instrument, selector_string, standard); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1052,10 +1052,10 @@ namespace nirfmxwlan_grpc { int32 is_done {}; auto status = library_->CheckMeasurementStatus(instrument, selector_string, &is_done); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1076,7 +1076,7 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearAllNamedResults(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1099,7 +1099,7 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ClearNamedResult(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1123,7 +1123,7 @@ namespace nirfmxwlan_grpc { char* new_signal_name = (char*)request->new_signal_name().c_str(); auto status = library_->CloneSignalConfiguration(instrument, old_signal_name, new_signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1147,7 +1147,7 @@ namespace nirfmxwlan_grpc { session_repository_->remove_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->Close(instrument, force_destroy); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1170,7 +1170,7 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->Commit(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1193,7 +1193,7 @@ namespace nirfmxwlan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->CreateSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1233,7 +1233,7 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->DSSSModAccCfgAcquisitionLength(instrument, selector_string, acquisition_length_mode, acquisition_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1273,7 +1273,7 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->DSSSModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1312,7 +1312,7 @@ namespace nirfmxwlan_grpc { auto status = library_->DSSSModAccCfgEVMUnit(instrument, selector_string, evm_unit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1337,7 +1337,7 @@ namespace nirfmxwlan_grpc { int32 maximum_measurement_length = request->maximum_measurement_length(); auto status = library_->DSSSModAccCfgMeasurementLength(instrument, selector_string, measurement_offset, maximum_measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1379,7 +1379,7 @@ namespace nirfmxwlan_grpc { auto status = library_->DSSSModAccCfgPowerMeasurementCustomGateArray(instrument, selector_string, start_time, stop_time, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1418,7 +1418,7 @@ namespace nirfmxwlan_grpc { auto status = library_->DSSSModAccCfgPowerMeasurementEnabled(instrument, selector_string, power_measurement_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1442,7 +1442,7 @@ namespace nirfmxwlan_grpc { int32 number_of_custom_gates = request->number_of_custom_gates(); auto status = library_->DSSSModAccCfgPowerMeasurementNumberOfCustomGates(instrument, selector_string, number_of_custom_gates); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1470,13 +1470,13 @@ namespace nirfmxwlan_grpc { float64 ppdu_average_power_mean {}; auto status = library_->DSSSModAccFetchAveragePowers(instrument, selector_string, timeout, &preamble_average_power_mean, &header_average_power_mean, &data_average_power_mean, &ppdu_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_preamble_average_power_mean(preamble_average_power_mean); - response->set_header_average_power_mean(header_average_power_mean); - response->set_data_average_power_mean(data_average_power_mean); - response->set_ppdu_average_power_mean(ppdu_average_power_mean); + response->set_preamble_average_power_mean(preamble_average_power_mean); + response->set_header_average_power_mean(header_average_power_mean); + response->set_data_average_power_mean(data_average_power_mean); + response->set_ppdu_average_power_mean(ppdu_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1500,7 +1500,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->DSSSModAccFetchConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -1510,18 +1510,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(constellation, response->mutable_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(constellation, response->mutable_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1546,7 +1546,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->DSSSModAccFetchCustomGatePowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_average_power_mean()->Resize(actual_array_size, 0); float64* average_power_mean = response->mutable_average_power_mean()->mutable_data(); @@ -1559,12 +1559,12 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_average_power_mean()->Resize(actual_array_size, 0); - response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_average_power_mean()->Resize(actual_array_size, 0); + response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1589,7 +1589,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->DSSSModAccFetchDecodedHeaderBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); int32* decoded_header_bits = reinterpret_cast(response->mutable_decoded_header_bits()->mutable_data()); @@ -1600,11 +1600,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_header_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1629,7 +1629,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->DSSSModAccFetchDecodedPSDUBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); int32* decoded_psdu_bits = reinterpret_cast(response->mutable_decoded_psdu_bits()->mutable_data()); @@ -1640,11 +1640,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1674,16 +1674,16 @@ namespace nirfmxwlan_grpc { int32 number_of_chips_used {}; auto status = library_->DSSSModAccFetchEVM(instrument, selector_string, timeout, &rms_evm_mean, &peak_evm_80211_2016_maximum, &peak_evm_80211_2007_maximum, &peak_evm_80211_1999_maximum, &frequency_error_mean, &chip_clock_error_mean, &number_of_chips_used); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_rms_evm_mean(rms_evm_mean); - response->set_peak_evm_80211_2016_maximum(peak_evm_80211_2016_maximum); - response->set_peak_evm_80211_2007_maximum(peak_evm_80211_2007_maximum); - response->set_peak_evm_80211_1999_maximum(peak_evm_80211_1999_maximum); - response->set_frequency_error_mean(frequency_error_mean); - response->set_chip_clock_error_mean(chip_clock_error_mean); - response->set_number_of_chips_used(number_of_chips_used); + response->set_rms_evm_mean(rms_evm_mean); + response->set_peak_evm_80211_2016_maximum(peak_evm_80211_2016_maximum); + response->set_peak_evm_80211_2007_maximum(peak_evm_80211_2007_maximum); + response->set_peak_evm_80211_1999_maximum(peak_evm_80211_1999_maximum); + response->set_frequency_error_mean(frequency_error_mean); + response->set_chip_clock_error_mean(chip_clock_error_mean); + response->set_number_of_chips_used(number_of_chips_used); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1709,7 +1709,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->DSSSModAccFetchEVMPerChipMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_evm_per_chip_mean()->Resize(actual_array_size, 0); float32* evm_per_chip_mean = response->mutable_evm_per_chip_mean()->mutable_data(); @@ -1720,13 +1720,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_evm_per_chip_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_evm_per_chip_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -1752,12 +1752,12 @@ namespace nirfmxwlan_grpc { float64 iq_quadrature_error_mean {}; auto status = library_->DSSSModAccFetchIQImpairments(instrument, selector_string, timeout, &iq_origin_offset_mean, &iq_gain_imbalance_mean, &iq_quadrature_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_iq_origin_offset_mean(iq_origin_offset_mean); - response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); - response->set_iq_quadrature_error_mean(iq_quadrature_error_mean); + response->set_iq_origin_offset_mean(iq_origin_offset_mean); + response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); + response->set_iq_quadrature_error_mean(iq_quadrature_error_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1785,19 +1785,19 @@ namespace nirfmxwlan_grpc { int32 psdu_crc_status {}; auto status = library_->DSSSModAccFetchPPDUInformation(instrument, selector_string, timeout, &data_modulation_format, &payload_length, &preamble_type, &locked_clocks_bit, &header_crc_status, &psdu_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_data_modulation_format(static_cast(data_modulation_format)); - response->set_data_modulation_format_raw(data_modulation_format); - response->set_payload_length(payload_length); - response->set_preamble_type(static_cast(preamble_type)); - response->set_preamble_type_raw(preamble_type); - response->set_locked_clocks_bit(locked_clocks_bit); - response->set_header_crc_status(static_cast(header_crc_status)); - response->set_header_crc_status_raw(header_crc_status); - response->set_psdu_crc_status(static_cast(psdu_crc_status)); - response->set_psdu_crc_status_raw(psdu_crc_status); + response->set_data_modulation_format(static_cast(data_modulation_format)); + response->set_data_modulation_format_raw(data_modulation_format); + response->set_payload_length(payload_length); + response->set_preamble_type(static_cast(preamble_type)); + response->set_preamble_type_raw(preamble_type); + response->set_locked_clocks_bit(locked_clocks_bit); + response->set_header_crc_status(static_cast(header_crc_status)); + response->set_header_crc_status_raw(header_crc_status); + response->set_psdu_crc_status(static_cast(psdu_crc_status)); + response->set_psdu_crc_status_raw(psdu_crc_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1823,13 +1823,13 @@ namespace nirfmxwlan_grpc { float64 ppdu_peak_power_maximum {}; auto status = library_->DSSSModAccFetchPeakPowers(instrument, selector_string, timeout, &preamble_peak_power_maximum, &header_peak_power_maximum, &data_peak_power_maximum, &ppdu_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_preamble_peak_power_maximum(preamble_peak_power_maximum); - response->set_header_peak_power_maximum(header_peak_power_maximum); - response->set_data_peak_power_maximum(data_peak_power_maximum); - response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); + response->set_preamble_peak_power_maximum(preamble_peak_power_maximum); + response->set_header_peak_power_maximum(header_peak_power_maximum); + response->set_data_peak_power_maximum(data_peak_power_maximum); + response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1850,7 +1850,7 @@ namespace nirfmxwlan_grpc { char* signal_name = (char*)request->signal_name().c_str(); auto status = library_->DeleteSignalConfiguration(instrument, signal_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1873,7 +1873,7 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DisableTrigger(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -1899,7 +1899,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAllNamedResultNames(instrument, selector_string, nullptr, 0, &actual_result_names_size, &default_result_exists); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string result_names; if (actual_result_names_size > 0) { @@ -1912,13 +1912,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_actual_result_names_size(actual_result_names_size); - response->set_default_result_exists(default_result_exists); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_actual_result_names_size(actual_result_names_size); + response->set_default_result_exists(default_result_exists); return ::grpc::Status::OK; } } @@ -1942,10 +1942,10 @@ namespace nirfmxwlan_grpc { float32 attr_val {}; auto status = library_->GetAttributeF32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1969,7 +1969,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeF32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -1980,11 +1980,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2008,10 +2008,10 @@ namespace nirfmxwlan_grpc { float64 attr_val {}; auto status = library_->GetAttributeF64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2035,7 +2035,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeF64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -2046,11 +2046,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2074,10 +2074,10 @@ namespace nirfmxwlan_grpc { int16 attr_val {}; auto status = library_->GetAttributeI16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2100,16 +2100,16 @@ namespace nirfmxwlan_grpc { int32 attr_val {}; auto status = library_->GetAttributeI32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; - response->set_attr_val(checked_convert_attr_val(attr_val)); - response->set_attr_val_raw(attr_val); + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; + response->set_attr_val(checked_convert_attr_val(attr_val)); + response->set_attr_val_raw(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2133,7 +2133,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeI32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val_raw()->Resize(actual_array_size, 0); int32* attr_val = reinterpret_cast(response->mutable_attr_val_raw()->mutable_data()); @@ -2144,14 +2144,14 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - auto checked_convert_attr_val = [](auto raw_value) { - bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast(valid_enum_value); - }; + auto checked_convert_attr_val = [](auto raw_value) { + bool raw_value_is_valid = nirfmxwlan_grpc::NiRFmxWLANInt32AttributeValues_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast(valid_enum_value); + }; response->mutable_attr_val()->Clear(); response->mutable_attr_val()->Reserve(actual_array_size); std::transform( @@ -2161,8 +2161,8 @@ namespace nirfmxwlan_grpc { [&](auto x) { return checked_convert_attr_val(x); }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2186,10 +2186,10 @@ namespace nirfmxwlan_grpc { int64 attr_val {}; auto status = library_->GetAttributeI64(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2213,7 +2213,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeI64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); int64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -2224,11 +2224,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2252,10 +2252,10 @@ namespace nirfmxwlan_grpc { int8 attr_val {}; auto status = library_->GetAttributeI8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2279,7 +2279,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeI8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size); auto array_size = actual_array_size; @@ -2289,7 +2289,7 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_attr_val()->Clear(); @@ -2301,8 +2301,8 @@ namespace nirfmxwlan_grpc { [&](auto x) { return x; }); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2327,7 +2327,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexDouble()); auto array_size = actual_array_size; @@ -2337,18 +2337,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2373,7 +2373,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector attr_val(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -2383,18 +2383,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(attr_val, response->mutable_attr_val()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_attr_val()->size(); - if (shrunk_size != current_size) { - response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(attr_val, response->mutable_attr_val()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_attr_val()->size(); + if (shrunk_size != current_size) { + response->mutable_attr_val()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2419,7 +2419,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeString(instrument, selector_string, attribute_id, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -2433,11 +2433,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -2461,10 +2461,10 @@ namespace nirfmxwlan_grpc { uInt16 attr_val {}; auto status = library_->GetAttributeU16(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2487,10 +2487,10 @@ namespace nirfmxwlan_grpc { uInt32 attr_val {}; auto status = library_->GetAttributeU32(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2514,7 +2514,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeU32Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt32* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -2525,11 +2525,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2554,7 +2554,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeU64Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); uInt64* attr_val = reinterpret_cast(response->mutable_attr_val()->mutable_data()); @@ -2565,11 +2565,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2593,10 +2593,10 @@ namespace nirfmxwlan_grpc { uInt8 attr_val {}; auto status = library_->GetAttributeU8(instrument, selector_string, attribute_id, &attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2620,7 +2620,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetAttributeU8Array(instrument, selector_string, attribute_id, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string attr_val(actual_array_size, '\0'); auto array_size = actual_array_size; @@ -2630,12 +2630,12 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_attr_val(attr_val); - response->mutable_attr_val()->resize(actual_array_size); - response->set_actual_array_size(actual_array_size); + response->set_attr_val(attr_val); + response->mutable_attr_val()->resize(actual_array_size); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -2658,7 +2658,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetError(instrument, nullptr, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -2673,12 +2673,12 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2702,7 +2702,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->GetErrorString(instrument, error_code, 0, nullptr); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 error_description_buffer_size = status; @@ -2716,11 +2716,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2751,11 +2751,11 @@ namespace nirfmxwlan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXWLAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); - response->set_is_new_session(is_new_session); + response->mutable_instrument()->set_id(session_id); + response->set_is_new_session(is_new_session); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2787,10 +2787,10 @@ namespace nirfmxwlan_grpc { auto cleanup_lambda = [&] (niRFmxInstrHandle id) { library_->Close(id, RFMXWLAN_VAL_FALSE); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, 0); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } response->set_status(status); - response->mutable_instrument()->set_id(session_id); + response->mutable_instrument()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2815,7 +2815,7 @@ namespace nirfmxwlan_grpc { char* result_name = (char*)request->result_name().c_str(); auto status = library_->Initiate(instrument, selector_string, result_name); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2839,7 +2839,7 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->OFDMModAccAutoLevel(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2866,7 +2866,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->reference_waveform().size()); auto status = library_->OFDMModAccCfg1ReferenceWaveform(instrument, selector_string, x0, dx, reference_waveform.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2906,7 +2906,7 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->OFDMModAccCfgAcquisitionLength(instrument, selector_string, acquisition_length_mode, acquisition_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2945,7 +2945,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgAmplitudeTrackingEnabled(instrument, selector_string, amplitude_tracking_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -2985,7 +2985,7 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->OFDMModAccCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3024,7 +3024,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgChannelEstimationType(instrument, selector_string, channel_estimation_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3063,7 +3063,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgCommonClockSourceEnabled(instrument, selector_string, common_clock_source_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3102,7 +3102,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgEVMUnit(instrument, selector_string, evm_unit); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3141,7 +3141,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgFrequencyErrorEstimationMethod(instrument, selector_string, frequency_error_estimation_method); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3166,7 +3166,7 @@ namespace nirfmxwlan_grpc { int32 maximum_measurement_length = request->maximum_measurement_length(); auto status = library_->OFDMModAccCfgMeasurementLength(instrument, selector_string, measurement_offset, maximum_measurement_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3205,7 +3205,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgMeasurementMode(instrument, selector_string, measurement_mode); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3251,7 +3251,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgNReferenceWaveforms(instrument, selector_string, x0, dx, reference_waveform.data(), reference_waveform_sizes, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3290,7 +3290,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgNoiseCompensationEnabled(instrument, selector_string, noise_compensation_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3330,7 +3330,7 @@ namespace nirfmxwlan_grpc { double optimize_dynamic_range_for_evm_margin = request->optimize_dynamic_range_for_evm_margin(); auto status = library_->OFDMModAccCfgOptimizeDynamicRangeForEVM(instrument, selector_string, optimize_dynamic_range_for_evm_enabled, optimize_dynamic_range_for_evm_margin); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3369,7 +3369,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgPhaseTrackingEnabled(instrument, selector_string, phase_tracking_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3408,7 +3408,7 @@ namespace nirfmxwlan_grpc { auto status = library_->OFDMModAccCfgSymbolClockErrorCorrectionEnabled(instrument, selector_string, symbol_clock_error_correction_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3430,7 +3430,7 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->OFDMModAccClearNoiseCalibrationDatabase(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -3458,7 +3458,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchChainDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_chain_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_data_rms_evm_per_symbol_mean = response->mutable_chain_data_rms_evm_per_symbol_mean()->mutable_data(); @@ -3469,13 +3469,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_chain_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_chain_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3502,7 +3502,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchChainPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_chain_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_pilot_rms_evm_per_symbol_mean = response->mutable_chain_pilot_rms_evm_per_symbol_mean()->mutable_data(); @@ -3513,13 +3513,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_chain_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_chain_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3545,12 +3545,12 @@ namespace nirfmxwlan_grpc { float64 chain_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchChainRMSEVM(instrument, selector_string, timeout, &chain_rms_evm_mean, &chain_data_rms_evm_mean, &chain_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_chain_rms_evm_mean(chain_rms_evm_mean); - response->set_chain_data_rms_evm_mean(chain_data_rms_evm_mean); - response->set_chain_pilot_rms_evm_mean(chain_pilot_rms_evm_mean); + response->set_chain_rms_evm_mean(chain_rms_evm_mean); + response->set_chain_data_rms_evm_mean(chain_data_rms_evm_mean); + response->set_chain_pilot_rms_evm_mean(chain_pilot_rms_evm_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3576,7 +3576,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchChainRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_chain_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* chain_rms_evm_per_subcarrier_mean = response->mutable_chain_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -3587,13 +3587,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_chain_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_chain_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3620,7 +3620,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchChainRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_chain_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* chain_rms_evm_per_symbol_mean = response->mutable_chain_rms_evm_per_symbol_mean()->mutable_data(); @@ -3631,13 +3631,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_chain_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_chain_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3664,7 +3664,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchChannelFrequencyResponseMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_channel_frequency_response_mean_magnitude()->Resize(actual_array_size, 0); float32* channel_frequency_response_mean_magnitude = response->mutable_channel_frequency_response_mean_magnitude()->mutable_data(); @@ -3677,14 +3677,14 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_channel_frequency_response_mean_magnitude()->Resize(actual_array_size, 0); - response->mutable_channel_frequency_response_mean_phase()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_channel_frequency_response_mean_magnitude()->Resize(actual_array_size, 0); + response->mutable_channel_frequency_response_mean_phase()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3711,7 +3711,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchCommonPilotErrorTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_common_pilot_error_magnitude()->Resize(actual_array_size, 0); float32* common_pilot_error_magnitude = response->mutable_common_pilot_error_magnitude()->mutable_data(); @@ -3724,14 +3724,14 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_common_pilot_error_magnitude()->Resize(actual_array_size, 0); - response->mutable_common_pilot_error_phase()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_common_pilot_error_magnitude()->Resize(actual_array_size, 0); + response->mutable_common_pilot_error_phase()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3757,12 +3757,12 @@ namespace nirfmxwlan_grpc { float64 composite_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchCompositeRMSEVM(instrument, selector_string, timeout, &composite_rms_evm_mean, &composite_data_rms_evm_mean, &composite_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_composite_rms_evm_mean(composite_rms_evm_mean); - response->set_composite_data_rms_evm_mean(composite_data_rms_evm_mean); - response->set_composite_pilot_rms_evm_mean(composite_pilot_rms_evm_mean); + response->set_composite_rms_evm_mean(composite_rms_evm_mean); + response->set_composite_data_rms_evm_mean(composite_data_rms_evm_mean); + response->set_composite_pilot_rms_evm_mean(composite_pilot_rms_evm_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3785,10 +3785,10 @@ namespace nirfmxwlan_grpc { float64 cross_power_mean {}; auto status = library_->OFDMModAccFetchCrossPower(instrument, selector_string, timeout, &cross_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_cross_power_mean(cross_power_mean); + response->set_cross_power_mean(cross_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3812,7 +3812,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchCustomGatePowersArray(instrument, selector_string, timeout, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_average_power_mean()->Resize(actual_array_size, 0); float64* average_power_mean = response->mutable_average_power_mean()->mutable_data(); @@ -3825,12 +3825,12 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_average_power_mean()->Resize(actual_array_size, 0); - response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_average_power_mean()->Resize(actual_array_size, 0); + response->mutable_peak_power_maximum()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3854,10 +3854,10 @@ namespace nirfmxwlan_grpc { float64 data_average_power_mean {}; auto status = library_->OFDMModAccFetchDataAveragePower(instrument, selector_string, timeout, &data_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_data_average_power_mean(data_average_power_mean); + response->set_data_average_power_mean(data_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3881,7 +3881,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -3891,18 +3891,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(data_constellation, response->mutable_data_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(data_constellation, response->mutable_data_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3926,10 +3926,10 @@ namespace nirfmxwlan_grpc { float64 data_peak_power_maximum {}; auto status = library_->OFDMModAccFetchDataPeakPower(instrument, selector_string, timeout, &data_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_data_peak_power_maximum(data_peak_power_maximum); + response->set_data_peak_power_maximum(data_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3953,7 +3953,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedEHTSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); int32* decoded_eht_sig_bits = reinterpret_cast(response->mutable_decoded_eht_sig_bits()->mutable_data()); @@ -3964,11 +3964,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_eht_sig_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -3993,7 +3993,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedLSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); int32* decoded_l_sig_bits = reinterpret_cast(response->mutable_decoded_l_sig_bits()->mutable_data()); @@ -4004,11 +4004,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_l_sig_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4033,7 +4033,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedPSDUBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); int32* decoded_psdu_bits = reinterpret_cast(response->mutable_decoded_psdu_bits()->mutable_data()); @@ -4044,11 +4044,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_psdu_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4073,7 +4073,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedSIGBBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); int32* decoded_sig_b_bits = reinterpret_cast(response->mutable_decoded_sig_b_bits()->mutable_data()); @@ -4084,11 +4084,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_sig_b_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4113,7 +4113,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); int32* decoded_sig_bits = reinterpret_cast(response->mutable_decoded_sig_bits()->mutable_data()); @@ -4124,11 +4124,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_sig_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4153,7 +4153,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedServiceBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); int32* decoded_service_bits = reinterpret_cast(response->mutable_decoded_service_bits()->mutable_data()); @@ -4164,11 +4164,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_service_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4193,7 +4193,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchDecodedUSIGBitsTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); int32* decoded_u_sig_bits = reinterpret_cast(response->mutable_decoded_u_sig_bits()->mutable_data()); @@ -4204,11 +4204,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_decoded_u_sig_bits()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4233,7 +4233,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchEVMSubcarrierIndices(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); int32* subcarrier_indices = reinterpret_cast(response->mutable_subcarrier_indices()->mutable_data()); @@ -4244,11 +4244,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_subcarrier_indices()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4272,10 +4272,10 @@ namespace nirfmxwlan_grpc { float64 frequency_error_ccdf_10_percent {}; auto status = library_->OFDMModAccFetchFrequencyErrorCCDF10Percent(instrument, selector_string, timeout, &frequency_error_ccdf_10_percent); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_frequency_error_ccdf_10_percent(frequency_error_ccdf_10_percent); + response->set_frequency_error_ccdf_10_percent(frequency_error_ccdf_10_percent); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4298,10 +4298,10 @@ namespace nirfmxwlan_grpc { float64 frequency_error_mean {}; auto status = library_->OFDMModAccFetchFrequencyErrorMean(instrument, selector_string, timeout, &frequency_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_frequency_error_mean(frequency_error_mean); + response->set_frequency_error_mean(frequency_error_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4327,7 +4327,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchGroupDelayMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_group_delay_mean()->Resize(actual_array_size, 0); float32* group_delay_mean = response->mutable_group_delay_mean()->mutable_data(); @@ -4338,13 +4338,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_group_delay_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_group_delay_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4368,11 +4368,11 @@ namespace nirfmxwlan_grpc { int32 guard_interval_type {}; auto status = library_->OFDMModAccFetchGuardIntervalType(instrument, selector_string, timeout, &guard_interval_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_guard_interval_type(static_cast(guard_interval_type)); - response->set_guard_interval_type_raw(guard_interval_type); + response->set_guard_interval_type(static_cast(guard_interval_type)); + response->set_guard_interval_type_raw(guard_interval_type); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4398,7 +4398,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchIQGainImbalancePerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_gain_imbalance_per_subcarrier_mean = response->mutable_iq_gain_imbalance_per_subcarrier_mean()->mutable_data(); @@ -4409,13 +4409,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_iq_gain_imbalance_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4443,14 +4443,14 @@ namespace nirfmxwlan_grpc { float64 iq_timing_skew_mean {}; auto status = library_->OFDMModAccFetchIQImpairments(instrument, selector_string, timeout, &relative_iq_origin_offset_mean, &iq_gain_imbalance_mean, &iq_quadrature_error_mean, &absolute_iq_origin_offset_mean, &iq_timing_skew_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_relative_iq_origin_offset_mean(relative_iq_origin_offset_mean); - response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); - response->set_iq_quadrature_error_mean(iq_quadrature_error_mean); - response->set_absolute_iq_origin_offset_mean(absolute_iq_origin_offset_mean); - response->set_iq_timing_skew_mean(iq_timing_skew_mean); + response->set_relative_iq_origin_offset_mean(relative_iq_origin_offset_mean); + response->set_iq_gain_imbalance_mean(iq_gain_imbalance_mean); + response->set_iq_quadrature_error_mean(iq_quadrature_error_mean); + response->set_absolute_iq_origin_offset_mean(absolute_iq_origin_offset_mean); + response->set_iq_timing_skew_mean(iq_timing_skew_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4476,7 +4476,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchIQQuadratureErrorPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* iq_quadrature_error_per_subcarrier_mean = response->mutable_iq_quadrature_error_per_subcarrier_mean()->mutable_data(); @@ -4487,13 +4487,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_iq_quadrature_error_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4517,11 +4517,11 @@ namespace nirfmxwlan_grpc { int32 l_sig_parity_check_status {}; auto status = library_->OFDMModAccFetchLSIGParityCheckStatus(instrument, selector_string, timeout, &l_sig_parity_check_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_l_sig_parity_check_status(static_cast(l_sig_parity_check_status)); - response->set_l_sig_parity_check_status_raw(l_sig_parity_check_status); + response->set_l_sig_parity_check_status(static_cast(l_sig_parity_check_status)); + response->set_l_sig_parity_check_status_raw(l_sig_parity_check_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4544,11 +4544,11 @@ namespace nirfmxwlan_grpc { int32 ltf_size {}; auto status = library_->OFDMModAccFetchLTFSize(instrument, selector_string, timeout, <f_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ltf_size(static_cast(ltf_size)); - response->set_ltf_size_raw(ltf_size); + response->set_ltf_size(static_cast(ltf_size)); + response->set_ltf_size_raw(ltf_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4571,10 +4571,10 @@ namespace nirfmxwlan_grpc { int32 mcs_index {}; auto status = library_->OFDMModAccFetchMCSIndex(instrument, selector_string, timeout, &mcs_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_mcs_index(mcs_index); + response->set_mcs_index(mcs_index); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4597,10 +4597,10 @@ namespace nirfmxwlan_grpc { int32 number_of_he_sig_b_symbols {}; auto status = library_->OFDMModAccFetchNumberOfHESIGBSymbols(instrument, selector_string, timeout, &number_of_he_sig_b_symbols); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_number_of_he_sig_b_symbols(number_of_he_sig_b_symbols); + response->set_number_of_he_sig_b_symbols(number_of_he_sig_b_symbols); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4623,10 +4623,10 @@ namespace nirfmxwlan_grpc { int32 number_of_space_time_streams {}; auto status = library_->OFDMModAccFetchNumberOfSpaceTimeStreams(instrument, selector_string, timeout, &number_of_space_time_streams); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_number_of_space_time_streams(number_of_space_time_streams); + response->set_number_of_space_time_streams(number_of_space_time_streams); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4649,10 +4649,10 @@ namespace nirfmxwlan_grpc { int32 number_of_users {}; auto status = library_->OFDMModAccFetchNumberOfUsers(instrument, selector_string, timeout, &number_of_users); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_number_of_users(number_of_users); + response->set_number_of_users(number_of_users); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4675,10 +4675,10 @@ namespace nirfmxwlan_grpc { int32 number_of_symbols_used {}; auto status = library_->OFDMModAccFetchNumberofSymbolsUsed(instrument, selector_string, timeout, &number_of_symbols_used); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_number_of_symbols_used(number_of_symbols_used); + response->set_number_of_symbols_used(number_of_symbols_used); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4701,10 +4701,10 @@ namespace nirfmxwlan_grpc { float64 pe_average_power_mean {}; auto status = library_->OFDMModAccFetchPEAveragePower(instrument, selector_string, timeout, &pe_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pe_average_power_mean(pe_average_power_mean); + response->set_pe_average_power_mean(pe_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4727,10 +4727,10 @@ namespace nirfmxwlan_grpc { float64 pe_duration {}; auto status = library_->OFDMModAccFetchPEDuration(instrument, selector_string, timeout, &pe_duration); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pe_duration(pe_duration); + response->set_pe_duration(pe_duration); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4753,10 +4753,10 @@ namespace nirfmxwlan_grpc { float64 pe_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPEPeakPower(instrument, selector_string, timeout, &pe_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_pe_peak_power_maximum(pe_peak_power_maximum); + response->set_pe_peak_power_maximum(pe_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4779,10 +4779,10 @@ namespace nirfmxwlan_grpc { float64 ppdu_average_power_mean {}; auto status = library_->OFDMModAccFetchPPDUAveragePower(instrument, selector_string, timeout, &ppdu_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ppdu_average_power_mean(ppdu_average_power_mean); + response->set_ppdu_average_power_mean(ppdu_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4805,10 +4805,10 @@ namespace nirfmxwlan_grpc { float64 ppdu_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPPDUPeakPower(instrument, selector_string, timeout, &ppdu_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); + response->set_ppdu_peak_power_maximum(ppdu_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4831,11 +4831,11 @@ namespace nirfmxwlan_grpc { int32 ppdu_type {}; auto status = library_->OFDMModAccFetchPPDUType(instrument, selector_string, timeout, &ppdu_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ppdu_type(static_cast(ppdu_type)); - response->set_ppdu_type_raw(ppdu_type); + response->set_ppdu_type(static_cast(ppdu_type)); + response->set_ppdu_type_raw(ppdu_type); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4858,11 +4858,11 @@ namespace nirfmxwlan_grpc { int32 psdu_crc_status {}; auto status = library_->OFDMModAccFetchPSDUCRCStatus(instrument, selector_string, timeout, &psdu_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_psdu_crc_status(static_cast(psdu_crc_status)); - response->set_psdu_crc_status_raw(psdu_crc_status); + response->set_psdu_crc_status(static_cast(psdu_crc_status)); + response->set_psdu_crc_status_raw(psdu_crc_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4886,7 +4886,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchPilotConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector pilot_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -4896,18 +4896,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(pilot_constellation, response->mutable_pilot_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_pilot_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_pilot_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(pilot_constellation, response->mutable_pilot_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_pilot_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_pilot_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -4934,13 +4934,13 @@ namespace nirfmxwlan_grpc { float64 vht_sig_b_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211ac(instrument, selector_string, timeout, &vht_sig_a_average_power_mean, &vht_stf_average_power_mean, &vht_ltf_average_power_mean, &vht_sig_b_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_vht_sig_a_average_power_mean(vht_sig_a_average_power_mean); - response->set_vht_stf_average_power_mean(vht_stf_average_power_mean); - response->set_vht_ltf_average_power_mean(vht_ltf_average_power_mean); - response->set_vht_sig_b_average_power_mean(vht_sig_b_average_power_mean); + response->set_vht_sig_a_average_power_mean(vht_sig_a_average_power_mean); + response->set_vht_stf_average_power_mean(vht_stf_average_power_mean); + response->set_vht_ltf_average_power_mean(vht_ltf_average_power_mean); + response->set_vht_sig_b_average_power_mean(vht_sig_b_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -4967,14 +4967,14 @@ namespace nirfmxwlan_grpc { float64 he_ltf_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211ax(instrument, selector_string, timeout, &rl_sig_average_power_mean, &he_sig_a_average_power_mean, &he_sig_b_average_power_mean, &he_stf_average_power_mean, &he_ltf_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_rl_sig_average_power_mean(rl_sig_average_power_mean); - response->set_he_sig_a_average_power_mean(he_sig_a_average_power_mean); - response->set_he_sig_b_average_power_mean(he_sig_b_average_power_mean); - response->set_he_stf_average_power_mean(he_stf_average_power_mean); - response->set_he_ltf_average_power_mean(he_ltf_average_power_mean); + response->set_rl_sig_average_power_mean(rl_sig_average_power_mean); + response->set_he_sig_a_average_power_mean(he_sig_a_average_power_mean); + response->set_he_sig_b_average_power_mean(he_sig_b_average_power_mean); + response->set_he_stf_average_power_mean(he_stf_average_power_mean); + response->set_he_ltf_average_power_mean(he_ltf_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5000,13 +5000,13 @@ namespace nirfmxwlan_grpc { float64 ht_eltf_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowers80211n(instrument, selector_string, timeout, &ht_sig_average_power_mean, &ht_stf_average_power_mean, &ht_dltf_average_power_mean, &ht_eltf_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ht_sig_average_power_mean(ht_sig_average_power_mean); - response->set_ht_stf_average_power_mean(ht_stf_average_power_mean); - response->set_ht_dltf_average_power_mean(ht_dltf_average_power_mean); - response->set_ht_eltf_average_power_mean(ht_eltf_average_power_mean); + response->set_ht_sig_average_power_mean(ht_sig_average_power_mean); + response->set_ht_stf_average_power_mean(ht_stf_average_power_mean); + response->set_ht_dltf_average_power_mean(ht_dltf_average_power_mean); + response->set_ht_eltf_average_power_mean(ht_eltf_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5031,12 +5031,12 @@ namespace nirfmxwlan_grpc { float64 l_sig_average_power_mean {}; auto status = library_->OFDMModAccFetchPreambleAveragePowersCommon(instrument, selector_string, timeout, &l_stf_average_power_mean, &l_ltf_average_power_mean, &l_sig_average_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_l_stf_average_power_mean(l_stf_average_power_mean); - response->set_l_ltf_average_power_mean(l_ltf_average_power_mean); - response->set_l_sig_average_power_mean(l_sig_average_power_mean); + response->set_l_stf_average_power_mean(l_stf_average_power_mean); + response->set_l_ltf_average_power_mean(l_ltf_average_power_mean); + response->set_l_sig_average_power_mean(l_sig_average_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5062,7 +5062,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchPreambleFrequencyErrorTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_preamble_frequency_error()->Resize(actual_array_size, 0); float32* preamble_frequency_error = response->mutable_preamble_frequency_error()->mutable_data(); @@ -5073,13 +5073,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_preamble_frequency_error()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_preamble_frequency_error()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5106,13 +5106,13 @@ namespace nirfmxwlan_grpc { float64 vht_sig_b_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211ac(instrument, selector_string, timeout, &vht_sig_a_peak_power_maximum, &vht_stf_peak_power_maximum, &vht_ltf_peak_power_maximum, &vht_sig_b_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_vht_sig_a_peak_power_maximum(vht_sig_a_peak_power_maximum); - response->set_vht_stf_peak_power_maximum(vht_stf_peak_power_maximum); - response->set_vht_ltf_peak_power_maximum(vht_ltf_peak_power_maximum); - response->set_vht_sig_b_peak_power_maximum(vht_sig_b_peak_power_maximum); + response->set_vht_sig_a_peak_power_maximum(vht_sig_a_peak_power_maximum); + response->set_vht_stf_peak_power_maximum(vht_stf_peak_power_maximum); + response->set_vht_ltf_peak_power_maximum(vht_ltf_peak_power_maximum); + response->set_vht_sig_b_peak_power_maximum(vht_sig_b_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5139,14 +5139,14 @@ namespace nirfmxwlan_grpc { float64 he_ltf_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211ax(instrument, selector_string, timeout, &rl_sig_peak_power_maximum, &he_sig_a_peak_power_maximum, &he_sig_b_peak_power_maximum, &he_stf_peak_power_maximum, &he_ltf_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_rl_sig_peak_power_maximum(rl_sig_peak_power_maximum); - response->set_he_sig_a_peak_power_maximum(he_sig_a_peak_power_maximum); - response->set_he_sig_b_peak_power_maximum(he_sig_b_peak_power_maximum); - response->set_he_stf_peak_power_maximum(he_stf_peak_power_maximum); - response->set_he_ltf_peak_power_maximum(he_ltf_peak_power_maximum); + response->set_rl_sig_peak_power_maximum(rl_sig_peak_power_maximum); + response->set_he_sig_a_peak_power_maximum(he_sig_a_peak_power_maximum); + response->set_he_sig_b_peak_power_maximum(he_sig_b_peak_power_maximum); + response->set_he_stf_peak_power_maximum(he_stf_peak_power_maximum); + response->set_he_ltf_peak_power_maximum(he_ltf_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5172,13 +5172,13 @@ namespace nirfmxwlan_grpc { float64 ht_eltf_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowers80211n(instrument, selector_string, timeout, &ht_sig_peak_power_maximum, &ht_stf_peak_power_maximum, &ht_dltf_peak_power_maximum, &ht_eltf_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ht_sig_peak_power_maximum(ht_sig_peak_power_maximum); - response->set_ht_stf_peak_power_maximum(ht_stf_peak_power_maximum); - response->set_ht_dltf_peak_power_maximum(ht_dltf_peak_power_maximum); - response->set_ht_eltf_peak_power_maximum(ht_eltf_peak_power_maximum); + response->set_ht_sig_peak_power_maximum(ht_sig_peak_power_maximum); + response->set_ht_stf_peak_power_maximum(ht_stf_peak_power_maximum); + response->set_ht_dltf_peak_power_maximum(ht_dltf_peak_power_maximum); + response->set_ht_eltf_peak_power_maximum(ht_eltf_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5203,12 +5203,12 @@ namespace nirfmxwlan_grpc { float64 l_sig_peak_power_maximum {}; auto status = library_->OFDMModAccFetchPreamblePeakPowersCommon(instrument, selector_string, timeout, &l_stf_peak_power_maximum, &l_ltf_peak_power_maximum, &l_sig_peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_l_stf_peak_power_maximum(l_stf_peak_power_maximum); - response->set_l_ltf_peak_power_maximum(l_ltf_peak_power_maximum); - response->set_l_sig_peak_power_maximum(l_sig_peak_power_maximum); + response->set_l_stf_peak_power_maximum(l_stf_peak_power_maximum); + response->set_l_ltf_peak_power_maximum(l_ltf_peak_power_maximum); + response->set_l_sig_peak_power_maximum(l_sig_peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5232,11 +5232,11 @@ namespace nirfmxwlan_grpc { int32 ru_size {}; auto status = library_->OFDMModAccFetchRUOffsetAndSize(instrument, selector_string, timeout, &ru_offset, &ru_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_ru_offset(ru_offset); - response->set_ru_size(ru_size); + response->set_ru_offset(ru_offset); + response->set_ru_size(ru_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5259,11 +5259,11 @@ namespace nirfmxwlan_grpc { int32 sig_b_crc_status {}; auto status = library_->OFDMModAccFetchSIGBCRCStatus(instrument, selector_string, timeout, &sig_b_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_sig_b_crc_status(static_cast(sig_b_crc_status)); - response->set_sig_b_crc_status_raw(sig_b_crc_status); + response->set_sig_b_crc_status(static_cast(sig_b_crc_status)); + response->set_sig_b_crc_status_raw(sig_b_crc_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5286,11 +5286,11 @@ namespace nirfmxwlan_grpc { int32 sig_crc_status {}; auto status = library_->OFDMModAccFetchSIGCRCStatus(instrument, selector_string, timeout, &sig_crc_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_sig_crc_status(static_cast(sig_crc_status)); - response->set_sig_crc_status_raw(sig_crc_status); + response->set_sig_crc_status(static_cast(sig_crc_status)); + response->set_sig_crc_status_raw(sig_crc_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5314,11 +5314,11 @@ namespace nirfmxwlan_grpc { int32 spectral_flatness_margin_subcarrier_index {}; auto status = library_->OFDMModAccFetchSpectralFlatness(instrument, selector_string, timeout, &spectral_flatness_margin, &spectral_flatness_margin_subcarrier_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_spectral_flatness_margin(spectral_flatness_margin); - response->set_spectral_flatness_margin_subcarrier_index(spectral_flatness_margin_subcarrier_index); + response->set_spectral_flatness_margin(spectral_flatness_margin); + response->set_spectral_flatness_margin_subcarrier_index(spectral_flatness_margin_subcarrier_index); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5344,7 +5344,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchSpectralFlatnessMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectral_flatness_mean()->Resize(actual_array_size, 0); float32* spectral_flatness_mean = response->mutable_spectral_flatness_mean()->mutable_data(); @@ -5359,15 +5359,15 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectral_flatness_mean()->Resize(actual_array_size, 0); - response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); - response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectral_flatness_mean()->Resize(actual_array_size, 0); + response->mutable_spectral_flatness_lower_mask()->Resize(actual_array_size, 0); + response->mutable_spectral_flatness_upper_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5394,7 +5394,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchStreamDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_data_rms_evm_per_symbol_mean = response->mutable_stream_data_rms_evm_per_symbol_mean()->mutable_data(); @@ -5405,13 +5405,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5438,7 +5438,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchStreamPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_pilot_rms_evm_per_symbol_mean = response->mutable_stream_pilot_rms_evm_per_symbol_mean()->mutable_data(); @@ -5449,13 +5449,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5481,12 +5481,12 @@ namespace nirfmxwlan_grpc { float64 stream_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchStreamRMSEVM(instrument, selector_string, timeout, &stream_rms_evm_mean, &stream_data_rms_evm_mean, &stream_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_stream_rms_evm_mean(stream_rms_evm_mean); - response->set_stream_data_rms_evm_mean(stream_data_rms_evm_mean); - response->set_stream_pilot_rms_evm_mean(stream_pilot_rms_evm_mean); + response->set_stream_rms_evm_mean(stream_rms_evm_mean); + response->set_stream_data_rms_evm_mean(stream_data_rms_evm_mean); + response->set_stream_pilot_rms_evm_mean(stream_pilot_rms_evm_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5512,7 +5512,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchStreamRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* stream_rms_evm_per_subcarrier_mean = response->mutable_stream_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -5523,13 +5523,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5556,7 +5556,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchStreamRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* stream_rms_evm_per_symbol_mean = response->mutable_stream_rms_evm_per_symbol_mean()->mutable_data(); @@ -5567,13 +5567,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5601,7 +5601,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchSubcarrierChainEVMPerSymbolTrace(instrument, selector_string, timeout, subcarrier_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_subcarrier_chain_evm_per_symbol()->Resize(actual_array_size, 0); float32* subcarrier_chain_evm_per_symbol = response->mutable_subcarrier_chain_evm_per_symbol()->mutable_data(); @@ -5612,13 +5612,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_subcarrier_chain_evm_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_subcarrier_chain_evm_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5646,7 +5646,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchSubcarrierStreamEVMPerSymbolTrace(instrument, selector_string, timeout, subcarrier_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_subcarrier_stream_evm_per_symbol()->Resize(actual_array_size, 0); float32* subcarrier_stream_evm_per_symbol = response->mutable_subcarrier_stream_evm_per_symbol()->mutable_data(); @@ -5657,13 +5657,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_subcarrier_stream_evm_per_symbol()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_subcarrier_stream_evm_per_symbol()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5691,7 +5691,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchSymbolChainEVMPerSubcarrierTrace(instrument, selector_string, timeout, symbol_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_symbol_chain_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* symbol_chain_evm_per_subcarrier = response->mutable_symbol_chain_evm_per_subcarrier()->mutable_data(); @@ -5702,13 +5702,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_symbol_chain_evm_per_subcarrier()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_symbol_chain_evm_per_subcarrier()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5732,10 +5732,10 @@ namespace nirfmxwlan_grpc { float64 symbol_clock_error_mean {}; auto status = library_->OFDMModAccFetchSymbolClockErrorMean(instrument, selector_string, timeout, &symbol_clock_error_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_symbol_clock_error_mean(symbol_clock_error_mean); + response->set_symbol_clock_error_mean(symbol_clock_error_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5762,7 +5762,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchSymbolStreamEVMPerSubcarrierTrace(instrument, selector_string, timeout, symbol_index, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_symbol_stream_evm_per_subcarrier()->Resize(actual_array_size, 0); float32* symbol_stream_evm_per_subcarrier = response->mutable_symbol_stream_evm_per_subcarrier()->mutable_data(); @@ -5773,13 +5773,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_symbol_stream_evm_per_subcarrier()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_symbol_stream_evm_per_subcarrier()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5804,11 +5804,11 @@ namespace nirfmxwlan_grpc { int32 unused_tone_error_margin_ru_index {}; auto status = library_->OFDMModAccFetchUnusedToneError(instrument, selector_string, timeout, &unused_tone_error_margin, &unused_tone_error_margin_ru_index); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_unused_tone_error_margin(unused_tone_error_margin); - response->set_unused_tone_error_margin_ru_index(unused_tone_error_margin_ru_index); + response->set_unused_tone_error_margin(unused_tone_error_margin); + response->set_unused_tone_error_margin_ru_index(unused_tone_error_margin_ru_index); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -5832,7 +5832,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUnusedToneErrorMarginPerRU(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); float64* unused_tone_error_margin_per_ru = response->mutable_unused_tone_error_margin_per_ru()->mutable_data(); @@ -5843,11 +5843,11 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_unused_tone_error_margin_per_ru()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5874,7 +5874,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUnusedToneErrorMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_unused_tone_error()->Resize(actual_array_size, 0); float32* unused_tone_error = response->mutable_unused_tone_error()->mutable_data(); @@ -5887,14 +5887,14 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_unused_tone_error()->Resize(actual_array_size, 0); - response->mutable_unused_tone_error_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_unused_tone_error()->Resize(actual_array_size, 0); + response->mutable_unused_tone_error_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5919,7 +5919,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUserDataConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector user_data_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5929,18 +5929,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(user_data_constellation, response->mutable_user_data_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_user_data_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_user_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(user_data_constellation, response->mutable_user_data_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_user_data_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_user_data_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -5965,7 +5965,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUserPilotConstellationTrace(instrument, selector_string, timeout, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::vector user_pilot_constellation(actual_array_size, NIComplexSingle()); auto array_size = actual_array_size; @@ -5975,18 +5975,18 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - convert_to_grpc(user_pilot_constellation, response->mutable_user_pilot_constellation()); - { - auto shrunk_size = actual_array_size; - auto current_size = response->mutable_user_pilot_constellation()->size(); - if (shrunk_size != current_size) { - response->mutable_user_pilot_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(user_pilot_constellation, response->mutable_user_pilot_constellation()); + { + auto shrunk_size = actual_array_size; + auto current_size = response->mutable_user_pilot_constellation()->size(); + if (shrunk_size != current_size) { + response->mutable_user_pilot_constellation()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_actual_array_size(actual_array_size); + } + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6010,10 +6010,10 @@ namespace nirfmxwlan_grpc { float64 user_power_mean {}; auto status = library_->OFDMModAccFetchUserPower(instrument, selector_string, timeout, &user_power_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_user_power_mean(user_power_mean); + response->set_user_power_mean(user_power_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6039,7 +6039,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUserStreamDataRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_user_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_data_rms_evm_per_symbol_mean = response->mutable_user_stream_data_rms_evm_per_symbol_mean()->mutable_data(); @@ -6050,13 +6050,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_user_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_user_stream_data_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6083,7 +6083,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUserStreamPilotRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_pilot_rms_evm_per_symbol_mean = response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->mutable_data(); @@ -6094,13 +6094,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_user_stream_pilot_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6126,12 +6126,12 @@ namespace nirfmxwlan_grpc { float64 user_stream_pilot_rms_evm_mean {}; auto status = library_->OFDMModAccFetchUserStreamRMSEVM(instrument, selector_string, timeout, &user_stream_rms_evm_mean, &user_stream_data_rms_evm_mean, &user_stream_pilot_rms_evm_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_user_stream_rms_evm_mean(user_stream_rms_evm_mean); - response->set_user_stream_data_rms_evm_mean(user_stream_data_rms_evm_mean); - response->set_user_stream_pilot_rms_evm_mean(user_stream_pilot_rms_evm_mean); + response->set_user_stream_rms_evm_mean(user_stream_rms_evm_mean); + response->set_user_stream_data_rms_evm_mean(user_stream_data_rms_evm_mean); + response->set_user_stream_pilot_rms_evm_mean(user_stream_pilot_rms_evm_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6157,7 +6157,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUserStreamRMSEVMPerSubcarrierMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_user_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); float32* user_stream_rms_evm_per_subcarrier_mean = response->mutable_user_stream_rms_evm_per_subcarrier_mean()->mutable_data(); @@ -6168,13 +6168,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_user_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_user_stream_rms_evm_per_subcarrier_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6201,7 +6201,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->OFDMModAccFetchUserStreamRMSEVMPerSymbolMeanTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_user_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); float32* user_stream_rms_evm_per_symbol_mean = response->mutable_user_stream_rms_evm_per_symbol_mean()->mutable_data(); @@ -6212,13 +6212,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_user_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_user_stream_rms_evm_per_symbol_mean()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6241,11 +6241,11 @@ namespace nirfmxwlan_grpc { int32 calibration_data_valid {}; auto status = library_->OFDMModAccValidateCalibrationData(instrument, selector_string, &calibration_data_valid); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_calibration_data_valid(static_cast(calibration_data_valid)); - response->set_calibration_data_valid_raw(calibration_data_valid); + response->set_calibration_data_valid(static_cast(calibration_data_valid)); + response->set_calibration_data_valid_raw(calibration_data_valid); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6267,7 +6267,7 @@ namespace nirfmxwlan_grpc { float64 acquisition_length = request->acquisition_length(); auto status = library_->PowerRampCfgAcquisitionLength(instrument, selector_string, acquisition_length); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6307,7 +6307,7 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->PowerRampCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6335,7 +6335,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->PowerRampFetchFallTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_raw_waveform()->Resize(actual_array_size, 0); float32* raw_waveform = response->mutable_raw_waveform()->mutable_data(); @@ -6352,16 +6352,16 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_raw_waveform()->Resize(actual_array_size, 0); - response->mutable_processed_waveform()->Resize(actual_array_size, 0); - response->mutable_threshold()->Resize(actual_array_size, 0); - response->mutable_power_reference()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_raw_waveform()->Resize(actual_array_size, 0); + response->mutable_processed_waveform()->Resize(actual_array_size, 0); + response->mutable_threshold()->Resize(actual_array_size, 0); + response->mutable_power_reference()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6386,11 +6386,11 @@ namespace nirfmxwlan_grpc { float64 fall_time_mean {}; auto status = library_->PowerRampFetchMeasurement(instrument, selector_string, timeout, &rise_time_mean, &fall_time_mean); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_rise_time_mean(rise_time_mean); - response->set_fall_time_mean(fall_time_mean); + response->set_rise_time_mean(rise_time_mean); + response->set_fall_time_mean(fall_time_mean); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6416,7 +6416,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->PowerRampFetchRiseTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_raw_waveform()->Resize(actual_array_size, 0); float32* raw_waveform = response->mutable_raw_waveform()->mutable_data(); @@ -6433,16 +6433,16 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_raw_waveform()->Resize(actual_array_size, 0); - response->mutable_processed_waveform()->Resize(actual_array_size, 0); - response->mutable_threshold()->Resize(actual_array_size, 0); - response->mutable_power_reference()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_raw_waveform()->Resize(actual_array_size, 0); + response->mutable_processed_waveform()->Resize(actual_array_size, 0); + response->mutable_threshold()->Resize(actual_array_size, 0); + response->mutable_power_reference()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6465,7 +6465,7 @@ namespace nirfmxwlan_grpc { int32 attribute_id = request->attribute_id(); auto status = library_->ResetAttribute(instrument, selector_string, attribute_id); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6488,7 +6488,7 @@ namespace nirfmxwlan_grpc { char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->ResetToDefault(instrument, selector_string); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6544,7 +6544,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count, averaging_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6583,7 +6583,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgMaskType(instrument, selector_string, mask_type); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6607,7 +6607,7 @@ namespace nirfmxwlan_grpc { int32 number_of_offsets = request->number_of_offsets(); auto status = library_->SEMCfgNumberOfOffsets(instrument, selector_string, number_of_offsets); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6660,7 +6660,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgOffsetFrequencyArray(instrument, selector_string, offset_start_frequency, offset_stop_frequency, offset_sideband, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6702,7 +6702,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SEMCfgOffsetRelativeLimitArray(instrument, selector_string, relative_limit_start, relative_limit_stop, number_of_elements); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6742,7 +6742,7 @@ namespace nirfmxwlan_grpc { float64 span = request->span(); auto status = library_->SEMCfgSpan(instrument, selector_string, span_auto, span); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6782,7 +6782,7 @@ namespace nirfmxwlan_grpc { float64 sweep_time_interval = request->sweep_time_interval(); auto status = library_->SEMCfgSweepTime(instrument, selector_string, sweep_time_auto, sweep_time_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -6808,11 +6808,11 @@ namespace nirfmxwlan_grpc { float64 relative_power {}; auto status = library_->SEMFetchCarrierMeasurement(instrument, selector_string, timeout, &absolute_power, &relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_absolute_power(absolute_power); - response->set_relative_power(relative_power); + response->set_absolute_power(absolute_power); + response->set_relative_power(relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6839,15 +6839,15 @@ namespace nirfmxwlan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchLowerOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6871,7 +6871,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -6890,7 +6890,7 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -6902,12 +6902,12 @@ namespace nirfmxwlan_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -6935,14 +6935,14 @@ namespace nirfmxwlan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchLowerOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_absolute_power(total_absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_peak_relative_power(peak_relative_power); + response->set_total_absolute_power(total_absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_peak_relative_power(peak_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -6966,7 +6966,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->SEMFetchLowerOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); @@ -6985,15 +6985,15 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_total_absolute_power()->Resize(actual_array_size, 0); - response->mutable_total_relative_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_peak_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); + response->mutable_total_relative_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_peak_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7017,11 +7017,11 @@ namespace nirfmxwlan_grpc { int32 measurement_status {}; auto status = library_->SEMFetchMeasurementStatus(instrument, selector_string, timeout, &measurement_status); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7047,7 +7047,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->SEMFetchSpectrum(instrument, selector_string, timeout, &x0, &dx, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_spectrum()->Resize(actual_array_size, 0); float32* spectrum = response->mutable_spectrum()->mutable_data(); @@ -7060,14 +7060,14 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_spectrum()->Resize(actual_array_size, 0); - response->mutable_composite_mask()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_spectrum()->Resize(actual_array_size, 0); + response->mutable_composite_mask()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7095,15 +7095,15 @@ namespace nirfmxwlan_grpc { float64 margin_relative_power {}; auto status = library_->SEMFetchUpperOffsetMargin(instrument, selector_string, timeout, &measurement_status, &margin, &margin_frequency, &margin_absolute_power, &margin_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_measurement_status(static_cast(measurement_status)); - response->set_measurement_status_raw(measurement_status); - response->set_margin(margin); - response->set_margin_frequency(margin_frequency); - response->set_margin_absolute_power(margin_absolute_power); - response->set_margin_relative_power(margin_relative_power); + response->set_measurement_status(static_cast(measurement_status)); + response->set_measurement_status_raw(measurement_status); + response->set_margin(margin); + response->set_margin_frequency(margin_frequency); + response->set_margin_absolute_power(margin_absolute_power); + response->set_margin_relative_power(margin_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7127,7 +7127,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetMarginArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_measurement_status_raw()->Resize(actual_array_size, 0); int32* measurement_status = reinterpret_cast(response->mutable_measurement_status_raw()->mutable_data()); @@ -7146,7 +7146,7 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); response->mutable_measurement_status()->Clear(); @@ -7158,12 +7158,12 @@ namespace nirfmxwlan_grpc { [&](auto x) { return static_cast(x); }); - response->mutable_measurement_status()->Resize(actual_array_size, 0); - response->mutable_margin()->Resize(actual_array_size, 0); - response->mutable_margin_frequency()->Resize(actual_array_size, 0); - response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); - response->mutable_margin_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_measurement_status()->Resize(actual_array_size, 0); + response->mutable_margin()->Resize(actual_array_size, 0); + response->mutable_margin_frequency()->Resize(actual_array_size, 0); + response->mutable_margin_absolute_power()->Resize(actual_array_size, 0); + response->mutable_margin_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7191,14 +7191,14 @@ namespace nirfmxwlan_grpc { float64 peak_relative_power {}; auto status = library_->SEMFetchUpperOffsetPower(instrument, selector_string, timeout, &total_absolute_power, &total_relative_power, &peak_absolute_power, &peak_frequency, &peak_relative_power); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_total_absolute_power(total_absolute_power); - response->set_total_relative_power(total_relative_power); - response->set_peak_absolute_power(peak_absolute_power); - response->set_peak_frequency(peak_frequency); - response->set_peak_relative_power(peak_relative_power); + response->set_total_absolute_power(total_absolute_power); + response->set_total_relative_power(total_relative_power); + response->set_peak_absolute_power(peak_absolute_power); + response->set_peak_frequency(peak_frequency); + response->set_peak_relative_power(peak_relative_power); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -7222,7 +7222,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->SEMFetchUpperOffsetPowerArray(instrument, selector_string, timeout, nullptr, nullptr, nullptr, nullptr, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_total_absolute_power()->Resize(actual_array_size, 0); float64* total_absolute_power = response->mutable_total_absolute_power()->mutable_data(); @@ -7241,15 +7241,15 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->mutable_total_absolute_power()->Resize(actual_array_size, 0); - response->mutable_total_relative_power()->Resize(actual_array_size, 0); - response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); - response->mutable_peak_frequency()->Resize(actual_array_size, 0); - response->mutable_peak_relative_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->mutable_total_absolute_power()->Resize(actual_array_size, 0); + response->mutable_total_relative_power()->Resize(actual_array_size, 0); + response->mutable_peak_absolute_power()->Resize(actual_array_size, 0); + response->mutable_peak_frequency()->Resize(actual_array_size, 0); + response->mutable_peak_relative_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -7288,7 +7288,7 @@ namespace nirfmxwlan_grpc { int32 enable_all_traces = request->enable_all_traces(); auto status = library_->SelectMeasurements(instrument, selector_string, measurements, enable_all_traces); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7310,7 +7310,7 @@ namespace nirfmxwlan_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); auto status = library_->SendSoftwareEdgeTrigger(instrument); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7335,7 +7335,7 @@ namespace nirfmxwlan_grpc { float32 attr_val = request->attr_val(); auto status = library_->SetAttributeF32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7361,7 +7361,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7386,7 +7386,7 @@ namespace nirfmxwlan_grpc { float64 attr_val = request->attr_val(); auto status = library_->SetAttributeF64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7412,7 +7412,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeF64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7446,7 +7446,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeI16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7489,7 +7489,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeI32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7523,7 +7523,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7548,7 +7548,7 @@ namespace nirfmxwlan_grpc { int64 attr_val = request->attr_val(); auto status = library_->SetAttributeI64(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7574,7 +7574,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7608,7 +7608,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeI8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7654,7 +7654,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeI8Array(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7683,7 +7683,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexDoubleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7709,7 +7709,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeNIComplexSingleArray(instrument, selector_string, attribute_id, attr_val.data(), array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7753,7 +7753,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeString(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7787,7 +7787,7 @@ namespace nirfmxwlan_grpc { auto status = library_->SetAttributeU16(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7815,7 +7815,7 @@ namespace nirfmxwlan_grpc { uInt32 attr_val = request->attr_val(); auto status = library_->SetAttributeU32(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7841,7 +7841,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU32Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7867,7 +7867,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU64Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7892,7 +7892,7 @@ namespace nirfmxwlan_grpc { uInt8 attr_val = request->attr_val(); auto status = library_->SetAttributeU8(instrument, selector_string, attribute_id, attr_val); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7918,7 +7918,7 @@ namespace nirfmxwlan_grpc { int32 array_size = static_cast(request->attr_val().size()); auto status = library_->SetAttributeU8Array(instrument, selector_string, attribute_id, attr_val, array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7958,7 +7958,7 @@ namespace nirfmxwlan_grpc { int32 averaging_count = request->averaging_count(); auto status = library_->TXPCfgAveraging(instrument, selector_string, averaging_enabled, averaging_count); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -7997,7 +7997,7 @@ namespace nirfmxwlan_grpc { auto status = library_->TXPCfgBurstDetectionEnabled(instrument, selector_string, burst_detection_enabled); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8021,7 +8021,7 @@ namespace nirfmxwlan_grpc { float64 maximum_measurement_interval = request->maximum_measurement_interval(); auto status = library_->TXPCfgMaximumMeasurementInterval(instrument, selector_string, maximum_measurement_interval); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8047,11 +8047,11 @@ namespace nirfmxwlan_grpc { float64 peak_power_maximum {}; auto status = library_->TXPFetchMeasurement(instrument, selector_string, timeout, &average_power_mean, &peak_power_maximum); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_average_power_mean(average_power_mean); - response->set_peak_power_maximum(peak_power_maximum); + response->set_average_power_mean(average_power_mean); + response->set_peak_power_maximum(peak_power_maximum); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -8077,7 +8077,7 @@ namespace nirfmxwlan_grpc { while (true) { auto status = library_->TXPFetchPowerTrace(instrument, selector_string, timeout, &x0, &dx, nullptr, 0, &actual_array_size); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_power()->Resize(actual_array_size, 0); float32* power = response->mutable_power()->mutable_data(); @@ -8088,13 +8088,13 @@ namespace nirfmxwlan_grpc { continue; } if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); - response->set_x0(x0); - response->set_dx(dx); - response->mutable_power()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + response->set_x0(x0); + response->set_dx(dx); + response->mutable_power()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -8116,7 +8116,7 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForAcquisitionComplete(instrument, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; @@ -8140,7 +8140,7 @@ namespace nirfmxwlan_grpc { float64 timeout = request->timeout(); auto status = library_->WaitForMeasurementComplete(instrument, selector_string, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusForniRFmxInstrHandle(status, instrument); + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nirfmxwlan/nirfmxwlan_service.h b/generated/nirfmxwlan/nirfmxwlan_service.h index 8e2565a5d..6bedbb971 100644 --- a/generated/nirfmxwlan/nirfmxwlan_service.h +++ b/generated/nirfmxwlan/nirfmxwlan_service.h @@ -277,7 +277,7 @@ class NiRFmxWLANService final : public NiRFmxWLAN::Service { NiRFmxWLANLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; ViSessionResourceRepositorySharedPtr vi_session_resource_repository_; - ::grpc::Status ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle); std::map frequencyreferencesource_input_map_ { {1, "OnboardClock"},{2, "RefIn"},{3, "PXI_Clk"},{4, "ClkIn"}, }; std::map frequencyreferencesource_output_map_ { {"OnboardClock", 1},{"RefIn", 2},{"PXI_Clk", 3},{"ClkIn", 4}, }; std::map nirfmxwlanstringattributevaluesmapped_input_map_ { {1, "PFI0"},{2, "PFI1"},{3, "PXI_Trig0"},{4, "PXI_Trig1"},{5, "PXI_Trig2"},{6, "PXI_Trig3"},{7, "PXI_Trig4"},{8, "PXI_Trig5"},{9, "PXI_Trig6"},{10, "PXI_Trig7"},{11, "PXI_STAR"},{12, "PXIe_DStarB"},{13, "TimerEvent"}, }; diff --git a/generated/nirfsa/nirfsa_service.cpp b/generated/nirfsa/nirfsa_service.cpp index 9605c230a..1c6ac7940 100644 --- a/generated/nirfsa/nirfsa_service.cpp +++ b/generated/nirfsa/nirfsa_service.cpp @@ -84,7 +84,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1203,8 +1203,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1229,9 +1229,9 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_code(error_code); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1320,8 +1320,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1351,8 +1351,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1382,8 +1382,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1412,8 +1412,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1442,8 +1442,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1472,8 +1472,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1499,7 +1499,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1525,7 +1525,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1551,7 +1551,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1577,7 +1577,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1603,8 +1603,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(value); - response->mutable_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(value); + response->mutable_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1645,8 +1645,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -1671,8 +1671,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_info(info); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); + response->set_info(info); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1696,7 +1696,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_info_size(info_size); + response->set_info_size(info_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1732,16 +1732,16 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(sparameters, response->mutable_sparameters()); - { - auto shrunk_size = number_of_sparameters; - auto current_size = response->mutable_sparameters()->size(); - if (shrunk_size != current_size) { - response->mutable_sparameters()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(sparameters, response->mutable_sparameters()); + { + auto shrunk_size = number_of_sparameters; + auto current_size = response->mutable_sparameters()->size(); + if (shrunk_size != current_size) { + response->mutable_sparameters()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_number_of_sparameters(number_of_sparameters); - response->set_number_of_ports(number_of_ports); + } + response->set_number_of_sparameters(number_of_sparameters); + response->set_number_of_ports(number_of_ports); return ::grpc::Status::OK; } } @@ -1799,10 +1799,10 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_frequencies()->Resize(number_of_frequencies, 0); - response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); - response->mutable_phase_response()->Resize(number_of_frequencies, 0); - response->set_number_of_frequencies(number_of_frequencies); + response->mutable_frequencies()->Resize(number_of_frequencies, 0); + response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); + response->mutable_phase_response()->Resize(number_of_frequencies, 0); + response->set_number_of_frequencies(number_of_frequencies); return ::grpc::Status::OK; } } @@ -1843,9 +1843,9 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -1874,11 +1874,11 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1902,7 +1902,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1926,7 +1926,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_months(months); + response->set_months(months); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1952,7 +1952,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_backlog(backlog); + response->set_backlog(backlog); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1993,10 +1993,10 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_frequencies()->Resize(number_of_frequencies, 0); - response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); - response->mutable_phase_response()->Resize(number_of_frequencies, 0); - response->set_number_of_frequencies(number_of_frequencies); + response->mutable_frequencies()->Resize(number_of_frequencies, 0); + response->mutable_magnitude_response()->Resize(number_of_frequencies, 0); + response->mutable_phase_response()->Resize(number_of_frequencies, 0); + response->set_number_of_frequencies(number_of_frequencies); return ::grpc::Status::OK; } } @@ -2033,15 +2033,15 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); - { - auto shrunk_size = number_of_coefficient_sets; - auto current_size = response->mutable_coefficient_info()->size(); - if (shrunk_size != current_size) { - response->mutable_coefficient_info()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); + { + auto shrunk_size = number_of_coefficient_sets; + auto current_size = response->mutable_coefficient_info()->size(); + if (shrunk_size != current_size) { + response->mutable_coefficient_info()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_number_of_coefficient_sets(number_of_coefficient_sets); + } + response->set_number_of_coefficient_sets(number_of_coefficient_sets); return ::grpc::Status::OK; } } @@ -2067,7 +2067,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_number_of_spectral_lines(number_of_spectral_lines); + response->set_number_of_spectral_lines(number_of_spectral_lines); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2106,9 +2106,9 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); - response->set_buffer_size(buffer_size); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_buffer_size(buffer_size); return ::grpc::Status::OK; } } @@ -2145,8 +2145,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_operations_count()->Resize(buffer_size, 0); - response->set_buffer_size(buffer_size); + response->mutable_operations_count()->Resize(buffer_size, 0); + response->set_buffer_size(buffer_size); return ::grpc::Status::OK; } } @@ -2183,15 +2183,15 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); - { - auto shrunk_size = number_of_coefficient_sets; - auto current_size = response->mutable_coefficient_info()->size(); - if (shrunk_size != current_size) { - response->mutable_coefficient_info()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); + { + auto shrunk_size = number_of_coefficient_sets; + auto current_size = response->mutable_coefficient_info()->size(); + if (shrunk_size != current_size) { + response->mutable_coefficient_info()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_number_of_coefficient_sets(number_of_coefficient_sets); + } + response->set_number_of_coefficient_sets(number_of_coefficient_sets); return ::grpc::Status::OK; } } @@ -2221,11 +2221,11 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2250,7 +2250,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temp(temp); + response->set_temp(temp); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2274,7 +2274,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); + convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2299,7 +2299,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_writer_handle(writer_handle); + response->set_writer_handle(writer_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2344,8 +2344,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_terminal_name(terminal_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); + response->set_terminal_name(terminal_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2381,9 +2381,9 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_data(data); - response->mutable_data()->resize(actual_data_size); - response->set_actual_data_size(actual_data_size); + response->set_data(data); + response->mutable_data()->resize(actual_data_size); + response->set_actual_data_size(actual_data_size); return ::grpc::Status::OK; } } @@ -2417,7 +2417,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2454,7 +2454,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2526,28 +2526,28 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_cal_valid(self_cal_valid); - if (valid_steps & 0x1) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_ALIGNMENT); - if (valid_steps & 0x2) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_GAIN_REFERENCE); - if (valid_steps & 0x4) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_IF_FLATNESS); - if (valid_steps & 0x8) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_DIGITIZER_SELF_CAL); - if (valid_steps & 0x10) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_LO_SELF_CAL); - if (valid_steps & 0x20) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_AMPLITUDE_ACCURACY); - if (valid_steps & 0x40) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_RESIDUAL_LO_POWER); - if (valid_steps & 0x80) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_IMAGE_SUPPRESSION); - if (valid_steps & 0x100) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_SYNTHESIZER_ALIGNMENT); - if (valid_steps & 0x200) - response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_DC_OFFSET); - response->set_valid_steps_raw(valid_steps); + response->set_self_cal_valid(self_cal_valid); + if (valid_steps & 0x1) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_ALIGNMENT); + if (valid_steps & 0x2) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_GAIN_REFERENCE); + if (valid_steps & 0x4) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_IF_FLATNESS); + if (valid_steps & 0x8) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_DIGITIZER_SELF_CAL); + if (valid_steps & 0x10) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_LO_SELF_CAL); + if (valid_steps & 0x20) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_AMPLITUDE_ACCURACY); + if (valid_steps & 0x40) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_RESIDUAL_LO_POWER); + if (valid_steps & 0x80) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_IMAGE_SUPPRESSION); + if (valid_steps & 0x100) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_SYNTHESIZER_ALIGNMENT); + if (valid_steps & 0x200) + response->add_valid_steps_array(SelfCalibrateSteps::SELF_CALIBRATE_STEPS_DC_OFFSET); + response->set_valid_steps_raw(valid_steps); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2597,8 +2597,8 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(data, response->mutable_data()); - convert_to_grpc(wfm_info, response->mutable_wfm_info()); + convert_to_grpc(data, response->mutable_data()); + convert_to_grpc(wfm_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2627,7 +2627,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); + convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2656,7 +2656,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); + convert_to_grpc(spectrum_info, response->mutable_spectrum_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2809,10 +2809,10 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_driver_rev(driver_rev); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_rev())); - response->set_instr_rev(instr_rev); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instr_rev())); + response->set_driver_rev(driver_rev); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_rev())); + response->set_instr_rev(instr_rev); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instr_rev())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2939,9 +2939,9 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_test_result(test_result); - response->set_test_message(test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_test_message())); + response->set_test_result(test_result); + response->set_test_message(test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -3214,7 +3214,7 @@ namespace nirfsa_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_data(data); + response->set_data(data); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nirfsg/nirfsg_service.cpp b/generated/nirfsg/nirfsg_service.cpp index 755f2449d..8a8446ce8 100644 --- a/generated/nirfsg/nirfsg_service.cpp +++ b/generated/nirfsg/nirfsg_service.cpp @@ -307,7 +307,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_is_done(is_done); + response->set_is_done(is_done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -332,7 +332,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_list_exists(list_exists); + response->set_list_exists(list_exists); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -357,7 +357,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_script_exists(script_exists); + response->set_script_exists(script_exists); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -382,7 +382,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_waveform_exists(waveform_exists); + response->set_waveform_exists(waveform_exists); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1625,8 +1625,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1651,9 +1651,9 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_code(error_code); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1757,7 +1757,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1783,7 +1783,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1809,7 +1809,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1835,7 +1835,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1861,8 +1861,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(value); - response->mutable_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(value); + response->mutable_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1903,8 +1903,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -1945,8 +1945,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); return ::grpc::Status::OK; } } @@ -1983,16 +1983,16 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - convert_to_grpc(sparameters, response->mutable_sparameters()); - { - auto shrunk_size = number_of_sparameters; - auto current_size = response->mutable_sparameters()->size(); - if (shrunk_size != current_size) { - response->mutable_sparameters()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + convert_to_grpc(sparameters, response->mutable_sparameters()); + { + auto shrunk_size = number_of_sparameters; + auto current_size = response->mutable_sparameters()->size(); + if (shrunk_size != current_size) { + response->mutable_sparameters()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } - response->set_number_of_sparameters(number_of_sparameters); - response->set_number_of_ports(number_of_ports); + } + response->set_number_of_sparameters(number_of_sparameters); + response->set_number_of_ports(number_of_ports); return ::grpc::Status::OK; } } @@ -2033,9 +2033,9 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_code(error_code); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } } @@ -2065,12 +2065,12 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); - response->set_second(second); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); + response->set_second(second); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2115,12 +2115,12 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); - response->set_second(second); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); + response->set_second(second); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2160,7 +2160,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2235,8 +2235,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_terminal_name(terminal_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); + response->set_terminal_name(terminal_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_terminal_name())); return ::grpc::Status::OK; } } @@ -2273,9 +2273,9 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_data(data); - response->mutable_data()->resize(actual_data_size); - response->set_actual_data_size(actual_data_size); + response->set_data(data); + response->mutable_data()->resize(actual_data_size); + response->set_actual_data_size(actual_data_size); return ::grpc::Status::OK; } } @@ -2313,8 +2313,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_locations()->Resize(required_size, 0); - response->set_required_size(required_size); + response->mutable_locations()->Resize(required_size, 0); + response->set_required_size(required_size); return ::grpc::Status::OK; } } @@ -2352,8 +2352,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_locations()->Resize(required_size, 0); - response->set_required_size(required_size); + response->mutable_locations()->Resize(required_size, 0); + response->set_required_size(required_size); return ::grpc::Status::OK; } } @@ -2391,8 +2391,8 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->mutable_locations()->Resize(required_size, 0); - response->set_required_size(required_size); + response->mutable_locations()->Resize(required_size, 0); + response->set_required_size(required_size); return ::grpc::Status::OK; } } @@ -2426,7 +2426,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_new_vi()->set_id(session_id); + response->mutable_new_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2463,7 +2463,7 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2605,10 +2605,10 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_max_number_waveforms(max_number_waveforms); - response->set_waveform_quantum(waveform_quantum); - response->set_min_waveform_size(min_waveform_size); - response->set_max_waveform_size(max_waveform_size); + response->set_max_number_waveforms(max_number_waveforms); + response->set_waveform_quantum(waveform_quantum); + response->set_min_waveform_size(min_waveform_size); + response->set_max_waveform_size(max_waveform_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2786,10 +2786,10 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_instrument_driver_revision(instrument_driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_instrument_driver_revision(instrument_driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2925,9 +2925,9 @@ namespace nirfsg_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/niscope/niscope_service.cpp b/generated/niscope/niscope_service.cpp index 0768db20c..e858bda41 100644 --- a/generated/niscope/niscope_service.cpp +++ b/generated/niscope/niscope_service.cpp @@ -83,8 +83,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_acquisition_status(static_cast(acquisition_status)); - response->set_acquisition_status_raw(acquisition_status); + response->set_acquisition_status(static_cast(acquisition_status)); + response->set_acquisition_status_raw(acquisition_status); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -124,7 +124,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_meas_waveform_size(meas_waveform_size); + response->set_meas_waveform_size(meas_waveform_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -149,7 +149,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_num_wfms(num_wfms); + response->set_num_wfms(num_wfms); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -173,7 +173,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_record_length(record_length); + response->set_record_length(record_length); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1508,8 +1508,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_description(error_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); + response->set_error_description(error_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_description())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1545,7 +1545,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_configuration(configuration); + response->set_configuration(configuration); return ::grpc::Status::OK; } } @@ -1654,7 +1654,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1680,7 +1680,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1706,7 +1706,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1732,7 +1732,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1758,8 +1758,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(value); - response->mutable_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(value); + response->mutable_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1800,8 +1800,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -1842,8 +1842,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_channel_string(channel_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); + response->set_channel_string(channel_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_string())); return ::grpc::Status::OK; } } @@ -1884,8 +1884,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_name(name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); + response->set_name(name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_name())); return ::grpc::Status::OK; } } @@ -1952,9 +1952,9 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_description(description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); + response->set_error_code(error_code); + response->set_description(description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); return ::grpc::Status::OK; } } @@ -1995,8 +1995,8 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } } @@ -2029,7 +2029,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_number_of_frequencies(number_of_frequencies); + response->set_number_of_frequencies(number_of_frequencies); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2054,7 +2054,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_writer_handle(writer_handle); + response->set_writer_handle(writer_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2134,7 +2134,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2171,7 +2171,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2309,10 +2309,10 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_driver_revision(driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_driver_revision(driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2336,7 +2336,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_sample_mode(sample_mode); + response->set_sample_mode(sample_mode); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2360,7 +2360,7 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_sample_rate(sample_rate); + response->set_sample_rate(sample_rate); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -2385,9 +2385,9 @@ namespace niscope_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/niswitch/niswitch_service.cpp b/generated/niswitch/niswitch_service.cpp index e965d939d..2426db5db 100644 --- a/generated/niswitch/niswitch_service.cpp +++ b/generated/niswitch/niswitch_service.cpp @@ -85,8 +85,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_path_capability(static_cast(path_capability)); - response->set_path_capability_raw(path_capability); + response->set_path_capability(static_cast(path_capability)); + response->set_path_capability_raw(path_capability); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -573,8 +573,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -599,9 +599,9 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_code(error_code); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_code(error_code); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -627,7 +627,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -653,7 +653,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -679,7 +679,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); + response->set_attribute_value(attribute_value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -720,8 +720,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_attribute_value(attribute_value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); + response->set_attribute_value(attribute_value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attribute_value())); return ::grpc::Status::OK; } } @@ -748,8 +748,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(attribute_value); - response->mutable_attribute_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(attribute_value); + response->mutable_attribute_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -789,8 +789,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_channel_name_buffer(channel_name_buffer); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name_buffer())); + response->set_channel_name_buffer(channel_name_buffer); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_channel_name_buffer())); return ::grpc::Status::OK; } } @@ -831,9 +831,9 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_code(code); - response->set_description(description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); + response->set_code(code); + response->set_description(description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_description())); return ::grpc::Status::OK; } } @@ -873,8 +873,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_coercion_record(coercion_record); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); + response->set_coercion_record(coercion_record); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_coercion_record())); return ::grpc::Status::OK; } } @@ -914,8 +914,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_interchange_warning(interchange_warning); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); + response->set_interchange_warning(interchange_warning); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_interchange_warning())); return ::grpc::Status::OK; } } @@ -957,8 +957,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_path(path); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_path())); + response->set_path(path); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_path())); return ::grpc::Status::OK; } } @@ -984,7 +984,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_relay_count(relay_count); + response->set_relay_count(relay_count); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1024,8 +1024,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_relay_name_buffer(relay_name_buffer); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_relay_name_buffer())); + response->set_relay_name_buffer(relay_name_buffer); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_relay_name_buffer())); return ::grpc::Status::OK; } } @@ -1051,8 +1051,8 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_relay_position(static_cast(relay_position)); - response->set_relay_position_raw(relay_position); + response->set_relay_position(static_cast(relay_position)); + response->set_relay_position_raw(relay_position); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1085,7 +1085,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1122,7 +1122,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1159,7 +1159,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1230,7 +1230,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_is_debounced(is_debounced); + response->set_is_debounced(is_debounced); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1254,7 +1254,7 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_is_scanning(is_scanning); + response->set_is_scanning(is_scanning); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1384,10 +1384,10 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_instrument_driver_revision(instrument_driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_instrument_driver_revision(instrument_driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_instrument_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1561,9 +1561,9 @@ namespace niswitch_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nisync/nisync_service.cpp b/generated/nisync/nisync_service.cpp index e2fcba96f..d468dcbb1 100644 --- a/generated/nisync/nisync_service.cpp +++ b/generated/nisync/nisync_service.cpp @@ -69,7 +69,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -120,8 +120,8 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_error_message(error_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); + response->set_error_message(error_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -190,9 +190,9 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_self_test_result(self_test_result); - response->set_self_test_message(self_test_message); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); + response->set_self_test_result(self_test_result); + response->set_self_test_message(self_test_message); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_self_test_message())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -217,10 +217,10 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_driver_revision(driver_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); - response->set_firmware_revision(firmware_revision); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); + response->set_driver_revision(driver_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_driver_revision())); + response->set_firmware_revision(firmware_revision); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_firmware_revision())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -422,9 +422,9 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_duration(actual_duration); - response->set_frequency(frequency); - response->set_error(error); + response->set_actual_duration(actual_duration); + response->set_frequency(frequency); + response->set_error(error); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -453,9 +453,9 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_actual_duration(actual_duration); - response->set_frequency(frequency); - response->set_frequency_error(frequency_error); + response->set_actual_duration(actual_duration); + response->set_frequency(frequency); + response->set_frequency_error(frequency_error); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -595,9 +595,9 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_time_seconds(time_seconds); - response->set_time_nanoseconds(time_nanoseconds); - response->set_time_fractional_nanoseconds(time_fractional_nanoseconds); + response->set_time_seconds(time_seconds); + response->set_time_nanoseconds(time_nanoseconds); + response->set_time_fractional_nanoseconds(time_fractional_nanoseconds); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -747,10 +747,10 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_time_seconds(time_seconds); - response->set_time_nanoseconds(time_nanoseconds); - response->set_time_fractional_nanoseconds(time_fractional_nanoseconds); - response->set_detected_edge(detected_edge); + response->set_time_seconds(time_seconds); + response->set_time_nanoseconds(time_nanoseconds); + response->set_time_fractional_nanoseconds(time_fractional_nanoseconds); + response->set_detected_edge(detected_edge); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1041,12 +1041,12 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_timestamp_seconds(timestamp_seconds); - response->set_timestamp_nanoseconds(timestamp_nanoseconds); - response->set_timestamp_fractional_nanoseconds(timestamp_fractional_nanoseconds); - response->set_gps_seconds(gps_seconds); - response->set_gps_nanoseconds(gps_nanoseconds); - response->set_gps_fractional_nanoseconds(gps_fractional_nanoseconds); + response->set_timestamp_seconds(timestamp_seconds); + response->set_timestamp_nanoseconds(timestamp_nanoseconds); + response->set_timestamp_fractional_nanoseconds(timestamp_fractional_nanoseconds); + response->set_gps_seconds(gps_seconds); + response->set_gps_nanoseconds(gps_nanoseconds); + response->set_gps_fractional_nanoseconds(gps_fractional_nanoseconds); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1076,12 +1076,12 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_timestamp_seconds(timestamp_seconds); - response->set_timestamp_nanoseconds(timestamp_nanoseconds); - response->set_timestamp_fractional_nanoseconds(timestamp_fractional_nanoseconds); - response->set_irigb_seconds(irigb_seconds); - response->set_irigb_nanoseconds(irigb_nanoseconds); - response->set_irigb_fractional_nanoseconds(irigb_fractional_nanoseconds); + response->set_timestamp_seconds(timestamp_seconds); + response->set_timestamp_nanoseconds(timestamp_nanoseconds); + response->set_timestamp_fractional_nanoseconds(timestamp_fractional_nanoseconds); + response->set_irigb_seconds(irigb_seconds); + response->set_irigb_nanoseconds(irigb_nanoseconds); + response->set_irigb_fractional_nanoseconds(irigb_fractional_nanoseconds); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1152,9 +1152,9 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_east_velocity(east_velocity); - response->set_north_velocity(north_velocity); - response->set_up_velocity(up_velocity); + response->set_east_velocity(east_velocity); + response->set_north_velocity(north_velocity); + response->set_up_velocity(up_velocity); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1180,9 +1180,9 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_latitude(latitude); - response->set_longitude(longitude); - response->set_altitude(altitude); + response->set_latitude(latitude); + response->set_longitude(longitude); + response->set_altitude(altitude); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1221,8 +1221,8 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_time_reference_names(time_reference_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_time_reference_names())); + response->set_time_reference_names(time_reference_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_time_reference_names())); return ::grpc::Status::OK; } } @@ -1249,7 +1249,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1275,7 +1275,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1301,7 +1301,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1342,8 +1342,8 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_value(value); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); + response->set_value(value); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_value())); return ::grpc::Status::OK; } } @@ -1472,11 +1472,11 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_year(year); - response->set_month(month); - response->set_day(day); - response->set_hour(hour); - response->set_minute(minute); + response->set_year(year); + response->set_month(month); + response->set_day(day); + response->set_hour(hour); + response->set_minute(minute); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1500,7 +1500,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temp(temp); + response->set_temp(temp); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1524,7 +1524,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_months(months); + response->set_months(months); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1572,7 +1572,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_temperature(temperature); + response->set_temperature(temperature); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1596,7 +1596,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_voltage(voltage); + response->set_voltage(voltage); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1620,7 +1620,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_voltage(voltage); + response->set_voltage(voltage); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1644,7 +1644,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_voltage(voltage); + response->set_voltage(voltage); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1668,7 +1668,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_phase(phase); + response->set_phase(phase); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1700,7 +1700,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->mutable_vi()->set_id(session_id); + response->mutable_vi()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1751,7 +1751,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_old_voltage(old_voltage); + response->set_old_voltage(old_voltage); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1776,7 +1776,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_old_voltage(old_voltage); + response->set_old_voltage(old_voltage); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1801,7 +1801,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_old_voltage(old_voltage); + response->set_old_voltage(old_voltage); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1826,7 +1826,7 @@ namespace nisync_grpc { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); - response->set_old_phase(old_phase); + response->set_old_phase(old_phase); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nitclk/nitclk_service.cpp b/generated/nitclk/nitclk_service.cpp index 04b91ef5e..916a4360c 100644 --- a/generated/nitclk/nitclk_service.cpp +++ b/generated/nitclk/nitclk_service.cpp @@ -119,7 +119,7 @@ namespace nitclk_grpc { return ConvertApiErrorStatusForViSession(status, session); } response->set_status(status); - response->set_value(value); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -145,8 +145,8 @@ namespace nitclk_grpc { return ConvertApiErrorStatusForViSession(status, session); } response->set_status(status); - auto session_id = session_repository_->resolve_session_id(value); - response->mutable_value()->set_id(session_id); + auto session_id = session_repository_->resolve_session_id(value); + response->mutable_value()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -183,8 +183,8 @@ namespace nitclk_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->set_error_string(error_string); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); + response->set_error_string(error_string); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error_string())); return ::grpc::Status::OK; } } @@ -243,7 +243,7 @@ namespace nitclk_grpc { return ConvertApiErrorStatusForViSession(status, 0); } response->set_status(status); - response->set_done(done); + response->set_done(done); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nixnet/nixnet_service.cpp b/generated/nixnet/nixnet_service.cpp index 0dd2972e4..200c34538 100644 --- a/generated/nixnet/nixnet_service.cpp +++ b/generated/nixnet/nixnet_service.cpp @@ -72,7 +72,7 @@ namespace nixnet_grpc { auto status = library_->Blink(interface_ref, modifier); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, interface_ref); + return ConvertApiErrorStatusForNxSessionRef_t(status, interface_ref); } response->set_status(status); return ::grpc::Status::OK; @@ -95,7 +95,7 @@ namespace nixnet_grpc { session_repository_->remove_session(session_grpc_session.id(), session_grpc_session.name()); auto status = library_->Clear(session); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -157,7 +157,7 @@ namespace nixnet_grpc { auto status = library_->ConnectTerminals(session, source, destination); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -202,10 +202,10 @@ namespace nixnet_grpc { u32 number_of_bytes_returned {}; auto status = library_->ConvertByteArrayToFramesSinglePoint(session, value_buffer, size_of_value_buffer, buffer.data(), size_of_buffer, &number_of_bytes_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); + convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -229,10 +229,10 @@ namespace nixnet_grpc { std::string value_buffer(size_of_value_buffer, '\0'); auto status = library_->ConvertFramesToByteArraySinglePoint(session, frame_buffer, number_of_bytes_for_frames, (u8*)value_buffer.data(), size_of_value_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - response->set_value_buffer(value_buffer); + response->set_value_buffer(value_buffer); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -261,7 +261,7 @@ namespace nixnet_grpc { nxTimestamp100ns_t* timestamp_buffer = reinterpret_cast(response->mutable_timestamp_buffer()->mutable_data()); auto status = library_->ConvertFramesToSignalsSinglePoint(session, frame_buffer, number_of_bytes_for_frames, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -306,10 +306,10 @@ namespace nixnet_grpc { u32 number_of_bytes_returned {}; auto status = library_->ConvertSignalsToFramesSinglePoint(session, value_buffer, size_of_value_buffer, buffer.data(), size_of_buffer, &number_of_bytes_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); + convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -329,10 +329,10 @@ namespace nixnet_grpc { nxTimestamp1ns_t to_timestamp_1ns {}; auto status = library_->ConvertTimestamp100nsTo1ns(from_timestamp_100ns, &to_timestamp_1ns); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->set_to_timestamp_1ns(to_timestamp_1ns); + response->set_to_timestamp_1ns(to_timestamp_1ns); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -352,10 +352,10 @@ namespace nixnet_grpc { nxTimestamp100ns_t to_timestamp_100ns {}; auto status = library_->ConvertTimestamp1nsTo100ns(from_timestamp_1ns, &to_timestamp_100ns); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->set_to_timestamp_100ns(to_timestamp_100ns); + response->set_to_timestamp_100ns(to_timestamp_100ns); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -402,10 +402,10 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->Clear(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->mutable_session()->set_id(session_id); + response->mutable_session()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -460,10 +460,10 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->Clear(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->mutable_session()->set_id(session_id); + response->mutable_session()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -487,7 +487,7 @@ namespace nixnet_grpc { u32 default_baud_rate = request->default_baud_rate(); auto status = library_->DbAddAlias(database_alias, database_filepath, default_baud_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); return ::grpc::Status::OK; @@ -510,7 +510,7 @@ namespace nixnet_grpc { u64 default_baud_rate = request->default_baud_rate(); auto status = library_->DbAddAlias64(database_alias, database_filepath, default_baud_rate); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); return ::grpc::Status::OK; @@ -534,7 +534,7 @@ namespace nixnet_grpc { nx_database_ref_t_resource_repository_->remove_session(database_grpc_session.id(), database_grpc_session.name()); auto status = library_->DbCloseDatabase(database, close_all_refs); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, database); } response->set_status(status); return ::grpc::Status::OK; @@ -593,7 +593,7 @@ namespace nixnet_grpc { nx_database_ref_t_resource_repository_->remove_session(db_object_grpc_session.id(), db_object_grpc_session.name()); auto status = library_->DbDeleteObject(db_object); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, db_object); } response->set_status(status); return ::grpc::Status::OK; @@ -617,10 +617,10 @@ namespace nixnet_grpc { u32 percent_complete {}; auto status = library_->DbDeploy(ip_address, database_alias, wait_for_complete, &percent_complete); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->set_percent_complete(percent_complete); + response->set_percent_complete(percent_complete); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -694,10 +694,10 @@ namespace nixnet_grpc { u32 attribute_text_size {}; auto status = library_->DbGetDBCAttributeSize(db_object, mode, attribute_name, &attribute_text_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, db_object); } response->set_status(status); - response->set_attribute_text_size(attribute_text_size); + response->set_attribute_text_size(attribute_text_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -718,11 +718,11 @@ namespace nixnet_grpc { u32 sizeof_filepath_buffer {}; auto status = library_->DbGetDatabaseListSizes(ip_address, &sizeof_alias_buffer, &sizeof_filepath_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->set_sizeof_alias_buffer(sizeof_alias_buffer); - response->set_sizeof_filepath_buffer(sizeof_filepath_buffer); + response->set_sizeof_alias_buffer(sizeof_alias_buffer); + response->set_sizeof_filepath_buffer(sizeof_filepath_buffer); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -759,10 +759,10 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->DbGetPropertySize(db_object, property_id, &property_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, db_object); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, db_object); } response->set_status(status); - response->set_property_size(property_size); + response->set_property_size(property_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -803,10 +803,10 @@ namespace nixnet_grpc { u32 percent_complete {}; auto status = library_->DbMerge(target_cluster, source_obj, copy_mode, prefix, wait_for_complete, &percent_complete); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, target_cluster); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, target_cluster); } response->set_status(status); - response->set_percent_complete(percent_complete); + response->set_percent_complete(percent_complete); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -834,10 +834,10 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxDatabaseRef_t id) { library_->DbCloseDatabase(id, false); }; int status = nx_database_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->mutable_database()->set_id(session_id); + response->mutable_database()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -859,7 +859,7 @@ namespace nixnet_grpc { auto database_alias = request->database_alias().c_str(); auto status = library_->DbRemoveAlias(database_alias); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); return ::grpc::Status::OK; @@ -882,7 +882,7 @@ namespace nixnet_grpc { auto db_filepath = request->db_filepath().c_str(); auto status = library_->DbSaveDatabase(database, db_filepath); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxDatabaseRef_t(status, database); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, database); } response->set_status(status); return ::grpc::Status::OK; @@ -904,7 +904,7 @@ namespace nixnet_grpc { auto database_alias = request->database_alias().c_str(); auto status = library_->DbUndeploy(ip_address, database_alias); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); return ::grpc::Status::OK; @@ -966,7 +966,7 @@ namespace nixnet_grpc { auto status = library_->DisconnectTerminals(session, source, destination); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -988,7 +988,7 @@ namespace nixnet_grpc { nxSessionRef_t session = session_repository_->access_session(session_grpc_session.id(), session_grpc_session.name()); auto status = library_->Flush(session); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1027,7 +1027,7 @@ namespace nixnet_grpc { auto status = library_->FutureTimeTrigger(session, when, timescale); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1066,10 +1066,10 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->GetPropertySize(session, property_id, &property_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - response->set_property_size(property_size); + response->set_property_size(property_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1107,10 +1107,10 @@ namespace nixnet_grpc { u32 property_size {}; auto status = library_->GetSubPropertySize(session, active_index, property_id, &property_size); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - response->set_property_size(property_size); + response->set_property_size(property_size); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1167,10 +1167,10 @@ namespace nixnet_grpc { u32 number_of_bytes_returned {}; auto status = library_->ReadFrame(session, buffer.data(), size_of_buffer, timeout, &number_of_bytes_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); + convert_to_grpc(buffer, response->mutable_buffer(), number_of_bytes_returned, protocol, enetflags_output_map_); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1197,7 +1197,7 @@ namespace nixnet_grpc { nxTimestamp100ns_t* timestamp_buffer = reinterpret_cast(response->mutable_timestamp_buffer()->mutable_data()); auto status = library_->ReadSignalSinglePoint(session, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1242,12 +1242,12 @@ namespace nixnet_grpc { u32 number_of_values_returned {}; auto status = library_->ReadSignalWaveform(session, timeout, &start_time, &delta_time, value_buffer.data(), size_of_value_buffer, &number_of_values_returned); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - response->set_start_time(start_time); - response->set_delta_time(delta_time); - convert_to_grpc(value_buffer, response->mutable_value_buffer(), number_of_values_returned, number_of_signals); + response->set_start_time(start_time); + response->set_delta_time(delta_time); + convert_to_grpc(value_buffer, response->mutable_value_buffer(), number_of_values_returned, number_of_signals); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1279,7 +1279,7 @@ namespace nixnet_grpc { u32* num_pairs_buffer = response->mutable_num_pairs_buffer()->mutable_data(); auto status = library_->ReadSignalXY(session, &time_limit, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer, num_pairs_buffer, size_of_num_pairs_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1319,10 +1319,10 @@ namespace nixnet_grpc { _nxTimeLocalNetwork_t state_value {}; auto status = library_->ReadStateTimeTrigger(session, timeout, state_size, &state_value); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - convert_to_grpc(state_value, response->mutable_state_value()); + convert_to_grpc(state_value, response->mutable_state_value()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1358,7 +1358,7 @@ namespace nixnet_grpc { auto status = library_->Start(session, scope); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1382,11 +1382,11 @@ namespace nixnet_grpc { library_->StatusToString(status_id, sizeof_string, (char*)status_description.data()); auto status = 0; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->set_status_description(status_description); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_status_description())); + response->set_status_description(status_description); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_status_description())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1422,7 +1422,7 @@ namespace nixnet_grpc { auto status = library_->Stop(session, scope); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1445,7 +1445,7 @@ namespace nixnet_grpc { session_repository_->remove_session(system_grpc_session.id(), system_grpc_session.name()); auto status = library_->SystemClose(system); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, system); + return ConvertApiErrorStatusForNxSessionRef_t(status, system); } response->set_status(status); return ::grpc::Status::OK; @@ -1474,10 +1474,10 @@ namespace nixnet_grpc { auto cleanup_lambda = [&] (nxSessionRef_t id) { library_->SystemClose(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, 0); + return ConvertApiErrorStatusForNxSessionRef_t(status, 0); } response->set_status(status); - response->mutable_system()->set_id(session_id); + response->mutable_system()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1519,10 +1519,10 @@ namespace nixnet_grpc { u32 param_out {}; auto status = library_->Wait(session, condition, param_in, timeout, ¶m_out); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); - response->set_param_out(param_out); + response->set_param_out(param_out); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1560,7 +1560,7 @@ namespace nixnet_grpc { auto status = library_->WriteFrame(session, buffer, number_of_bytes_for_frames, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1584,7 +1584,7 @@ namespace nixnet_grpc { u32 size_of_value_buffer = static_cast(request->value_buffer().size() * sizeof(f64)); auto status = library_->WriteSignalSinglePoint(session, value_buffer, size_of_value_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1624,7 +1624,7 @@ namespace nixnet_grpc { u32 size_of_value_buffer = static_cast(request->value_buffer().size() * sizeof(f64)); auto status = library_->WriteSignalWaveform(session, timeout, value_buffer, size_of_value_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -1668,7 +1668,7 @@ namespace nixnet_grpc { u32 size_of_num_pairs_buffer = static_cast(request->num_pairs_buffer().size() * sizeof(u32)); auto status = library_->WriteSignalXY(session, timeout, value_buffer, size_of_value_buffer, timestamp_buffer, size_of_timestamp_buffer, num_pairs_buffer, size_of_num_pairs_buffer); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSessionRef_t(status, session); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; diff --git a/generated/nixnet/nixnet_service.h b/generated/nixnet/nixnet_service.h index d0eb23dfd..7b01c9a51 100644 --- a/generated/nixnet/nixnet_service.h +++ b/generated/nixnet/nixnet_service.h @@ -105,8 +105,8 @@ class NiXnetService final : public NiXnet::Service { NiXnetLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; nxDatabaseRef_tResourceRepositorySharedPtr nx_database_ref_t_resource_repository_; - ::grpc::Status ConvertApiErrorStatusFornxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session); - ::grpc::Status ConvertApiErrorStatusFornxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session); + ::grpc::Status ConvertApiErrorStatusForNxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session); + ::grpc::Status ConvertApiErrorStatusForNxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session); std::map dbpropertyvalue_input_map_ { {0, 0},{1, 0},{2, 1},{3, 2},{4, 4294967294},{5, 0},{6, 1},{7, 2},{8, 3},{9, 0},{10, 1},{11, 1},{12, 2},{13, 3},{14, 4},{15, 0},{16, 1},{17, 2},{18, 0},{19, 1},{20, 0},{21, 1},{22, 2},{23, 3},{24, 2},{25, 3},{26, 4},{27, 5},{28, 6},{29, 0},{30, 1},{31, 2},{32, 0},{33, 1},{34, 2},{35, 3}, }; std::map dbpropertyvalue_output_map_ { {0, 0},{0, 1},{1, 2},{2, 3},{4294967294, 4},{0, 5},{1, 6},{2, 7},{3, 8},{0, 9},{1, 10},{1, 11},{2, 12},{3, 13},{4, 14},{0, 15},{1, 16},{2, 17},{0, 18},{1, 19},{0, 20},{1, 21},{2, 22},{3, 23},{2, 24},{3, 25},{4, 26},{5, 27},{6, 28},{0, 29},{1, 30},{2, 31},{0, 32},{1, 33},{2, 34},{3, 35}, }; std::map enetflags_input_map_ { {0, 0},{1, 2147483648},{2, 1073741824},{3, 8388608},{4, 65536}, }; diff --git a/generated/nixnetsocket/nixnetsocket_service.cpp b/generated/nixnetsocket/nixnetsocket_service.cpp index 708c90045..e0769f9f6 100644 --- a/generated/nixnetsocket/nixnetsocket_service.cpp +++ b/generated/nixnetsocket/nixnetsocket_service.cpp @@ -68,11 +68,11 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxSOCKET id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); - convert_to_grpc(addr, response->mutable_addr()); - response->mutable_socket()->set_id(session_id); + convert_to_grpc(addr, response->mutable_addr()); + response->mutable_socket()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -97,7 +97,7 @@ namespace nixnetsocket_grpc { auto namelen = name.size(); auto status = library_->Bind(socket, name, namelen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -120,7 +120,7 @@ namespace nixnetsocket_grpc { session_repository_->remove_session(socket_grpc_session.id(), socket_grpc_session.name()); auto status = library_->Close(socket); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -144,7 +144,7 @@ namespace nixnetsocket_grpc { auto namelen = name.size(); auto status = library_->Connect(socket, name, namelen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -168,10 +168,10 @@ namespace nixnetsocket_grpc { auto is_set = library_->FdIsSet(fd, set); auto status = 0; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, fd); + return ConvertApiErrorStatusForNxSOCKET(status, fd); } response->set_status(status); - response->set_is_set(is_set); + response->set_is_set(is_set); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -197,10 +197,10 @@ namespace nixnetsocket_grpc { auto res = allocate_output_storage>(library_); auto status = library_->GetAddrInfo(stack_ref, node_api, service_api, hints, &res); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - convert_to_grpc(res, response->mutable_res()); + convert_to_grpc(res, response->mutable_res()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -236,13 +236,13 @@ namespace nixnetsocket_grpc { } auto status = library_->GetNameInfo(stack_ref, addr, addrlen, (char*)host.data(), hostlen, (char*)serv.data(), servlen, flags); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - response->set_host(host); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_host())); - response->set_serv(serv); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_serv())); + response->set_host(host); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_host())); + response->set_serv(serv); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_serv())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -264,10 +264,10 @@ namespace nixnetsocket_grpc { auto addrlen = static_cast(sizeof(addr.storage)); auto status = library_->GetPeerName(socket, &addr, &addrlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); - convert_to_grpc(addr, response->mutable_addr()); + convert_to_grpc(addr, response->mutable_addr()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -289,10 +289,10 @@ namespace nixnetsocket_grpc { auto addrlen = static_cast(sizeof(addr.storage)); auto status = library_->GetSockName(socket, &addr, &addrlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); - convert_to_grpc(addr, response->mutable_addr()); + convert_to_grpc(addr, response->mutable_addr()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -346,10 +346,10 @@ namespace nixnetsocket_grpc { auto optlen = optval.size(socket, level); auto status = library_->GetSockOpt(socket, level, optname, optval.data(), &optlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); - convert_to_grpc(optval, response->mutable_optval()); + convert_to_grpc(optval, response->mutable_optval()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -371,10 +371,10 @@ namespace nixnetsocket_grpc { auto addr = library_->InetAddr(stack_ref, cp); auto status = addr == -1 ? -1 : 0; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - response->set_addr(addr); + response->set_addr(addr); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -396,10 +396,10 @@ namespace nixnetsocket_grpc { auto name = allocate_output_storage(); auto status = library_->InetAToN(stack_ref, cp, &name); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - convert_to_grpc(name, response->mutable_name()); + convert_to_grpc(name, response->mutable_name()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -421,11 +421,11 @@ namespace nixnetsocket_grpc { auto address = library_->InetNToA(stack_ref, in_addr); auto status = address ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - response->set_address(address); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); + response->set_address(address); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -450,11 +450,11 @@ namespace nixnetsocket_grpc { auto address = library_->InetNToP(stack_ref, af, addr, (char*)dst.data(), size); auto status = address ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - response->set_address(address); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); + response->set_address(address); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_address())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -492,10 +492,10 @@ namespace nixnetsocket_grpc { auto addr = allocate_output_storage(af); auto status = library_->InetPToN(stack_ref, af, address, &addr); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - convert_to_grpc(addr, response->mutable_addr()); + convert_to_grpc(addr, response->mutable_addr()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -516,7 +516,7 @@ namespace nixnetsocket_grpc { nx_ip_stack_ref_t_resource_repository_->remove_session(stack_ref_grpc_session.id(), stack_ref_grpc_session.name()); auto status = library_->IpStackClear(stack_ref); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); return ::grpc::Status::OK; @@ -547,10 +547,10 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxIpStackRef_t id) { library_->IpStackClear(id); }; int status = nx_ip_stack_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusForNxSOCKET(status, 0); } response->set_status(status); - response->mutable_stack_ref()->set_id(session_id); + response->mutable_stack_ref()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -588,11 +588,11 @@ namespace nixnetsocket_grpc { auto info = allocate_output_storage(library_); auto status = library_->IpStackGetAllStacksInfoStr(format, (nixnetsocket_grpc::IpStackInfoString*)info.data()); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusForNxSOCKET(status, 0); } response->set_status(status); - convert_to_grpc(info, response->mutable_info()); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); + convert_to_grpc(info, response->mutable_info()); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -614,10 +614,10 @@ namespace nixnetsocket_grpc { auto virtual_interfaces = allocate_output_storage>(library_); auto status = library_->IpStackGetInfo(stack_ref, info_id, &virtual_interfaces); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - convert_to_grpc(virtual_interfaces, response->mutable_virtual_interfaces()); + convert_to_grpc(virtual_interfaces, response->mutable_virtual_interfaces()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -645,10 +645,10 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxIpStackRef_t id) { library_->IpStackClear(id); }; int status = nx_ip_stack_ref_t_resource_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusForNxSOCKET(status, 0); } response->set_status(status); - response->mutable_stack_ref()->set_id(session_id); + response->mutable_stack_ref()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -673,7 +673,7 @@ namespace nixnetsocket_grpc { int32_t timeout_ms = request->timeout_ms(); auto status = library_->IpStackWaitForInterface(stack_ref, local_interface, timeout_ms); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); return ::grpc::Status::OK; @@ -696,7 +696,7 @@ namespace nixnetsocket_grpc { int32_t backlog = request->backlog(); auto status = library_->Listen(socket, backlog); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -724,10 +724,10 @@ namespace nixnetsocket_grpc { std::string data(size, '\0'); auto status = library_->Recv(socket, (char*)data.data(), size, flags); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); - response->set_data(data); + response->set_data(data); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -755,11 +755,11 @@ namespace nixnetsocket_grpc { nxsocklen_t fromlen {}; auto status = library_->RecvFrom(socket, (char*)data.data(), size, flags, &from_addr, &fromlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); - response->set_data(data); - convert_to_grpc(from_addr, response->mutable_from_addr()); + response->set_data(data); + convert_to_grpc(from_addr, response->mutable_from_addr()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -782,7 +782,7 @@ namespace nixnetsocket_grpc { auto timeout = convert_from_grpc(request->timeout()); auto status = library_->Select(nfds, readfds, writefds, exceptfds, timeout); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusForNxSOCKET(status, 0); } response->set_status(status); return ::grpc::Status::OK; @@ -807,7 +807,7 @@ namespace nixnetsocket_grpc { int32_t flags_raw = request->flags_raw(); auto status = library_->Send(socket, data, size, flags_raw); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -834,7 +834,7 @@ namespace nixnetsocket_grpc { auto tolen = to.size(); auto status = library_->SendTo(socket, data, size, flags_raw, to, tolen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -891,7 +891,7 @@ namespace nixnetsocket_grpc { auto optlen = opt_data.size(); auto status = library_->SetSockOpt(socket, level, optname, optval, optlen); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -929,7 +929,7 @@ namespace nixnetsocket_grpc { auto status = library_->Shutdown(socket, how); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, socket); + return ConvertApiErrorStatusForNxSOCKET(status, socket); } response->set_status(status); return ::grpc::Status::OK; @@ -1008,10 +1008,10 @@ namespace nixnetsocket_grpc { auto cleanup_lambda = [&] (nxSOCKET id) { library_->Close(id); }; int status = session_repository_->add_session(grpc_device_session_name, init_lambda, cleanup_lambda, session_id); if (!status_ok(status)) { - return ConvertApiErrorStatusFornxIpStackRef_t(status, stack_ref); + return ConvertApiErrorStatusForNxIpStackRef_t(status, stack_ref); } response->set_status(status); - response->mutable_socket()->set_id(session_id); + response->mutable_socket()->set_id(session_id); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1039,11 +1039,11 @@ namespace nixnetsocket_grpc { auto error = library_->StrErrR(errnum, (char*)buf.data(), buf_len); auto status = error ? 0 : -1; if (!status_ok(status)) { - return ConvertApiErrorStatusFornxSOCKET(status, 0); + return ConvertApiErrorStatusForNxSOCKET(status, 0); } response->set_status(status); - response->set_error(error); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error())); + response->set_error(error); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_error())); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/generated/nixnetsocket/nixnetsocket_service.h b/generated/nixnetsocket/nixnetsocket_service.h index 1e4c8ee32..02e557403 100644 --- a/generated/nixnetsocket/nixnetsocket_service.h +++ b/generated/nixnetsocket/nixnetsocket_service.h @@ -78,8 +78,8 @@ class NiXnetSocketService final : public NiXnetSocket::Service { NiXnetSocketLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; nxIpStackRef_tResourceRepositorySharedPtr nx_ip_stack_ref_t_resource_repository_; - ::grpc::Status ConvertApiErrorStatusFornxSOCKET(google::protobuf::int32 status, nxSOCKET socket); - ::grpc::Status ConvertApiErrorStatusFornxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket); + ::grpc::Status ConvertApiErrorStatusForNxSOCKET(google::protobuf::int32 status, nxSOCKET socket); + ::grpc::Status ConvertApiErrorStatusForNxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket); NiXnetSocketFeatureToggles feature_toggles_; }; diff --git a/source/codegen/templates/service.h.mako b/source/codegen/templates/service.h.mako index 022c5ce52..f35627f45 100644 --- a/source/codegen/templates/service.h.mako +++ b/source/codegen/templates/service.h.mako @@ -97,7 +97,10 @@ private: ${resource_repository_deps[resource_handle_type].resource_repository_alias} ${resource_repository_deps[resource_handle_type].field_name}; % endfor % for resource_handle_type in resource_handle_types: - ::grpc::Status ConvertApiErrorStatusFor${resource_handle_type}(google::protobuf::int32 status, ${resource_handle_type} ${config["session_handle_parameter_name"]}); +<% + cpp_handle_type = resource_handle_type[0].upper() + resource_handle_type[1:] +%>\ + ::grpc::Status ConvertApiErrorStatusFor${cpp_handle_type}(google::protobuf::int32 status, ${resource_handle_type} ${config["session_handle_parameter_name"]}); % endfor % if common_helpers.has_viboolean_array_param(functions): void Copy(const std::vector& input, google::protobuf::RepeatedField* output); diff --git a/source/codegen/templates/service_helpers.mako b/source/codegen/templates/service_helpers.mako index ad6d5d424..3646e665c 100644 --- a/source/codegen/templates/service_helpers.mako +++ b/source/codegen/templates/service_helpers.mako @@ -744,9 +744,10 @@ ${set_response_values(normal_outputs, init_method)}\ session = common_helpers.get_cpp_local_name(parameter) handle_type = parameter['type'] break + cpp_handle_type = handle_type[0].upper() + handle_type[1:] %>\ if (!status_ok(status)) { - return ConvertApiErrorStatusFor${handle_type}(status, ${session}); + return ConvertApiErrorStatusFor${cpp_handle_type}(status, ${session}); } \ @@ -771,13 +772,13 @@ ${set_response_values(normal_outputs, init_method)}\ varargs_parameter_name = common_helpers.get_cpp_local_name(varargs_parameter) %>\ ## Note that this currently only supports one repeated output parameter. - for (int i = 0; i < ${parameter_name}Vector.size(); ++i) { + for (int i = 0; i < ${parameter_name}Vector.size(); ++i) { % if 'enum' in parameter: - response->add_${varargs_parameter_name}(static_cast<${parameter['enum']}>(${parameter_name}Vector[i])); + response->add_${varargs_parameter_name}(static_cast<${parameter['enum']}>(${parameter_name}Vector[i])); % else: - response->add_${varargs_parameter_name}(${parameter_name}Vector[i]); + response->add_${varargs_parameter_name}(${parameter_name}Vector[i]); % endif - } + } % elif common_helpers.is_repeated_varargs_parameter(parameter): #pass % elif common_helpers.is_enum(parameter) == True: <% @@ -794,21 +795,21 @@ ${set_response_values(normal_outputs, init_method)}\ use_checked_enum_conversion = parameter.get("use_checked_enum_conversion", False) %>\ % if has_mapped_enum: - auto ${mapped_enum_iterator_name} = ${map_name}.find(${parameter_name}); - if(${mapped_enum_iterator_name} != ${map_name}.end()) { - response->set_${field_name}_mapped(static_cast<${namespace_prefix}${mapped_enum_name}>(${mapped_enum_iterator_name}->second)); - } + auto ${mapped_enum_iterator_name} = ${map_name}.find(${parameter_name}); + if(${mapped_enum_iterator_name} != ${map_name}.end()) { + response->set_${field_name}_mapped(static_cast<${namespace_prefix}${mapped_enum_name}>(${mapped_enum_iterator_name}->second)); + } % endif % if has_unmapped_enum: % if use_checked_enum_conversion: - auto checked_convert_${parameter_name} = [](auto raw_value) { - bool raw_value_is_valid = ${namespace_prefix}${parameter["enum"]}_IsValid(raw_value); - auto valid_enum_value = raw_value_is_valid ? raw_value : 0; - return static_cast<${namespace_prefix}${parameter["enum"]}>(valid_enum_value); - }; + auto checked_convert_${parameter_name} = [](auto raw_value) { + bool raw_value_is_valid = ${namespace_prefix}${parameter["enum"]}_IsValid(raw_value); + auto valid_enum_value = raw_value_is_valid ? raw_value : 0; + return static_cast<${namespace_prefix}${parameter["enum"]}>(valid_enum_value); + }; % endif % if is_string: - CopyBytesToEnums(${parameter_name}, response->mutable_${field_name}()); + CopyBytesToEnums(${parameter_name}, response->mutable_${field_name}()); % elif uses_raw_output_as_read_buffer: <% raw_response_field = f"response->{field_name}_raw()" @@ -819,47 +820,47 @@ ${set_response_values(normal_outputs, init_method)}\ ${initialize_response_buffer(parameter_name=parameter_name, parameter=parameter)}\ ${copy_to_response_with_transform(source_buffer=raw_response_field, parameter_name=parameter_name, transform_x=convert_x_to_enum, size=common_helpers.get_size_expression(parameter))}\ % elif parameter['type'] == 'ViReal64': - if(${parameter_name} == (int)${parameter_name}) { - response->set_${field_name}(static_cast<${namespace_prefix}${parameter["enum"]}>(static_cast(${parameter_name}))); - } + if(${parameter_name} == (int)${parameter_name}) { + response->set_${field_name}(static_cast<${namespace_prefix}${parameter["enum"]}>(static_cast(${parameter_name}))); + } % elif parameter.get("use_checked_enum_conversion", False): - response->set_${field_name}(checked_convert_${parameter_name}(${parameter_name})); + response->set_${field_name}(checked_convert_${parameter_name}(${parameter_name})); % else: - response->set_${field_name}(static_cast<${namespace_prefix}${parameter["enum"]}>(${parameter_name})); + response->set_${field_name}(static_cast<${namespace_prefix}${parameter["enum"]}>(${parameter_name})); % endif % endif % if is_bitfield_as_enum_array: % for flag_value, flag_enum_name in service_helpers.get_bitfield_value_to_name_mapping(parameter, enums).items(): - if (${parameter_name} & ${hex(flag_value)}) - response->add_${field_name}_array(${flag_enum_name}); + if (${parameter_name} & ${hex(flag_value)}) + response->add_${field_name}_array(${flag_enum_name}); % endfor % endif % if not uses_raw_output_as_read_buffer: # Set data to raw, unless we *got* the data from raw. - response->set_${field_name}_raw(${parameter_name}); + response->set_${field_name}_raw(${parameter_name}); % endif % elif service_helpers.is_output_array_that_needs_coercion(parameter): ${initialize_response_buffer(parameter_name=parameter_name, parameter=parameter)}\ ${copy_to_response_with_transform(source_buffer=parameter_name, parameter_name=parameter_name, transform_x="x", size=common_helpers.get_size_expression(parameter))}\ % elif common_helpers.supports_standard_copy_conversion_routines(parameter): - convert_to_grpc(${str.join(", ", [f'{parameter_name}', f'response->mutable_{field_name}()'] + parameter.get("additional_arguments_to_copy_convert", []))}); + convert_to_grpc(${str.join(", ", [f'{parameter_name}', f'response->mutable_{field_name}()'] + parameter.get("additional_arguments_to_copy_convert", []))}); % elif common_helpers.is_string_arg(parameter): - response->set_${field_name}(${parameter_name}); + response->set_${field_name}(${parameter_name}); % elif parameter['grpc_type'] == 'nidevice_grpc.Session': % if not init_method: # Non-init methods need to resolve the session ID from the out param. - auto session_id = ${service_helpers.session_repository_field_name(parameter, config)}->resolve_session_id(${parameter_name}); + auto session_id = ${service_helpers.session_repository_field_name(parameter, config)}->resolve_session_id(${parameter_name}); % endif - response->mutable_${field_name}()->set_id(session_id); + response->mutable_${field_name}()->set_id(session_id); % elif common_helpers.is_array(parameter['type']): % if common_helpers.get_size_mechanism(parameter) == 'passed-in-by-ptr': ### size may have changed - response->mutable_${field_name}()->Resize(${common_helpers.get_size_expression(parameter)}, 0); + response->mutable_${field_name}()->Resize(${common_helpers.get_size_expression(parameter)}, 0); % endif ### pass: other array types don't need to copy. % else: - response->set_${field_name}(${parameter_name}); + response->set_${field_name}(${parameter_name}); % endif % if common_helpers.is_regular_string_arg(parameter): - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_${field_name}())); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_${field_name}())); % endif ### Handle ivi-dance-with-a-twist resizing. % if common_helpers.is_ivi_dance_array_with_a_twist_param(parameter): @@ -867,22 +868,22 @@ ${copy_to_response_with_transform(source_buffer=parameter_name, parameter_name=p size = common_helpers.get_size_expression(parameter) %>\ % if common_helpers.is_regular_byte_array_arg(parameter): - response->mutable_${field_name}()->resize(${size}); + response->mutable_${field_name}()->resize(${size}); % elif common_helpers.is_regular_string_arg(parameter): ### pass: handled above with trim_trailing_nulls for all string outputs. % elif common_helpers.is_struct(parameter): ## RepeatedPtrField doesn't support Resize(), so use DeleteSubrange() ## to delete any extra elements. - { - auto shrunk_size = ${size}; - auto current_size = response->mutable_${field_name}()->size(); - if (shrunk_size != current_size) { - response->mutable_${field_name}()->DeleteSubrange(shrunk_size, current_size - shrunk_size); - } + { + auto shrunk_size = ${size}; + auto current_size = response->mutable_${field_name}()->size(); + if (shrunk_size != current_size) { + response->mutable_${field_name}()->DeleteSubrange(shrunk_size, current_size - shrunk_size); } + } % else: ## This code doesn't handle all parameter types (i.e., enums), see what initialize_output_params() does for that. - response->mutable_${field_name}()->Resize(${size}, 0); + response->mutable_${field_name}()->Resize(${size}, 0); % endif % endif % endfor diff --git a/source/custom/nidcpower_service.custom.cpp b/source/custom/nidcpower_service.custom.cpp index 52949745f..69ab531b8 100644 --- a/source/custom/nidcpower_service.custom.cpp +++ b/source/custom/nidcpower_service.custom.cpp @@ -30,9 +30,10 @@ ::grpc::Status NiDCPowerService::MeasureMultiple(::grpc::ServerContext* context, if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto vi_grpc_session = request->vi(); - ViSession vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); + vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); ViConstString channel_name = request->channel_name().c_str(); ViUInt32 number_of_channels; @@ -43,6 +44,9 @@ ::grpc::Status NiDCPowerService::MeasureMultiple(::grpc::ServerContext* context, ViReal64* current_measurements = response->mutable_current_measurements()->mutable_data(); auto status = library_->MeasureMultiple(vi, channel_name, voltage_measurements, current_measurements); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); return ::grpc::Status::OK; } @@ -50,8 +54,7 @@ ::grpc::Status NiDCPowerService::MeasureMultiple(::grpc::ServerContext* context, return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (const DriverErrorException& ex) { - response->set_status(ex.status()); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status(), vi); } } diff --git a/source/custom/nifgen_service.custom.cpp b/source/custom/nifgen_service.custom.cpp index a399f70ce..c5ab65436 100644 --- a/source/custom/nifgen_service.custom.cpp +++ b/source/custom/nifgen_service.custom.cpp @@ -26,10 +26,11 @@ ::grpc::Status NiFgenService::CreateAdvancedArbSequence(::grpc::ServerContext* c ViInt32* coerced_markers_array = reinterpret_cast(response->mutable_coerced_markers_array()->mutable_data()); ViInt32 sequence_handle{}; auto status = library_->CreateAdvancedArbSequence(vi, sequence_length, waveform_handles_array, loop_counts_array, sample_counts_array, marker_location_array, coerced_markers_array, &sequence_handle); - response->set_status(status); - if (status == 0) { - response->set_sequence_handle(sequence_handle); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + response->set_sequence_handle(sequence_handle); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/source/custom/nirfmxbluetooth_service.custom.cpp b/source/custom/nirfmxbluetooth_service.custom.cpp index b3c8101b7..e49469233 100644 --- a/source/custom/nirfmxbluetooth_service.custom.cpp +++ b/source/custom/nirfmxbluetooth_service.custom.cpp @@ -2,7 +2,7 @@ namespace nirfmxbluetooth_grpc { -::grpc::Status NiRFmxBluetoothService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxBluetoothService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/custom/nirfmxinstr_service.custom.cpp b/source/custom/nirfmxinstr_service.custom.cpp index af114c50c..d03409feb 100644 --- a/source/custom/nirfmxinstr_service.custom.cpp +++ b/source/custom/nirfmxinstr_service.custom.cpp @@ -26,8 +26,7 @@ ::grpc::Status NiRFmxInstrService::GetNIRFSASessionArray(::grpc::ServerContext* while (true) { auto status = library_->GetNIRFSASessionArray(instrument, nullptr, 0, &actual_array_size); if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } array_size = actual_array_size; nirfsa_sessions.resize(array_size); @@ -42,18 +41,19 @@ ::grpc::Status NiRFmxInstrService::GetNIRFSASessionArray(::grpc::ServerContext* stream << "Number of session_names must be zero or match actual array size (" << array_size << ")."; return ::grpc::Status(::grpc::INVALID_ARGUMENT, stream.str()); } + if (status < 0) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); - if (status == 0) { - for (auto i = 0; i < array_size; ++i) { - auto init_lambda = [&]() { - return std::make_tuple(0, nirfsa_sessions[i]); - }; - uint32_t session_id = 0; - const auto session_name = request->session_names_size() ? request->session_names(i) : ""; - int status = vi_session_resource_repository_->add_dependent_session(session_name, init_lambda, initiating_session_id, session_id); - auto session = response->add_nirfsa_sessions(); - session->set_id(session_id); - } + for (auto i = 0; i < array_size; ++i) { + auto init_lambda = [&]() { + return std::make_tuple(0, nirfsa_sessions[i]); + }; + uint32_t session_id = 0; + const auto session_name = request->session_names_size() ? request->session_names(i) : ""; + int status = vi_session_resource_repository_->add_dependent_session(session_name, init_lambda, initiating_session_id, session_id); + auto session = response->add_nirfsa_sessions(); + session->set_id(session_id); } return ::grpc::Status::OK; } @@ -82,8 +82,7 @@ ::grpc::Status NiRFmxInstrService::BuildPortString(::grpc::ServerContext* contex while (true) { auto status = library_->BuildPortString(selector_string, port_name, device_name, channel_number, 0, nullptr); if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 selector_string_out_length = status + std::to_string(channel_number).length(); // AB#1835966: RFmx Instr BuildPortString2 Bug. @@ -96,11 +95,12 @@ ::grpc::Status NiRFmxInstrService::BuildPortString(::grpc::ServerContext* contex // buffer is now too small, try again continue; } - response->set_status(status); - if (status >= 0) { - response->set_selector_string_out(selector_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); + if (status < 0) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } + response->set_status(status); + response->set_selector_string_out(selector_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_selector_string_out())); return ::grpc::Status::OK; } } @@ -109,7 +109,7 @@ ::grpc::Status NiRFmxInstrService::BuildPortString(::grpc::ServerContext* contex } } -::grpc::Status NiRFmxInstrService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxInstrService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { int32 error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/custom/nirfmxlte_service.custom.cpp b/source/custom/nirfmxlte_service.custom.cpp index 211148bdf..3360dac23 100644 --- a/source/custom/nirfmxlte_service.custom.cpp +++ b/source/custom/nirfmxlte_service.custom.cpp @@ -2,7 +2,7 @@ namespace nirfmxlte_grpc { -::grpc::Status NiRFmxLTEService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxLTEService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/custom/nirfmxnr_service.custom.cpp b/source/custom/nirfmxnr_service.custom.cpp index 7b7beb067..2fd71bbec 100644 --- a/source/custom/nirfmxnr_service.custom.cpp +++ b/source/custom/nirfmxnr_service.custom.cpp @@ -2,7 +2,7 @@ namespace nirfmxnr_grpc { -::grpc::Status NiRFmxNRService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxNRService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { int32 error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/custom/nirfmxspecan_restricted_service.custom.cpp b/source/custom/nirfmxspecan_restricted_service.custom.cpp index ca1c85c35..9e0418959 100644 --- a/source/custom/nirfmxspecan_restricted_service.custom.cpp +++ b/source/custom/nirfmxspecan_restricted_service.custom.cpp @@ -2,17 +2,10 @@ namespace nirfmxspecan_restricted_grpc { -::grpc::Status NiRFmxSpecAnRestrictedService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxSpecAnRestrictedService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { - const ViInt32 buffer_size = 4096; - ViStatus error_code {}; - std::string description(buffer_size, '\0'); - // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); - if (error_code != status) { - // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); - } + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // TODO: How do we get access to a library that can return a useful string? return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxspecan_service.custom.cpp b/source/custom/nirfmxspecan_service.custom.cpp index 6e4cdd70f..e2615b799 100644 --- a/source/custom/nirfmxspecan_service.custom.cpp +++ b/source/custom/nirfmxspecan_service.custom.cpp @@ -2,7 +2,7 @@ namespace nirfmxspecan_grpc { -::grpc::Status NiRFmxSpecAnService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxSpecAnService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { const ViInt32 buffer_size = 4096; ViStatus error_code {}; diff --git a/source/custom/nirfmxwlan_service.custom.cpp b/source/custom/nirfmxwlan_service.custom.cpp index 3e4cb5261..8de32828d 100644 --- a/source/custom/nirfmxwlan_service.custom.cpp +++ b/source/custom/nirfmxwlan_service.custom.cpp @@ -2,7 +2,7 @@ namespace nirfmxwlan_grpc { -::grpc::Status NiRFmxWLANService::ConvertApiErrorStatusForniRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +::grpc::Status NiRFmxWLANService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { int32 error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/custom/niscope_service.custom.cpp b/source/custom/niscope_service.custom.cpp index 38e2a0011..3ac6c4cfb 100644 --- a/source/custom/niscope_service.custom.cpp +++ b/source/custom/niscope_service.custom.cpp @@ -28,9 +28,10 @@ ::grpc::Status NiScopeService::Fetch(::grpc::ServerContext* context, const Fetch if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -45,18 +46,18 @@ ::grpc::Status NiScopeService::Fetch(::grpc::ServerContext* context, const Fetch ViReal64* waveform = response->mutable_waveform()->mutable_data(); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->Fetch(vi, channel_list, timeout, num_samples, waveform, waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -67,9 +68,10 @@ ::grpc::Status NiScopeService::FetchBinary8(::grpc::ServerContext* context, cons if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -84,18 +86,18 @@ ::grpc::Status NiScopeService::FetchBinary8(::grpc::ServerContext* context, cons ViInt8* waveform = (ViInt8*)response->mutable_waveform()->data(); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->FetchBinary8(vi, channel_list, timeout, num_samples, waveform, waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -106,9 +108,10 @@ ::grpc::Status NiScopeService::FetchBinary16(::grpc::ServerContext* context, con if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -122,19 +125,19 @@ ::grpc::Status NiScopeService::FetchBinary16(::grpc::ServerContext* context, con std::vector waveform(num_samples * num_waveforms, 0); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->FetchBinary16(vi, channel_list, timeout, num_samples, waveform.data(), waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform_info, response->mutable_wfm_info()); - response->mutable_waveform()->Add(waveform.begin(), waveform.end()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); + response->mutable_waveform()->Add(waveform.begin(), waveform.end()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -145,9 +148,10 @@ ::grpc::Status NiScopeService::FetchBinary32(::grpc::ServerContext* context, con if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -161,19 +165,19 @@ ::grpc::Status NiScopeService::FetchBinary32(::grpc::ServerContext* context, con std::vector waveform(num_samples * num_waveforms, 0); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->FetchBinary32(vi, channel_list, timeout, num_samples, waveform.data(), waveform_info.data()); - response->set_status(status); - if (status == 0) { - response->mutable_waveform()->Add(waveform.begin(), waveform.end()); - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + response->mutable_waveform()->Add(waveform.begin(), waveform.end()); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -184,9 +188,10 @@ ::grpc::Status NiScopeService::FetchArrayMeasurement(::grpc::ServerContext* cont if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 array_meas_function; @@ -212,18 +217,18 @@ ::grpc::Status NiScopeService::FetchArrayMeasurement(::grpc::ServerContext* cont ViReal64* meas_wfm = response->mutable_meas_wfm()->mutable_data(); std::vector waveform_info(measurement_waveform_size, niScope_wfmInfo()); auto status = library_->FetchArrayMeasurement(vi, channel_list, timeout, array_meas_function, measurement_waveform_size, meas_wfm, waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -234,9 +239,10 @@ ::grpc::Status NiScopeService::FetchMeasurementStats(::grpc::ServerContext* cont if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 scalar_meas_function; @@ -267,18 +273,18 @@ ::grpc::Status NiScopeService::FetchMeasurementStats(::grpc::ServerContext* cont ViReal64* max = response->mutable_max()->mutable_data(); std::vector num_in_stats(num_waveforms, 0); auto status = library_->FetchMeasurementStats(vi, channel_list, timeout, scalar_meas_function, result, mean, stdev, min, max, num_in_stats.data()); - response->set_status(status); - if (status == 0) { - response->mutable_num_in_stats()->Add(num_in_stats.begin(), num_in_stats.end()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + response->mutable_num_in_stats()->Add(num_in_stats.begin(), num_in_stats.end()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -289,9 +295,10 @@ ::grpc::Status NiScopeService::Read(::grpc::ServerContext* context, const ReadRe if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -306,18 +313,18 @@ ::grpc::Status NiScopeService::Read(::grpc::ServerContext* context, const ReadRe ViReal64* waveform = response->mutable_waveform()->mutable_data(); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->Read(vi, channel_list, timeout, num_samples, waveform, waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -328,9 +335,10 @@ ::grpc::Status NiScopeService::FetchComplex(::grpc::ServerContext* context, cons if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -344,19 +352,19 @@ ::grpc::Status NiScopeService::FetchComplex(::grpc::ServerContext* context, cons std::vector waveform(num_samples * num_waveforms, NIComplexNumber_struct()); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->FetchComplex(vi, channel_list, timeout, num_samples, waveform.data(), waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform, response->mutable_wfm()); - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform, response->mutable_wfm()); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -367,9 +375,10 @@ ::grpc::Status NiScopeService::FetchComplexBinary16(::grpc::ServerContext* conte if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 num_samples = request->num_samples(); @@ -383,19 +392,19 @@ ::grpc::Status NiScopeService::FetchComplexBinary16(::grpc::ServerContext* conte std::vector waveform(num_samples * num_waveforms, NIComplexI16_struct()); std::vector waveform_info(num_waveforms, niScope_wfmInfo()); auto status = library_->FetchComplexBinary16(vi, channel_list, timeout, num_samples, waveform.data(), waveform_info.data()); - response->set_status(status); - if (status == 0) { - convert_to_grpc(waveform, response->mutable_wfm()); - convert_to_grpc(waveform_info, response->mutable_wfm_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + convert_to_grpc(waveform, response->mutable_wfm()); + convert_to_grpc(waveform_info, response->mutable_wfm_info()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -406,9 +415,10 @@ ::grpc::Status NiScopeService::FetchMeasurement(::grpc::ServerContext* context, if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 scalar_meas_function; @@ -430,6 +440,9 @@ ::grpc::Status NiScopeService::FetchMeasurement(::grpc::ServerContext* context, response->mutable_result()->Resize(num_waveforms, 0.0); ViReal64* result = response->mutable_result()->mutable_data(); auto status = library_->FetchMeasurement(vi, channel_list, timeout, scalar_meas_function, result); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); return ::grpc::Status::OK; } @@ -437,8 +450,7 @@ ::grpc::Status NiScopeService::FetchMeasurement(::grpc::ServerContext* context, return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -449,9 +461,10 @@ ::grpc::Status NiScopeService::GetNormalizationCoefficients(::grpc::ServerContex if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); while (true) { @@ -464,11 +477,12 @@ ::grpc::Status NiScopeService::GetNormalizationCoefficients(::grpc::ServerContex // buffer is now too small, try again continue; } - response->set_status(status); - if (status == 0) { - response->set_number_of_coefficient_sets(number_of_coefficient_sets); - convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + response->set_number_of_coefficient_sets(number_of_coefficient_sets); + convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); return ::grpc::Status::OK; } } @@ -476,8 +490,7 @@ ::grpc::Status NiScopeService::GetNormalizationCoefficients(::grpc::ServerContex return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -488,9 +501,10 @@ ::grpc::Status NiScopeService::GetScalingCoefficients(::grpc::ServerContext* con if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); while (true) { @@ -503,12 +517,12 @@ ::grpc::Status NiScopeService::GetScalingCoefficients(::grpc::ServerContext* con // buffer is now too small, try again continue; } - response->set_status(status); - response->set_status(status); - if (status == 0) { - response->set_number_of_coefficient_sets(number_of_coefficient_sets); - convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); + response->set_number_of_coefficient_sets(number_of_coefficient_sets); + convert_to_grpc(coefficient_info, response->mutable_coefficient_info()); return ::grpc::Status::OK; } } @@ -516,8 +530,7 @@ ::grpc::Status NiScopeService::GetScalingCoefficients(::grpc::ServerContext* con return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } @@ -528,9 +541,10 @@ ::grpc::Status NiScopeService::ReadMeasurement(::grpc::ServerContext* context, c if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; } + ViSession vi = VI_NULL; try { auto session = request->vi(); - ViSession vi = session_repository_->access_session(session.id(), session.name()); + vi = session_repository_->access_session(session.id(), session.name()); ViConstString channel_list = request->channel_list().c_str(); ViReal64 timeout = request->timeout(); ViInt32 scalar_meas_function; @@ -552,6 +566,9 @@ ::grpc::Status NiScopeService::ReadMeasurement(::grpc::ServerContext* context, c response->mutable_result()->Resize(num_waveforms, 0.0); ViReal64* result = response->mutable_result()->mutable_data(); auto status = library_->ReadMeasurement(vi, channel_list, timeout, scalar_meas_function, result); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); + } response->set_status(status); return ::grpc::Status::OK; } @@ -559,8 +576,7 @@ ::grpc::Status NiScopeService::ReadMeasurement(::grpc::ServerContext* context, c return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } catch (DriverErrorException& ex) { - response->set_status(ex.status_); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForViSession(ex.status_, vi); } } diff --git a/source/custom/nisync_service.custom.cpp b/source/custom/nisync_service.custom.cpp index 7aa2e3fb2..bcd3f4cee 100644 --- a/source/custom/nisync_service.custom.cpp +++ b/source/custom/nisync_service.custom.cpp @@ -26,9 +26,10 @@ ::grpc::Status NiSyncService::ReadMultipleTriggerTimeStamp(::grpc::ServerContext ViUInt32 timestamps_read {}; auto status = library_->ReadMultipleTriggerTimeStamp(vi, terminal, timestamps_to_read, timeout, time_seconds_buffer, time_nanoseconds_buffer, time_fractional_nanoseconds_buffer, detected_edge_buffer, ×tamps_read); response->set_status(status); - if (status == VI_SUCCESS || status == NISYNC_ERROR_DRIVER_TIMEOUT) { - response->set_timestamps_read(timestamps_read); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } + response->set_timestamps_read(timestamps_read); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { diff --git a/source/custom/nitclk_service.custom.cpp b/source/custom/nitclk_service.custom.cpp index 0aba3e0a8..da1695420 100644 --- a/source/custom/nitclk_service.custom.cpp +++ b/source/custom/nitclk_service.custom.cpp @@ -20,9 +20,8 @@ ::grpc::Status NiTClkService::GetAttributeViString(::grpc::ServerContext* contex while (true) { auto status = library_->GetAttributeViString(session, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, session); } ViInt32 buffer_size = status; @@ -32,10 +31,11 @@ ::grpc::Status NiTClkService::GetAttributeViString(::grpc::ServerContext* contex // buffer is now too small, try again continue; } - response->set_status(status); - if (status == 0) { - response->set_value(value); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, session); } + response->set_status(status); + response->set_value(value); return ::grpc::Status::OK; } } diff --git a/source/custom/nixnet_service.custom.cpp b/source/custom/nixnet_service.custom.cpp index 184c68291..1887bdb0b 100644 --- a/source/custom/nixnet_service.custom.cpp +++ b/source/custom/nixnet_service.custom.cpp @@ -168,65 +168,65 @@ ::grpc::Status NiXnetService::ReadState(::grpc::ServerContext* context, const Re nxStatus_t fault{}; auto status = library_->ReadState(session, state_id, state_size, const_cast(response->mutable_state_value()->mutable_state_value_raw()->data()), &fault); - + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); + } response->set_status(status); - if (status == 0) { - void* state_value_raw = (void*)response->state_value().state_value_raw().data(); - switch (state_id) { - case nixnet_grpc::ReadState::READ_STATE_TIME_CURRENT: { - response->mutable_state_value()->set_time_current(*(nxTimestamp100ns_t*)state_value_raw); - break; - } - case nixnet_grpc::ReadState::READ_STATE_TIME_COMMUNICATING: { - response->mutable_state_value()->set_time_communicating(*(nxTimestamp100ns_t*)state_value_raw); - break; - } - case nixnet_grpc::ReadState::READ_STATE_TIME_START: { - response->mutable_state_value()->set_time_start(*(nxTimestamp100ns_t*)state_value_raw); - break; - } - case nixnet_grpc::ReadState::READ_STATE_CAN_COMM: { - SetCanCommResponse(*(u32*)state_value_raw, response->mutable_state_value()->mutable_can_comm()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_FLEX_RAY_COMM: { - SetFlexRayCommResponse(*(u32*)state_value_raw, response->mutable_state_value()->mutable_flex_ray_comm()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_LIN_COMM: { - SetLinCommResponse((u32*)state_value_raw, response->mutable_state_value()->mutable_lin_comm()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_SESSION_INFO: { - SetSessionInfoResponse(*(u32*)state_value_raw, response->mutable_state_value()->mutable_session_info()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_FLEX_RAY_STATS: { - convert_to_grpc(*(_nxFlexRayStats_t*)state_value_raw, response->mutable_state_value()->mutable_flex_ray_stats()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_J1939_COMM: { - convert_to_grpc(*(_nxJ1939CommState_t*)state_value_raw, response->mutable_state_value()->mutable_j1939_comm_state()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_TIME_CURRENT_2: { - convert_to_grpc(*(_nxTimeLocalNetwork_t*)state_value_raw, response->mutable_state_value()->mutable_time_current2()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_TIME_COMMUNICATING_2: { - convert_to_grpc(*(_nxTimeLocalNetwork_t*)state_value_raw, response->mutable_state_value()->mutable_time_communicating2()); - break; - } - case nixnet_grpc::ReadState::READ_STATE_TIME_START_2: { - convert_to_grpc(*(_nxTimeLocalNetwork_t*)state_value_raw, response->mutable_state_value()->mutable_time_start2()); - break; - } - default: { - return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for state_id was not specified or out of range"); - } + void* state_value_raw = (void*)response->state_value().state_value_raw().data(); + switch (state_id) { + case nixnet_grpc::ReadState::READ_STATE_TIME_CURRENT: { + response->mutable_state_value()->set_time_current(*(nxTimestamp100ns_t*)state_value_raw); + break; + } + case nixnet_grpc::ReadState::READ_STATE_TIME_COMMUNICATING: { + response->mutable_state_value()->set_time_communicating(*(nxTimestamp100ns_t*)state_value_raw); + break; + } + case nixnet_grpc::ReadState::READ_STATE_TIME_START: { + response->mutable_state_value()->set_time_start(*(nxTimestamp100ns_t*)state_value_raw); + break; + } + case nixnet_grpc::ReadState::READ_STATE_CAN_COMM: { + SetCanCommResponse(*(u32*)state_value_raw, response->mutable_state_value()->mutable_can_comm()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_FLEX_RAY_COMM: { + SetFlexRayCommResponse(*(u32*)state_value_raw, response->mutable_state_value()->mutable_flex_ray_comm()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_LIN_COMM: { + SetLinCommResponse((u32*)state_value_raw, response->mutable_state_value()->mutable_lin_comm()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_SESSION_INFO: { + SetSessionInfoResponse(*(u32*)state_value_raw, response->mutable_state_value()->mutable_session_info()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_FLEX_RAY_STATS: { + convert_to_grpc(*(_nxFlexRayStats_t*)state_value_raw, response->mutable_state_value()->mutable_flex_ray_stats()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_J1939_COMM: { + convert_to_grpc(*(_nxJ1939CommState_t*)state_value_raw, response->mutable_state_value()->mutable_j1939_comm_state()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_TIME_CURRENT_2: { + convert_to_grpc(*(_nxTimeLocalNetwork_t*)state_value_raw, response->mutable_state_value()->mutable_time_current2()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_TIME_COMMUNICATING_2: { + convert_to_grpc(*(_nxTimeLocalNetwork_t*)state_value_raw, response->mutable_state_value()->mutable_time_communicating2()); + break; + } + case nixnet_grpc::ReadState::READ_STATE_TIME_START_2: { + convert_to_grpc(*(_nxTimeLocalNetwork_t*)state_value_raw, response->mutable_state_value()->mutable_time_start2()); + break; + } + default: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for state_id was not specified or out of range"); } - response->set_fault(fault); } + response->set_fault(fault); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -307,6 +307,9 @@ ::grpc::Status NiXnetService::WriteState(::grpc::ServerContext* context, const W } } auto status = library_->WriteState(session, state_id, state_size, &state_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); + } response->set_status(status); return ::grpc::Status::OK; } @@ -368,57 +371,62 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const u32 property_size{}; auto status = library_->GetPropertySize(session, property_id, &property_size); if (!status_ok(status)) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } switch (property_type_map_[property_id]) { case u32_: { u32 property_value{}; status = library_->GetProperty(session, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_u32_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_u32_scalar(property_value); break; } case boolean_: { bool property_value{}; status = library_->GetProperty(session, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_bool_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_bool_scalar(property_value); break; } case u64_: { u64 property_value{}; status = library_->GetProperty(session, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_u64_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_u64_scalar(property_value); break; } case i32_: { i32 property_value{}; status = library_->GetProperty(session, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_i32_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_i32_scalar(property_value); break; } case f64_: { f64 property_value{}; status = library_->GetProperty(session, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_f64_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_f64_scalar(property_value); break; } case string_: { std::string property_value(property_size, '\0'); status = library_->GetProperty(session, property_id, property_size, const_cast(property_value.c_str())); - if (status_ok(status)) { - response->set_str(property_value.c_str()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_str(property_value.c_str()); break; } case u32_array_: { @@ -427,6 +435,9 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const response->mutable_u32_array()->mutable_u32_array()->Resize(number_of_elements, 0); u32* property_value = reinterpret_cast(response->mutable_u32_array()->mutable_u32_array()->mutable_data()); status = library_->GetProperty(session, property_id, property_size, property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); + } break; } case db_ref_: { @@ -438,9 +449,10 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const }; uint32_t session_id = 0; status = nx_database_ref_t_resource_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - if (status_ok(status)) { - response->mutable_db_ref()->set_id(session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->mutable_db_ref()->set_id(session_id); break; } case db_ref_array_: { @@ -449,24 +461,25 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const std::vector property_value_vector(number_of_elements, 0U); nxDatabaseRef_t* property_value = static_cast(property_value_vector.data()); status = library_->GetProperty(session, property_id, property_size, property_value); - if (status_ok(status)) { - response->mutable_db_ref_array()->mutable_db_ref()->Clear(); - response->mutable_db_ref_array()->mutable_db_ref()->Reserve(number_of_elements); - std::transform( - property_value_vector.begin(), - property_value_vector.end(), - google::protobuf::RepeatedFieldBackInserter(response->mutable_db_ref_array()->mutable_db_ref()), - [&](auto x) { - auto init_lambda = [&]() { - return std::make_tuple(status, x); - }; - uint32_t session_id{}; - status = nx_database_ref_t_resource_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - nidevice_grpc::Session dependent_session{}; - dependent_session.set_id(session_id); - return dependent_session; - }); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->mutable_db_ref_array()->mutable_db_ref()->Clear(); + response->mutable_db_ref_array()->mutable_db_ref()->Reserve(number_of_elements); + std::transform( + property_value_vector.begin(), + property_value_vector.end(), + google::protobuf::RepeatedFieldBackInserter(response->mutable_db_ref_array()->mutable_db_ref()), + [&](auto x) { + auto init_lambda = [&]() { + return std::make_tuple(status, x); + }; + uint32_t session_id{}; + status = nx_database_ref_t_resource_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); + nidevice_grpc::Session dependent_session{}; + dependent_session.set_id(session_id); + return dependent_session; + }); break; } case dev_ref_: { @@ -480,9 +493,10 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const // We are adding it to session_repository_ and not to "device repository", because devices don't have a close API, // so it makes sense to tie their lifetime with session's lifetime. status = session_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - if (status_ok(status)) { - response->mutable_dev_ref()->set_id(session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->mutable_dev_ref()->set_id(session_id); break; } case dev_ref_array_: { @@ -491,26 +505,27 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const std::vector property_value_vector(number_of_elements, 0U); nxSessionRef_t* property_value = property_value_vector.data(); status = library_->GetProperty(session, property_id, property_size, property_value); - if (status_ok(status)) { - response->mutable_dev_ref_array()->mutable_dev_ref()->Clear(); - response->mutable_dev_ref_array()->mutable_dev_ref()->Reserve(number_of_elements); - std::transform( - property_value_vector.begin(), - property_value_vector.end(), - google::protobuf::RepeatedFieldBackInserter(response->mutable_dev_ref_array()->mutable_dev_ref()), - [&](auto x) { - auto init_lambda = [&]() { - return std::make_tuple(status, x); - }; - uint32_t session_id{}; - // We are adding it to session_repository_ and not to "device repository", because devices don't have a close API, - // so it makes sense to tie their lifetime with session's lifetime. - status = session_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - nidevice_grpc::Session dependent_session{}; - dependent_session.set_id(session_id); - return dependent_session; - }); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->mutable_dev_ref_array()->mutable_dev_ref()->Clear(); + response->mutable_dev_ref_array()->mutable_dev_ref()->Reserve(number_of_elements); + std::transform( + property_value_vector.begin(), + property_value_vector.end(), + google::protobuf::RepeatedFieldBackInserter(response->mutable_dev_ref_array()->mutable_dev_ref()), + [&](auto x) { + auto init_lambda = [&]() { + return std::make_tuple(status, x); + }; + uint32_t session_id{}; + // We are adding it to session_repository_ and not to "device repository", because devices don't have a close API, + // so it makes sense to tie their lifetime with session's lifetime. + status = session_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); + nidevice_grpc::Session dependent_session{}; + dependent_session.set_id(session_id); + return dependent_session; + }); break; } case intf_ref_array_: { @@ -519,26 +534,27 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const std::vector property_value_vector(number_of_elements, 0U); nxSessionRef_t* property_value = property_value_vector.data(); status = library_->GetProperty(session, property_id, property_size, property_value); - if (status_ok(status)) { - response->mutable_intf_ref_array()->mutable_intf_ref()->Clear(); - response->mutable_intf_ref_array()->mutable_intf_ref()->Reserve(number_of_elements); - std::transform( - property_value_vector.begin(), - property_value_vector.end(), - google::protobuf::RepeatedFieldBackInserter(response->mutable_intf_ref_array()->mutable_intf_ref()), - [&](auto x) { - auto init_lambda = [&]() { - return std::make_tuple(status, x); - }; - uint32_t session_id{}; - // We are adding it to session_repository_ and not to "interface repository", because interfaces don't have a close API, - // so it makes sense to tie their lifetime with session's lifetime. - status = session_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - nidevice_grpc::Session dependent_session{}; - dependent_session.set_id(session_id); - return dependent_session; - }); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->mutable_intf_ref_array()->mutable_intf_ref()->Clear(); + response->mutable_intf_ref_array()->mutable_intf_ref()->Reserve(number_of_elements); + std::transform( + property_value_vector.begin(), + property_value_vector.end(), + google::protobuf::RepeatedFieldBackInserter(response->mutable_intf_ref_array()->mutable_intf_ref()), + [&](auto x) { + auto init_lambda = [&]() { + return std::make_tuple(status, x); + }; + uint32_t session_id{}; + // We are adding it to session_repository_ and not to "interface repository", because interfaces don't have a close API, + // so it makes sense to tie their lifetime with session's lifetime. + status = session_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); + nidevice_grpc::Session dependent_session{}; + dependent_session.set_id(session_id); + return dependent_session; + }); break; } case nxEptRxFilter_Element_t_array_: { @@ -546,9 +562,10 @@ ::grpc::Status NiXnetService::GetProperty(::grpc::ServerContext* context, const std::vector property_value_vector(number_of_elements); nxEptRxFilter_Element_t* property_value = static_cast(property_value_vector.data()); status = library_->GetProperty(session, property_id, property_size, &property_value); - if (status_ok(status)) { - convert_to_grpc(property_value_vector, response->mutable_ept_rx_filter_array()->mutable_ept_rx_filter()); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + convert_to_grpc(property_value_vector, response->mutable_ept_rx_filter_array()->mutable_ept_rx_filter()); break; } default: { @@ -595,33 +612,35 @@ ::grpc::Status NiXnetService::GetSubProperty(::grpc::ServerContext* context, con u32 property_size{}; auto status = library_->GetSubPropertySize(session, active_index, property_id, &property_size); if (!status_ok(status)) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } switch (subproperty_type_map_[property_id]) { case u32_: { u32 property_value{}; status = library_->GetSubProperty(session, active_index, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_u32_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_u32_scalar(property_value); break; } case f64_: { f64 property_value{}; status = library_->GetSubProperty(session, active_index, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_f64_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_f64_scalar(property_value); break; } case string_: { std::string property_value(property_size, '\0'); status = library_->GetSubProperty(session, active_index, property_id, property_size, const_cast(property_value.c_str())); if (!status_ok(status)) { - response->set_str(property_value.c_str()); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } + response->set_str(property_value.c_str()); break; } default: { @@ -667,49 +686,53 @@ ::grpc::Status NiXnetService::DbGetProperty(::grpc::ServerContext* context, cons u32 property_size{}; auto status = library_->DbGetPropertySize(dbobject, property_id, &property_size); if (!status_ok(status)) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } switch (dbproperty_type_map_[property_id]) { case u32_: { u32 property_value{}; status = library_->DbGetProperty(dbobject, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_u32_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_u32_scalar(property_value); break; } case boolean_: { bool property_value{}; status = library_->DbGetProperty(dbobject, property_id, property_size, &property_value); - if (status_ok(status)) { - response->set_bool_scalar(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_bool_scalar(property_value); break; } case u64_: { u64 property_value{}; status = library_->DbGetProperty(dbobject, property_id, property_size, &property_value); if (!status_ok(status)) { - response->set_u64_scalar(property_value); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_u64_scalar(property_value); break; } case f64_: { f64 property_value{}; status = library_->DbGetProperty(dbobject, property_id, property_size, &property_value); if (!status_ok(status)) { - response->set_f64_scalar(property_value); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_f64_scalar(property_value); break; } case string_: { std::string property_value(property_size, '\0'); status = library_->DbGetProperty(dbobject, property_id, property_size, const_cast(property_value.c_str())); if (!status_ok(status)) { - response->set_str(property_value.c_str()); + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_str(property_value.c_str()); break; } case u32_array_: { @@ -718,15 +741,19 @@ ::grpc::Status NiXnetService::DbGetProperty(::grpc::ServerContext* context, cons response->mutable_u32_array()->mutable_u32_array()->Resize(number_of_elements, 0); u32* property_value = reinterpret_cast(response->mutable_u32_array()->mutable_u32_array()->mutable_data()); status = library_->DbGetProperty(dbobject, property_id, property_size, property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); + } break; } case u8_array_: { int32_t number_of_elements = property_size / sizeof(u8); std::string property_value(number_of_elements, '\0'); status = library_->DbGetProperty(dbobject, property_id, property_size, (u8*)property_value.data()); - if (status_ok(status)) { - response->set_u8_array(property_value); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_u8_array(property_value); } case db_ref_: { auto initiating_session_id = nx_database_ref_t_resource_repository_->access_session_id(dbobject_grpc_session.id(), dbobject_grpc_session.name()); @@ -737,9 +764,10 @@ ::grpc::Status NiXnetService::DbGetProperty(::grpc::ServerContext* context, cons }; uint32_t session_id = 0; status = nx_database_ref_t_resource_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - if (status_ok(status)) { - response->mutable_db_ref()->set_id(session_id); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->mutable_db_ref()->set_id(session_id); break; } case db_ref_array_: { @@ -748,24 +776,25 @@ ::grpc::Status NiXnetService::DbGetProperty(::grpc::ServerContext* context, cons std::vector property_value_vector(number_of_elements, 0U); nxDatabaseRef_t* property_value = static_cast(property_value_vector.data()); status = library_->DbGetProperty(dbobject, property_id, property_size, property_value); - if (status_ok(status)) { - response->mutable_db_ref_array()->mutable_db_ref()->Clear(); - response->mutable_db_ref_array()->mutable_db_ref()->Reserve(number_of_elements); - std::transform( - property_value_vector.begin(), - property_value_vector.end(), - google::protobuf::RepeatedFieldBackInserter(response->mutable_db_ref_array()->mutable_db_ref()), - [&](auto x) { - auto init_lambda = [&]() { - return std::make_tuple(status, x); - }; - uint32_t session_id{}; - status = nx_database_ref_t_resource_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); - nidevice_grpc::Session dependent_session{}; - dependent_session.set_id(session_id); - return dependent_session; - }); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->mutable_db_ref_array()->mutable_db_ref()->Clear(); + response->mutable_db_ref_array()->mutable_db_ref()->Reserve(number_of_elements); + std::transform( + property_value_vector.begin(), + property_value_vector.end(), + google::protobuf::RepeatedFieldBackInserter(response->mutable_db_ref_array()->mutable_db_ref()), + [&](auto x) { + auto init_lambda = [&]() { + return std::make_tuple(status, x); + }; + uint32_t session_id{}; + status = nx_database_ref_t_resource_repository_->add_dependent_session("", init_lambda, initiating_session_id, session_id); + nidevice_grpc::Session dependent_session{}; + dependent_session.set_id(session_id); + return dependent_session; + }); break; } default: { @@ -888,6 +917,9 @@ ::grpc::Status NiXnetService::SetProperty(::grpc::ServerContext* context, const break; } } + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); + } response->set_status(status); return ::grpc::Status::OK; } @@ -949,6 +981,9 @@ ::grpc::Status NiXnetService::SetSubProperty(::grpc::ServerContext* context, con break; } } + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); + } response->set_status(status); return ::grpc::Status::OK; } @@ -1050,6 +1085,9 @@ ::grpc::Status NiXnetService::DbSetProperty(::grpc::ServerContext* context, cons break; } } + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); + } response->set_status(status); return ::grpc::Status::OK; } @@ -1083,12 +1121,13 @@ ::grpc::Status NiXnetService::DbGetDatabaseList(::grpc::ServerContext* context, u32 number_of_databases{}; status = library_->DbGetDatabaseList(ip_address, size_of_alias_buffer, const_cast(alias_buffer.c_str()), size_of_file_path_buffer, const_cast(file_path_buffer.c_str()), &number_of_databases); - response->set_status(status); - if (status_ok(status)) { - response->set_alias_buffer(alias_buffer.c_str()); - response->set_filepath_buffer(file_path_buffer.c_str()); - response->set_number_of_databases(number_of_databases); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, 0); } + response->set_status(status); + response->set_alias_buffer(alias_buffer.c_str()); + response->set_filepath_buffer(file_path_buffer.c_str()); + response->set_number_of_databases(number_of_databases); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1106,7 +1145,7 @@ ::grpc::Status NiXnetService::DbGetDBCAttribute(::grpc::ServerContext* context, } try { auto db_object_grpc_session = request->db_object(); - nxDatabaseRef_t db_object = nx_database_ref_t_resource_repository_->access_session(db_object_grpc_session.id(), db_object_grpc_session.name()); + nxDatabaseRef_t dbobject = nx_database_ref_t_resource_repository_->access_session(db_object_grpc_session.id(), db_object_grpc_session.name()); u32 mode; switch (request->mode_enum_case()) { case nixnet_grpc::DbGetDBCAttributeRequest::ModeEnumCase::kMode: { @@ -1125,21 +1164,21 @@ ::grpc::Status NiXnetService::DbGetDBCAttribute(::grpc::ServerContext* context, auto attribute_name = request->attribute_name().c_str(); u32 attribute_text_size{}; - auto status = library_->DbGetDBCAttributeSize(db_object, mode, attribute_name, &attribute_text_size); + auto status = library_->DbGetDBCAttributeSize(dbobject, mode, attribute_name, &attribute_text_size); if (!status_ok(status)) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } std::string attribute_text(attribute_text_size, '\0'); u32 is_default{}; - status = library_->DbGetDBCAttribute(db_object, mode, attribute_name, attribute_text_size, const_cast(attribute_text.c_str()), &is_default); - response->set_status(status); - if (status_ok(status)) { - response->set_is_default(is_default); - response->set_attribute_text(attribute_text.c_str()); + status = library_->DbGetDBCAttribute(dbobject, mode, attribute_name, attribute_text_size, const_cast(attribute_text.c_str()), &is_default); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); } + response->set_status(status); + response->set_is_default(is_default); + response->set_attribute_text(attribute_text.c_str()); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1147,7 +1186,7 @@ ::grpc::Status NiXnetService::DbGetDBCAttribute(::grpc::ServerContext* context, } } -::grpc::Status NiXnetService::ConvertApiErrorStatusFornxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session) +::grpc::Status NiXnetService::ConvertApiErrorStatusForNxSessionRef_t(google::protobuf::int32 status, nxSessionRef_t session) { static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 2048, "StatusToString expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); @@ -1155,7 +1194,7 @@ ::grpc::Status NiXnetService::ConvertApiErrorStatusFornxSessionRef_t(google::pro return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } -::grpc::Status NiXnetService::ConvertApiErrorStatusFornxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session) +::grpc::Status NiXnetService::ConvertApiErrorStatusForNxDatabaseRef_t(google::protobuf::int32 status, nxDatabaseRef_t session) { static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 2048, "StatusToString expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/custom/nixnetsocket_service.custom.cpp b/source/custom/nixnetsocket_service.custom.cpp index 25b319552..2801855e3 100644 --- a/source/custom/nixnetsocket_service.custom.cpp +++ b/source/custom/nixnetsocket_service.custom.cpp @@ -2,7 +2,7 @@ namespace nixnetsocket_grpc { -::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxSOCKET(google::protobuf::int32 status, nxSOCKET socket) +::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxSOCKET(google::protobuf::int32 status, nxSOCKET socket) { // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); @@ -10,7 +10,7 @@ ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxSOCKET(google::pro return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } -::grpc::Status NiXnetSocketService::ConvertApiErrorStatusFornxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket) +::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket) { // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); diff --git a/source/server/converters.h b/source/server/converters.h index 4fcb08ad1..693b9904d 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -330,7 +330,7 @@ inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 sta for (size_t index = 0; (index = description.find('"', index)) != std::string::npos; index += 2) { description.replace(index, 1, "\\\""); } - std::string errorMessage = "{ \"code\":\"" + std::to_string(status) + "\", \"" + description + "\" }"; + std::string errorMessage = "{ \"code\":" + std::to_string(status) + ", \"message\":\"" + description + "\" }"; return ::grpc::Status(grpc::StatusCode::UNKNOWN, errorMessage); } } // namespace nidevice_grpc From 0e705a304589577381517c8417f4a475452fa9e7 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Mon, 8 Aug 2022 10:17:35 -0500 Subject: [PATCH 04/11] Fix the build --- source/custom/nixnet_service.custom.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/custom/nixnet_service.custom.cpp b/source/custom/nixnet_service.custom.cpp index 1887bdb0b..baadeafe3 100644 --- a/source/custom/nixnet_service.custom.cpp +++ b/source/custom/nixnet_service.custom.cpp @@ -918,7 +918,7 @@ ::grpc::Status NiXnetService::SetProperty(::grpc::ServerContext* context, const } } if (!status_ok(status)) { - return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; @@ -982,7 +982,7 @@ ::grpc::Status NiXnetService::SetSubProperty(::grpc::ServerContext* context, con } } if (!status_ok(status)) { - return ConvertApiErrorStatusForNxDatabaseRef_t(status, dbobject); + return ConvertApiErrorStatusForNxSessionRef_t(status, session); } response->set_status(status); return ::grpc::Status::OK; From 66b4cbdc4d9a73bbe300208f96621cd4c4e64afc Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Mon, 8 Aug 2022 15:58:30 -0500 Subject: [PATCH 05/11] Fixed tests, fixed driver warning/error issues --- source/custom/nidcpower_service.custom.cpp | 60 +++++----- .../custom/nifake_non_ivi_service.custom.cpp | 10 +- source/custom/nifake_service.custom.cpp | 5 +- source/custom/niscope_service.custom.cpp | 110 +++++++++++++----- source/custom/nisync_service.custom.cpp | 2 +- .../unit/ni_fake_non_ivi_service_tests.cpp | 37 +++--- source/tests/unit/ni_fake_service_tests.cpp | 11 +- 7 files changed, 156 insertions(+), 79 deletions(-) diff --git a/source/custom/nidcpower_service.custom.cpp b/source/custom/nidcpower_service.custom.cpp index 69ab531b8..f34ec0124 100644 --- a/source/custom/nidcpower_service.custom.cpp +++ b/source/custom/nidcpower_service.custom.cpp @@ -4,12 +4,12 @@ namespace nidcpower_grpc { -class DriverErrorException : public std::runtime_error{ +class DriverWarningOrErrorException : public std::runtime_error{ private: int status_ = 0; public: - DriverErrorException(int status) : std::runtime_error(""), status_(status) { } + DriverWarningOrErrorException(int status) : std::runtime_error(""), status_(status) { } int status() const { return status_; @@ -19,44 +19,48 @@ class DriverErrorException : public std::runtime_error{ static void CheckStatus(int status) { if (status != 0) { - throw DriverErrorException(status); + throw DriverWarningOrErrorException(status); } } //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDCPowerService::MeasureMultiple(::grpc::ServerContext* context, const MeasureMultipleRequest* request, MeasureMultipleResponse* response) - { - if (context->IsCancelled()) { - return ::grpc::Status::CANCELLED; - } - ViSession vi = VI_NULL; - try { - auto vi_grpc_session = request->vi(); - vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); - ViConstString channel_name = request->channel_name().c_str(); +{ + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + ViSession vi = VI_NULL; + try { + auto vi_grpc_session = request->vi(); + vi = session_repository_->access_session(vi_grpc_session.id(), vi_grpc_session.name()); + ViConstString channel_name = request->channel_name().c_str(); - ViUInt32 number_of_channels; - CheckStatus(library_->ParseChannelCount(vi, channel_name, &number_of_channels)); - response->mutable_voltage_measurements()->Resize(number_of_channels, 0.0); - ViReal64* voltage_measurements = response->mutable_voltage_measurements()->mutable_data(); - response->mutable_current_measurements()->Resize(number_of_channels, 0.0); - ViReal64* current_measurements = response->mutable_current_measurements()->mutable_data(); + ViUInt32 number_of_channels; + CheckStatus(library_->ParseChannelCount(vi, channel_name, &number_of_channels)); + response->mutable_voltage_measurements()->Resize(number_of_channels, 0.0); + ViReal64* voltage_measurements = response->mutable_voltage_measurements()->mutable_data(); + response->mutable_current_measurements()->Resize(number_of_channels, 0.0); + ViReal64* current_measurements = response->mutable_current_measurements()->mutable_data(); - auto status = library_->MeasureMultiple(vi, channel_name, voltage_measurements, current_measurements); - if (status < VI_SUCCESS) { - return ConvertApiErrorStatusForViSession(status, vi); - } - response->set_status(status); - return ::grpc::Status::OK; - } - catch (nidevice_grpc::LibraryLoadException& ex) { - return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); + auto status = library_->MeasureMultiple(vi, channel_name, voltage_measurements, current_measurements); + if (status < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(status, vi); } - catch (const DriverErrorException& ex) { + response->set_status(status); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::LibraryLoadException& ex) { + return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); + } + catch (const DriverWarningOrErrorException& ex) { + if (ex.status() < VI_SUCCESS) { return ConvertApiErrorStatusForViSession(ex.status(), vi); } + response->set_status(ex.status()); + return ::grpc::Status::OK; } +} ::grpc::Status NiDCPowerService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { diff --git a/source/custom/nifake_non_ivi_service.custom.cpp b/source/custom/nifake_non_ivi_service.custom.cpp index b1768962a..ecdc2a925 100644 --- a/source/custom/nifake_non_ivi_service.custom.cpp +++ b/source/custom/nifake_non_ivi_service.custom.cpp @@ -53,14 +53,16 @@ ::grpc::ServerWriteReactor* NiFakeNonIviService::ReadStream( ::grpc::Status NiFakeNonIviService::ConvertApiErrorStatusForFakeHandle(google::protobuf::int32 status, FakeHandle handle) { - std::string description = "In a real service, you'd look up the error message here."; - return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetLatestErrorMessage(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } ::grpc::Status NiFakeNonIviService::ConvertApiErrorStatusForSecondarySessionHandle(google::protobuf::int32 status, SecondarySessionHandle handle) { - std::string description = "In a real service, you'd look up the error message here."; - return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->GetLatestErrorMessage(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } } // namespace nifake_non_ivi_grpc diff --git a/source/custom/nifake_service.custom.cpp b/source/custom/nifake_service.custom.cpp index 2aee9f0c4..047940dce 100644 --- a/source/custom/nifake_service.custom.cpp +++ b/source/custom/nifake_service.custom.cpp @@ -4,8 +4,9 @@ namespace nifake_grpc { ::grpc::Status NiFakeService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { - std::string description = "In a real service, you'd look up the error message here."; - return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + library_->error_message(vi, status, description.data()); + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } } // namespace nifake_grpc diff --git a/source/custom/niscope_service.custom.cpp b/source/custom/niscope_service.custom.cpp index 3ac6c4cfb..100fb907e 100644 --- a/source/custom/niscope_service.custom.cpp +++ b/source/custom/niscope_service.custom.cpp @@ -9,15 +9,15 @@ using nidevice_grpc::converters::convert_to_grpc; const auto kErrorReadBufferTooSmall = -200229; -struct DriverErrorException : std::runtime_error { - DriverErrorException(int status) : std::runtime_error("") { status_ = status; } +struct DriverWarningOrErrorException : std::runtime_error { + DriverWarningOrErrorException(int status) : std::runtime_error("") { status_ = status; } int status_ = 0; }; void CheckStatus(int status) { if (status != 0) { - throw DriverErrorException(status); + throw DriverWarningOrErrorException(status); } } @@ -56,8 +56,12 @@ ::grpc::Status NiScopeService::Fetch(::grpc::ServerContext* context, const Fetch catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -96,8 +100,12 @@ ::grpc::Status NiScopeService::FetchBinary8(::grpc::ServerContext* context, cons catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -136,8 +144,12 @@ ::grpc::Status NiScopeService::FetchBinary16(::grpc::ServerContext* context, con catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -176,8 +188,12 @@ ::grpc::Status NiScopeService::FetchBinary32(::grpc::ServerContext* context, con catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -227,8 +243,12 @@ ::grpc::Status NiScopeService::FetchArrayMeasurement(::grpc::ServerContext* cont catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -283,8 +303,12 @@ ::grpc::Status NiScopeService::FetchMeasurementStats(::grpc::ServerContext* cont catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -323,8 +347,12 @@ ::grpc::Status NiScopeService::Read(::grpc::ServerContext* context, const ReadRe catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -363,8 +391,12 @@ ::grpc::Status NiScopeService::FetchComplex(::grpc::ServerContext* context, cons catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -403,8 +435,12 @@ ::grpc::Status NiScopeService::FetchComplexBinary16(::grpc::ServerContext* conte catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -449,8 +485,12 @@ ::grpc::Status NiScopeService::FetchMeasurement(::grpc::ServerContext* context, catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -489,8 +529,12 @@ ::grpc::Status NiScopeService::GetNormalizationCoefficients(::grpc::ServerContex catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -529,8 +573,12 @@ ::grpc::Status NiScopeService::GetScalingCoefficients(::grpc::ServerContext* con catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } @@ -575,8 +623,12 @@ ::grpc::Status NiScopeService::ReadMeasurement(::grpc::ServerContext* context, c catch (nidevice_grpc::LibraryLoadException& ex) { return ::grpc::Status(::grpc::NOT_FOUND, ex.what()); } - catch (DriverErrorException& ex) { - return ConvertApiErrorStatusForViSession(ex.status_, vi); + catch (const DriverWarningOrErrorException& ex) { + if (ex.status_ < VI_SUCCESS) { + return ConvertApiErrorStatusForViSession(ex.status_, vi); + } + response->set_status(ex.status_); + return ::grpc::Status::OK; } } diff --git a/source/custom/nisync_service.custom.cpp b/source/custom/nisync_service.custom.cpp index bcd3f4cee..8be04d180 100644 --- a/source/custom/nisync_service.custom.cpp +++ b/source/custom/nisync_service.custom.cpp @@ -25,10 +25,10 @@ ::grpc::Status NiSyncService::ReadMultipleTriggerTimeStamp(::grpc::ServerContext ViInt32* detected_edge_buffer = reinterpret_cast(response->mutable_detected_edge_buffer()->mutable_data()); ViUInt32 timestamps_read {}; auto status = library_->ReadMultipleTriggerTimeStamp(vi, terminal, timestamps_to_read, timeout, time_seconds_buffer, time_nanoseconds_buffer, time_fractional_nanoseconds_buffer, detected_edge_buffer, ×tamps_read); - response->set_status(status); if (status < VI_SUCCESS) { return ConvertApiErrorStatusForViSession(status, vi); } + response->set_status(status); response->set_timestamps_read(timestamps_read); return ::grpc::Status::OK; } diff --git a/source/tests/unit/ni_fake_non_ivi_service_tests.cpp b/source/tests/unit/ni_fake_non_ivi_service_tests.cpp index e7b2072e2..f3f142663 100644 --- a/source/tests/unit/ni_fake_non_ivi_service_tests.cpp +++ b/source/tests/unit/ni_fake_non_ivi_service_tests.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -11,6 +12,7 @@ #include using namespace nifake_non_ivi_grpc; +using namespace ::nlohmann; using namespace ::testing; bool operator==(const StructWithCoercion_struct& left, const StructWithCoercion& right) @@ -1704,11 +1706,15 @@ TEST_F(NiFakeNonIviServiceTests, InitWithReturnedSessionFailsInit_AccessSession_ InitWithReturnedSessionRequest request; InitWithReturnedSessionResponse response; request.set_handle_name(SESSION_NAME); - service_.InitWithReturnedSession(&context, &request, &response); + auto status = service_.InitWithReturnedSession(&context, &request, &response); const auto accessed_handle = resource_repository_->access_session(response.handle().id(), ""); - EXPECT_EQ(FAILED_INIT, response.status()); + EXPECT_FALSE(status.ok()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(FAILED_INIT, error.value("code", 0)); + EXPECT_NE(FAILED_INIT, response.status()); EXPECT_EQ(0, accessed_handle); } @@ -1726,7 +1732,7 @@ TEST_F(NiFakeNonIviServiceTests, GetStringAsReturnedValue_ReturnsString) EXPECT_EQ(kDriverSuccess, response.status()); } -TEST_F(NiFakeNonIviServiceTests, GetStringAsReturnedValueReturnsNull_ReturnsErrorAndEmptryString) +TEST_F(NiFakeNonIviServiceTests, GetStringAsReturnedValueReturnsNull_ReturnsError) { constexpr auto FAILED_GET = -1; EXPECT_CALL(library_, GetStringAsReturnedValue(_)) @@ -1734,10 +1740,13 @@ TEST_F(NiFakeNonIviServiceTests, GetStringAsReturnedValueReturnsNull_ReturnsErro ::grpc::ServerContext context; GetStringAsReturnedValueRequest request; GetStringAsReturnedValueResponse response; - service_.GetStringAsReturnedValue(&context, &request, &response); + auto status = service_.GetStringAsReturnedValue(&context, &request, &response); - EXPECT_THAT(response.string_out(), IsEmpty()); - EXPECT_EQ(FAILED_GET, response.status()); + EXPECT_FALSE(status.ok()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(FAILED_GET, error.value("code", 0)); + EXPECT_NE(FAILED_GET, response.status()); } TEST_F(NiFakeNonIviServiceTests, InitWithError_CallsGetLatestErrorAndReturnsMessage) @@ -1747,9 +1756,7 @@ TEST_F(NiFakeNonIviServiceTests, InitWithError_CallsGetLatestErrorAndReturnsMess const auto ERROR_MESSAGE_BUFFER_SIZE = static_cast(ERROR_MESSAGE.size() + 1); EXPECT_CALL(library_, Init(_, _)) .WillOnce(Return(SOME_ERROR)); - EXPECT_CALL(library_, GetLatestErrorMessage(nullptr, 0)) - .WillOnce(Return(ERROR_MESSAGE_BUFFER_SIZE)); - EXPECT_CALL(library_, GetLatestErrorMessage(_, ERROR_MESSAGE_BUFFER_SIZE)) + EXPECT_CALL(library_, GetLatestErrorMessage(_, 4096)) .WillOnce( DoAll( SetArrayArgument<0>(ERROR_MESSAGE.c_str(), ERROR_MESSAGE.c_str() + ERROR_MESSAGE_BUFFER_SIZE), @@ -1757,10 +1764,14 @@ TEST_F(NiFakeNonIviServiceTests, InitWithError_CallsGetLatestErrorAndReturnsMess ::grpc::ServerContext context; InitRequest request; InitResponse response; - service_.Init(&context, &request, &response); - - EXPECT_EQ(ERROR_MESSAGE, response.error_message()); - EXPECT_EQ(SOME_ERROR, response.status()); + auto status = service_.Init(&context, &request, &response); + + EXPECT_FALSE(status.ok()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(SOME_ERROR, error.value("code", 0)); + EXPECT_EQ(ERROR_MESSAGE, error.value("message", "")); + EXPECT_NE(SOME_ERROR, response.status()); } TEST_F(NiFakeNonIviServiceTests, InitWithNoError_DoesNotCallGetLatestError) diff --git a/source/tests/unit/ni_fake_service_tests.cpp b/source/tests/unit/ni_fake_service_tests.cpp index 72d8d9cfc..95544036b 100644 --- a/source/tests/unit/ni_fake_service_tests.cpp +++ b/source/tests/unit/ni_fake_service_tests.cpp @@ -4,12 +4,15 @@ #include #include #include +#include #include #include #include #include +using namespace ::nlohmann; + // fixes seg faults caused by https://github.com/grpc/grpc/issues/14633 static grpc::internal::GrpcLibraryInitializer g_gli_initializer; @@ -423,8 +426,12 @@ TEST(NiFakeServiceTests, NiFakeService_FunctionCallErrors_ResponseValuesNotSet) nifake_grpc::GetABooleanResponse response; ::grpc::Status status = service.GetABoolean(&context, &request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kDriverFailure, response.status()); + EXPECT_FALSE(status.ok()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kDriverFailure, error.value("code", 0)); + EXPECT_TRUE(error.contains("message")); + EXPECT_NE(kDriverFailure, response.status()); EXPECT_NE(a_boolean, response.a_boolean()); } From 6479f08c5a00ebedc40cd548f0962aa19b8a7532 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Mon, 8 Aug 2022 16:30:05 -0500 Subject: [PATCH 06/11] Fix error checking for nisync, nixnet --- source/custom/nisync_service.custom.cpp | 2 +- source/custom/nixnet_service.custom.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/custom/nisync_service.custom.cpp b/source/custom/nisync_service.custom.cpp index 8be04d180..aed31a159 100644 --- a/source/custom/nisync_service.custom.cpp +++ b/source/custom/nisync_service.custom.cpp @@ -25,7 +25,7 @@ ::grpc::Status NiSyncService::ReadMultipleTriggerTimeStamp(::grpc::ServerContext ViInt32* detected_edge_buffer = reinterpret_cast(response->mutable_detected_edge_buffer()->mutable_data()); ViUInt32 timestamps_read {}; auto status = library_->ReadMultipleTriggerTimeStamp(vi, terminal, timestamps_to_read, timeout, time_seconds_buffer, time_nanoseconds_buffer, time_fractional_nanoseconds_buffer, detected_edge_buffer, ×tamps_read); - if (status < VI_SUCCESS) { + if (status < VI_SUCCESS && status != NISYNC_ERROR_DRIVER_TIMEOUT) { return ConvertApiErrorStatusForViSession(status, vi); } response->set_status(status); diff --git a/source/custom/nixnet_service.custom.cpp b/source/custom/nixnet_service.custom.cpp index baadeafe3..56ce74164 100644 --- a/source/custom/nixnet_service.custom.cpp +++ b/source/custom/nixnet_service.custom.cpp @@ -1112,8 +1112,7 @@ ::grpc::Status NiXnetService::DbGetDatabaseList(::grpc::ServerContext* context, u32 size_of_file_path_buffer{}; auto status = library_->DbGetDatabaseListSizes(ip_address, &size_of_alias_buffer, &size_of_file_path_buffer); if (!status_ok(status)) { - response->set_status(status); - return ::grpc::Status::OK; + return ConvertApiErrorStatusForNxDatabaseRef_t(status, 0); } std::string alias_buffer(size_of_alias_buffer, '\0'); From 81667d4fb5abe0cf6c0cdc29c0f9352c03f99eb6 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Tue, 9 Aug 2022 14:49:29 -0500 Subject: [PATCH 07/11] Fixing tests that expected response errors --- source/custom/nidaqmx_service.custom.cpp | 2 +- source/custom/nidcpower_service.custom.cpp | 4 +- .../nidigitalpattern_service.custom.cpp | 4 +- source/custom/nidmm_service.custom.cpp | 4 +- .../custom/nifake_non_ivi_service.custom.cpp | 4 +- source/custom/nifake_service.custom.cpp | 2 +- source/custom/nifgen_service.custom.cpp | 4 +- .../custom/nirfmxbluetooth_service.custom.cpp | 4 +- source/custom/nirfmxinstr_service.custom.cpp | 4 +- source/custom/nirfmxlte_service.custom.cpp | 4 +- source/custom/nirfmxnr_service.custom.cpp | 4 +- source/custom/nirfmxspecan_service.custom.cpp | 4 +- source/custom/nirfmxwlan_service.custom.cpp | 4 +- source/custom/nirfsa_service.custom.cpp | 4 +- source/custom/nirfsg_service.custom.cpp | 4 +- source/custom/niscope_service.custom.cpp | 4 +- source/custom/niswitch_service.custom.cpp | 4 +- source/custom/nisync_service.custom.cpp | 2 +- source/custom/nitclk_service.custom.cpp | 2 +- source/custom/nixnet_service.custom.cpp | 4 +- source/custom/nixnetsocket_service.custom.cpp | 4 +- .../tests/system/nidaqmx_driver_api_tests.cpp | 77 ++++++++++++------- .../tests/system/nidcpower_session_tests.cpp | 26 ++++--- .../tests/system/nidigital_session_tests.cpp | 18 +++-- source/tests/system/nidmm_session_tests.cpp | 26 ++++--- source/tests/system/nifgen_session_tests.cpp | 23 ++++-- .../nirfmxbluetooth_driver_api_tests.cpp | 1 + .../system/nirfmxbluetooth_session_tests.cpp | 18 +++-- .../tests/system/nirfmxlte_session_tests.cpp | 18 +++-- .../system/nirfmxnr_driver_api_tests.cpp | 4 +- .../tests/system/nirfmxnr_session_tests.cpp | 18 +++-- .../system/nirfmxspecan_driver_api_tests.cpp | 24 ++++-- .../system/nirfmxspecan_session_tests.cpp | 32 +++++--- .../tests/system/nirfmxwlan_session_tests.cpp | 18 +++-- .../tests/system/nirfsa_driver_api_tests.cpp | 46 ++++++----- source/tests/system/nirfsg_session_tests.cpp | 23 +++--- source/tests/system/niscope_session_tests.cpp | 26 ++++--- .../tests/system/niswitch_session_tests.cpp | 26 ++++--- source/tests/system/rfmx_macros.h | 25 +++--- 39 files changed, 316 insertions(+), 209 deletions(-) diff --git a/source/custom/nidaqmx_service.custom.cpp b/source/custom/nidaqmx_service.custom.cpp index 1fa56c426..4e02ee9d5 100644 --- a/source/custom/nidaqmx_service.custom.cpp +++ b/source/custom/nidaqmx_service.custom.cpp @@ -6,7 +6,7 @@ ::grpc::Status NiDAQmxService::ConvertApiErrorStatusForTaskHandle(google::protob { // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetExtendedErrorInfo(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetExtendedErrorInfo(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nidcpower_service.custom.cpp b/source/custom/nidcpower_service.custom.cpp index f34ec0124..af2557571 100644 --- a/source/custom/nidcpower_service.custom.cpp +++ b/source/custom/nidcpower_service.custom.cpp @@ -68,11 +68,11 @@ ::grpc::Status NiDCPowerService::ConvertApiErrorStatusForViSession(google::proto ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nidigitalpattern_service.custom.cpp b/source/custom/nidigitalpattern_service.custom.cpp index b9e18c4ab..31d622dab 100644 --- a/source/custom/nidigitalpattern_service.custom.cpp +++ b/source/custom/nidigitalpattern_service.custom.cpp @@ -8,11 +8,11 @@ ::grpc::Status NiDigitalService::ConvertApiErrorStatusForViSession(google::proto ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nidmm_service.custom.cpp b/source/custom/nidmm_service.custom.cpp index daf79c496..0b79a3411 100644 --- a/source/custom/nidmm_service.custom.cpp +++ b/source/custom/nidmm_service.custom.cpp @@ -7,11 +7,11 @@ ::grpc::Status NiDmmService::ConvertApiErrorStatusForViSession(google::protobuf: ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorMessage(vi, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorMessage(vi, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nifake_non_ivi_service.custom.cpp b/source/custom/nifake_non_ivi_service.custom.cpp index ecdc2a925..dffd7c94a 100644 --- a/source/custom/nifake_non_ivi_service.custom.cpp +++ b/source/custom/nifake_non_ivi_service.custom.cpp @@ -54,14 +54,14 @@ ::grpc::ServerWriteReactor* NiFakeNonIviService::ReadStream( ::grpc::Status NiFakeNonIviService::ConvertApiErrorStatusForFakeHandle(google::protobuf::int32 status, FakeHandle handle) { std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetLatestErrorMessage(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetLatestErrorMessage(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } ::grpc::Status NiFakeNonIviService::ConvertApiErrorStatusForSecondarySessionHandle(google::protobuf::int32 status, SecondarySessionHandle handle) { std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetLatestErrorMessage(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetLatestErrorMessage(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nifake_service.custom.cpp b/source/custom/nifake_service.custom.cpp index 047940dce..7570f389d 100644 --- a/source/custom/nifake_service.custom.cpp +++ b/source/custom/nifake_service.custom.cpp @@ -5,7 +5,7 @@ namespace nifake_grpc { ::grpc::Status NiFakeService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession vi) { std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->error_message(vi, status, description.data()); + library_->error_message(vi, status, &description[0]); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nifgen_service.custom.cpp b/source/custom/nifgen_service.custom.cpp index c5ab65436..3388d24f5 100644 --- a/source/custom/nifgen_service.custom.cpp +++ b/source/custom/nifgen_service.custom.cpp @@ -44,11 +44,11 @@ ::grpc::Status NiFgenService::ConvertApiErrorStatusForViSession(google::protobuf ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxbluetooth_service.custom.cpp b/source/custom/nirfmxbluetooth_service.custom.cpp index e49469233..24babe22e 100644 --- a/source/custom/nirfmxbluetooth_service.custom.cpp +++ b/source/custom/nirfmxbluetooth_service.custom.cpp @@ -7,11 +7,11 @@ ::grpc::Status NiRFmxBluetoothService::ConvertApiErrorStatusForNiRFmxInstrHandle ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxinstr_service.custom.cpp b/source/custom/nirfmxinstr_service.custom.cpp index d03409feb..eedc337e2 100644 --- a/source/custom/nirfmxinstr_service.custom.cpp +++ b/source/custom/nirfmxinstr_service.custom.cpp @@ -114,11 +114,11 @@ ::grpc::Status NiRFmxInstrService::ConvertApiErrorStatusForNiRFmxInstrHandle(goo int32 error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxlte_service.custom.cpp b/source/custom/nirfmxlte_service.custom.cpp index 3360dac23..30db43350 100644 --- a/source/custom/nirfmxlte_service.custom.cpp +++ b/source/custom/nirfmxlte_service.custom.cpp @@ -7,11 +7,11 @@ ::grpc::Status NiRFmxLTEService::ConvertApiErrorStatusForNiRFmxInstrHandle(googl ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxnr_service.custom.cpp b/source/custom/nirfmxnr_service.custom.cpp index 2fd71bbec..8611ddef6 100644 --- a/source/custom/nirfmxnr_service.custom.cpp +++ b/source/custom/nirfmxnr_service.custom.cpp @@ -7,11 +7,11 @@ ::grpc::Status NiRFmxNRService::ConvertApiErrorStatusForNiRFmxInstrHandle(google int32 error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxspecan_service.custom.cpp b/source/custom/nirfmxspecan_service.custom.cpp index e2615b799..00bc3193f 100644 --- a/source/custom/nirfmxspecan_service.custom.cpp +++ b/source/custom/nirfmxspecan_service.custom.cpp @@ -8,10 +8,10 @@ ::grpc::Status NiRFmxSpecAnService::ConvertApiErrorStatusForNiRFmxInstrHandle(go ViStatus error_code {}; std::string description(buffer_size, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, buffer_size, description.data()); + library_->GetError(instrumentHandle, &error_code, buffer_size, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorString(instrumentHandle, status, buffer_size, description.data()); + library_->GetErrorString(instrumentHandle, status, buffer_size, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfmxwlan_service.custom.cpp b/source/custom/nirfmxwlan_service.custom.cpp index 8de32828d..59696b0c3 100644 --- a/source/custom/nirfmxwlan_service.custom.cpp +++ b/source/custom/nirfmxwlan_service.custom.cpp @@ -7,11 +7,11 @@ ::grpc::Status NiRFmxWLANService::ConvertApiErrorStatusForNiRFmxInstrHandle(goog int32 error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfsa_service.custom.cpp b/source/custom/nirfsa_service.custom.cpp index e12c7d4b6..562fe1503 100644 --- a/source/custom/nirfsa_service.custom.cpp +++ b/source/custom/nirfsa_service.custom.cpp @@ -8,11 +8,11 @@ ::grpc::Status NiRFSAService::ConvertApiErrorStatusForViSession(google::protobuf ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nirfsg_service.custom.cpp b/source/custom/nirfsg_service.custom.cpp index 2df638d28..bec66d74b 100644 --- a/source/custom/nirfsg_service.custom.cpp +++ b/source/custom/nirfsg_service.custom.cpp @@ -8,11 +8,11 @@ ::grpc::Status NiRFSGService::ConvertApiErrorStatusForViSession(google::protobuf ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/niscope_service.custom.cpp b/source/custom/niscope_service.custom.cpp index 100fb907e..614678e7b 100644 --- a/source/custom/niscope_service.custom.cpp +++ b/source/custom/niscope_service.custom.cpp @@ -637,11 +637,11 @@ ::grpc::Status NiScopeService::ConvertApiErrorStatusForViSession(google::protobu ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetErrorMessage(vi, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetErrorMessage(vi, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/niswitch_service.custom.cpp b/source/custom/niswitch_service.custom.cpp index 8b6126eaf..df9423b89 100644 --- a/source/custom/niswitch_service.custom.cpp +++ b/source/custom/niswitch_service.custom.cpp @@ -8,11 +8,11 @@ ::grpc::Status NiSwitchService::ConvertApiErrorStatusForViSession(google::protob ViStatus error_code {}; std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->GetError(vi, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. description.assign(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nisync_service.custom.cpp b/source/custom/nisync_service.custom.cpp index aed31a159..9044caf87 100644 --- a/source/custom/nisync_service.custom.cpp +++ b/source/custom/nisync_service.custom.cpp @@ -41,7 +41,7 @@ ::grpc::Status NiSyncService::ConvertApiErrorStatusForViSession(google::protobuf { static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 256, "ErrorMessage expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->ErrorMessage(vi, status, description.data()); + library_->ErrorMessage(vi, status, &description[0]); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nitclk_service.custom.cpp b/source/custom/nitclk_service.custom.cpp index da1695420..0b625be33 100644 --- a/source/custom/nitclk_service.custom.cpp +++ b/source/custom/nitclk_service.custom.cpp @@ -47,7 +47,7 @@ ::grpc::Status NiTClkService::GetAttributeViString(::grpc::ServerContext* contex ::grpc::Status NiTClkService::ConvertApiErrorStatusForViSession(google::protobuf::int32 status, ViSession session_number) { std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetExtendedErrorInfo(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetExtendedErrorInfo(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nixnet_service.custom.cpp b/source/custom/nixnet_service.custom.cpp index 56ce74164..2a25a07ad 100644 --- a/source/custom/nixnet_service.custom.cpp +++ b/source/custom/nixnet_service.custom.cpp @@ -1189,7 +1189,7 @@ ::grpc::Status NiXnetService::ConvertApiErrorStatusForNxSessionRef_t(google::pro { static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 2048, "StatusToString expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } @@ -1197,7 +1197,7 @@ ::grpc::Status NiXnetService::ConvertApiErrorStatusForNxDatabaseRef_t(google::pr { static_assert(nidevice_grpc::kMaxGrpcErrorDescriptionSize >= 2048, "StatusToString expects a minimum buffer size."); std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, description.data()); + library_->StatusToString(status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/custom/nixnetsocket_service.custom.cpp b/source/custom/nixnetsocket_service.custom.cpp index 2801855e3..ff9e3e2fc 100644 --- a/source/custom/nixnetsocket_service.custom.cpp +++ b/source/custom/nixnetsocket_service.custom.cpp @@ -6,7 +6,7 @@ ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxSOCKET(google::pro { // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetLastErrorStr(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetLastErrorStr(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } @@ -14,7 +14,7 @@ ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxIpStackRef_t(googl { // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); - library_->GetLastErrorStr(description.data(), nidevice_grpc::kMaxGrpcErrorDescriptionSize); + library_->GetLastErrorStr(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/tests/system/nidaqmx_driver_api_tests.cpp b/source/tests/system/nidaqmx_driver_api_tests.cpp index cc8bddc51..ed3fed160 100644 --- a/source/tests/system/nidaqmx_driver_api_tests.cpp +++ b/source/tests/system/nidaqmx_driver_api_tests.cpp @@ -1,6 +1,7 @@ #include #include #include // For EXPECT matchers. +#include #include #include @@ -12,6 +13,7 @@ #include "enumerate_devices.h" #include "nidaqmx/nidaqmx_client.h" +using namespace ::nlohmann; using namespace ::testing; using namespace nidaqmx_grpc; using google::protobuf::uint32; @@ -719,17 +721,16 @@ class NiDAQmxDriverApiTests : public Test { EXPECT_EQ(::grpc::Status::OK.error_code(), status.error_code()); } - template - void EXPECT_DAQ_ERROR(int32_t expected_error, const TResponse& response) + void EXPECT_DAQ_ERROR(int32_t expected_error, const std::string& error_message) { - EXPECT_EQ(expected_error, response.status()); + auto error = json::parse(error_message); + EXPECT_EQ(expected_error, error.value("code", 0)); } - template - void EXPECT_DAQ_ERROR(int32_t expected_error, const ::grpc::Status& status, const TResponse& response) + void EXPECT_DAQ_ERROR(int32_t expected_error, const ::grpc::Status& status) { - EXPECT_DAQ_ERROR(expected_error, response); - EXPECT_EQ(::grpc::Status::OK.error_code(), status.error_code()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + EXPECT_DAQ_ERROR(expected_error, status.error_message()); } template @@ -1000,12 +1001,16 @@ TEST_F(NiDAQmxDriverApiTests, GetScaledUnitsAsDouble_Fails) ScaleStringAttribute::SCALE_ATTRIBUTE_SCALED_UNITS, UNITS); - auto response = client::get_scale_attribute_double( + try { + client::get_scale_attribute_double( stub(), SCALE_NAME, (ScaleDoubleAttribute)ScaleStringAttribute::SCALE_ATTRIBUTE_SCALED_UNITS); - - EXPECT_DAQ_ERROR(SPECIFIED_ATTRIBUTE_NOT_VALID_ERROR, response); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_DAQ_ERROR(SPECIFIED_ATTRIBUTE_NOT_VALID_ERROR, ex.what()); + } } TEST_F(NiDAQmxDriverApiTests, SetScaledUnits_GetScaledUnits_ReturnsAttribute) @@ -1078,10 +1083,10 @@ TEST_F(NiDAQmxDriverApiTests, AOVoltageChannel_WriteAODataWithOutOfRangeValue_Re auto write_data = generate_random_data(AO_MIN, AO_MAX, 100); write_data[80] += AO_MAX; WriteAnalogF64Response write_response; - write_analog_f64(write_data, write_response); + auto status = write_analog_f64(write_data, write_response); stop_task(); - EXPECT_EQ(INVALID_AO_DATA_WRITE_ERROR, write_response.status()); + EXPECT_DAQ_ERROR(INVALID_AO_DATA_WRITE_ERROR, status); } TEST_F(NiDAQmxDriverApiTests, TaskWithAOChannel_GetNthTaskDevice_ReturnsDeviceForChannel) @@ -1368,7 +1373,7 @@ TEST_F(NiDAQmxDriverApiTests, AIVoltageChannel_WaitForValidTimestamp_ReturnsErro auto response = WaitForValidTimestampResponse{}; auto status = wait_for_valid_timestamp(response); - EXPECT_DAQ_ERROR(WAIT_FOR_VALID_TIMESTAMP_NOT_SUPPORTED_ERROR, status, response); + EXPECT_DAQ_ERROR(WAIT_FOR_VALID_TIMESTAMP_NOT_SUPPORTED_ERROR, status); } TEST_F(NiDAQmxDriverApiTests, AIVoltageChannel_CfgTimeStartTrig_ReturnsError) @@ -1378,7 +1383,7 @@ TEST_F(NiDAQmxDriverApiTests, AIVoltageChannel_CfgTimeStartTrig_ReturnsError) auto response = CfgTimeStartTrigResponse{}; auto status = cfg_time_start_trig(response); - EXPECT_DAQ_ERROR(INVALID_ATTRIBUTE_VALUE_ERROR, status, response); + EXPECT_DAQ_ERROR(INVALID_ATTRIBUTE_VALUE_ERROR, status); } TEST_F(NiDAQmxDriverApiTests, LoadedVoltageTask_ReadAIData_ReturnsDataInExpectedRange) @@ -1415,14 +1420,18 @@ TEST_F(NiDAQmxDriverApiTests, AddNetworkDeviceWithInvalidIP_ErrorRetrievingNetwo auto response = AddNetworkDeviceResponse{}; auto status = add_network_device("0.0.0.0", response); - EXPECT_DAQ_ERROR(RETRIEVING_NETWORK_DEVICE_PROPERTIES_ERROR, status, response); + EXPECT_DAQ_ERROR(RETRIEVING_NETWORK_DEVICE_PROPERTIES_ERROR, status); } TEST_F(NiDAQmxDriverApiTests, ConfigureTEDSOnNonTEDSChannel_ErrorTEDSSensorNotDetected) { - auto response = client::configure_teds(stub(), AI_CHANNEL, ""); - - EXPECT_DAQ_ERROR(TEDS_SENSOR_NOT_DETECTED_ERROR, response); + try { + client::configure_teds(stub(), AI_CHANNEL, ""); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_DAQ_ERROR(TEDS_SENSOR_NOT_DETECTED_ERROR, ex.what()); + } } TEST_F(NiDAQmxDriverApiTests, HardwareTimedTask_WaitForNextSampleClock_Succeeds) @@ -1451,7 +1460,7 @@ TEST_F(NiDAQmxDriverApiTests, ConnectBogusTerms_FailsWithInvalidRoutingError) auto response = ConnectTermsResponse{}; auto status = connect_terms("ABC", "123", response); - EXPECT_DAQ_ERROR(INVALID_TERM_ROUTING_ERROR, status, response); + EXPECT_DAQ_ERROR(INVALID_TERM_ROUTING_ERROR, status); } TEST_F(NiDAQmxDriverApiTests, DOWatchdogTask_StartTaskAndWatchdogTask_Succeeds) @@ -1479,9 +1488,13 @@ TEST_F(NiDAQmxDriverApiTests, DOWatchdogTask_StartTaskAndWatchdogTask_Succeeds) TEST_F(NiDAQmxDriverApiTests, AutoConfigureCDAQSyncConnections_ReturnsNotSupportedError) { - auto response = client::auto_configure_cdaq_sync_connections(stub(), DEVICE_NAME, 1.0); - - EXPECT_DAQ_ERROR(DEVICE_DOES_NOT_SUPPORT_CDAQ_SYNC_CONNECTIONS_ERROR, response); + try { + client::auto_configure_cdaq_sync_connections(stub(), DEVICE_NAME, 1.0); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_DAQ_ERROR(DEVICE_DOES_NOT_SUPPORT_CDAQ_SYNC_CONNECTIONS_ERROR, ex.what()); + } } TEST_F(NiDAQmxDriverApiTests, DIChannel_GetSetResetInputBufferSize_UpdatesBufferSize) @@ -1698,16 +1711,24 @@ TEST_F(NiDAQmxDriverApiTests, AIChannel_ReconfigureSampQuantSampsPerChan_Updates TEST_F(NiDAQmxDriverApiTests, SetWrongCategoryAttribute_ReturnsNotValidError) { - auto response = client::get_device_attribute_bool(stub(), DEVICE_NAME, ScaleDoubleAttribute::SCALE_ATTRIBUTE_LIN_SLOPE); - - EXPECT_DAQ_ERROR(SPECIFIED_ATTRIBUTE_NOT_VALID_ERROR, response); + try { + client::get_device_attribute_bool(stub(), DEVICE_NAME, ScaleDoubleAttribute::SCALE_ATTRIBUTE_LIN_SLOPE); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_DAQ_ERROR(SPECIFIED_ATTRIBUTE_NOT_VALID_ERROR, ex.what()); + } } TEST_F(NiDAQmxDriverApiTests, SetWrongDataTypeAttribute_ReturnsNotValidError) { - auto response = client::get_device_attribute_bool(stub(), DEVICE_NAME, DeviceStringAttribute::DEVICE_ATTRIBUTE_AO_PHYSICAL_CHANS); - - EXPECT_DAQ_ERROR(SPECIFIED_ATTRIBUTE_NOT_VALID_ERROR, response); + try { + client::get_device_attribute_bool(stub(), DEVICE_NAME, DeviceStringAttribute::DEVICE_ATTRIBUTE_AO_PHYSICAL_CHANS); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_DAQ_ERROR(SPECIFIED_ATTRIBUTE_NOT_VALID_ERROR, ex.what()); + } } } // namespace diff --git a/source/tests/system/nidcpower_session_tests.cpp b/source/tests/system/nidcpower_session_tests.cpp index e844bfb02..b4bdd0064 100644 --- a/source/tests/system/nidcpower_session_tests.cpp +++ b/source/tests/system/nidcpower_session_tests.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "device_server.h" #include "nidcpower/nidcpower_client.h" @@ -9,6 +10,7 @@ namespace tests { namespace system { namespace dcpower = nidcpower_grpc; +using namespace ::nlohmann; using namespace ::testing; const int kInvalidRsrc = -1074118656; @@ -120,10 +122,10 @@ TEST_F(NiDCPowerSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) dcpower::InitializeWithChannelsResponse response; ::grpc::Status status = call_initialize_with_channels(kTestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiDCPowerSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -155,19 +157,21 @@ TEST_F(NiDCPowerSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionEr dcpower::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidDCPowerSession, response.status()); - std::string error_message = get_error_message(response.status()); - EXPECT_THAT(error_message.c_str(), HasSubstr(kInvalidDCPowerSessionMessage)); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidDCPowerSession, error.value("code", 0)); + EXPECT_THAT(error.value("message", "").c_str(), HasSubstr(kInvalidDCPowerSessionMessage)); } TEST_F(NiDCPowerSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { dcpower::InitializeWithChannelsResponse initialize_response; - call_initialize_with_channels(kTestInvalidRsrc, "", "", &initialize_response); + auto status = call_initialize_with_channels(kTestInvalidRsrc, "", "", &initialize_response); - EXPECT_EQ(kInvalidRsrc, initialize_response.status()); - EXPECT_STREQ(kViErrorResourceNotFoundMessage, initialize_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); + EXPECT_STREQ(kViErrorResourceNotFoundMessage, error.value("message", "").c_str()); } } // namespace system diff --git a/source/tests/system/nidigital_session_tests.cpp b/source/tests/system/nidigital_session_tests.cpp index d947bd1cf..4837716ab 100644 --- a/source/tests/system/nidigital_session_tests.cpp +++ b/source/tests/system/nidigital_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nidigitalpattern/nidigitalpattern_client.h" @@ -8,6 +9,7 @@ namespace tests { namespace system { namespace digital = nidigitalpattern_grpc; +using namespace ::nlohmann; const int kDigitalRsrcNotFound = -1074098043; const char* kDigitalRsrcNotFoundMessage = "Specified string is not valid, because it is empty."; @@ -85,10 +87,10 @@ TEST_F(NiDigitalSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) digital::InitWithOptionsResponse response; ::grpc::Status status = call_init_with_options(kDigitalInvalidResourceName, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kDigitalRsrcNotFound, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kDigitalRsrcNotFound, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiDigitalSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -110,10 +112,12 @@ TEST_F(NiDigitalSessionTest, InitializedSession_CloseSession_ClosesDriverSession TEST_F(NiDigitalSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { digital::InitWithOptionsResponse init_response; - call_init_with_options(kDigitalInvalidResourceName, "", "", &init_response); + auto status = call_init_with_options(kDigitalInvalidResourceName, "", "", &init_response); - EXPECT_EQ(kDigitalRsrcNotFound, init_response.status()); - EXPECT_STREQ(kDigitalRsrcNotFoundMessage, init_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kDigitalRsrcNotFound, error.value("code", 0)); + EXPECT_STREQ(kDigitalRsrcNotFoundMessage, error.value("message", "").c_str()); } } // namespace system diff --git a/source/tests/system/nidmm_session_tests.cpp b/source/tests/system/nidmm_session_tests.cpp index a6dfe1a17..54964efac 100644 --- a/source/tests/system/nidmm_session_tests.cpp +++ b/source/tests/system/nidmm_session_tests.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "device_server.h" #include "nidmm/nidmm_client.h" @@ -10,6 +11,7 @@ namespace tests { namespace system { namespace dmm = nidmm_grpc; +using namespace ::nlohmann; using namespace ::testing; const int kViErrorDmmRsrcNFound = -1074118656; @@ -106,10 +108,10 @@ TEST_F(NiDmmSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) dmm::InitWithOptionsResponse response; ::grpc::Status status = call_init_with_options(kInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kViErrorDmmRsrcNFound, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kViErrorDmmRsrcNFound, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiDmmSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -139,19 +141,21 @@ TEST_F(NiDmmSessionTest, InvalidSession_CloseSession_ReturnsInvalidSesssionError dmm::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidDmmSession, response.status()); - std::string error_message = get_error_message(response.status()); - EXPECT_THAT(error_message.c_str(), HasSubstr(kInvalidDmmSessionMessage)); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidDmmSession, error.value("code", 0)); + EXPECT_THAT(error.value("message", "").c_str(), HasSubstr(kInvalidDmmSessionMessage)); } TEST_F(NiDmmSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { dmm::InitWithOptionsResponse init_response; - call_init_with_options(kInvalidRsrc, "", "", &init_response); + auto status = call_init_with_options(kInvalidRsrc, "", "", &init_response); - EXPECT_EQ(kViErrorDmmRsrcNFound, init_response.status()); - EXPECT_STREQ(kViErrorDmmRsrcNFoundMessage, init_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kViErrorDmmRsrcNFound, error.value("code", 0)); + EXPECT_STREQ(kViErrorDmmRsrcNFoundMessage, error.value("message", "").c_str()); } } // namespace system diff --git a/source/tests/system/nifgen_session_tests.cpp b/source/tests/system/nifgen_session_tests.cpp index bb19d674f..a0809c91d 100644 --- a/source/tests/system/nifgen_session_tests.cpp +++ b/source/tests/system/nifgen_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nifgen/nifgen_client.h" @@ -8,6 +9,7 @@ namespace tests { namespace system { namespace fgen = nifgen_grpc; +using namespace ::nlohmann; const int kInvalidFgenRsrc = -1074134944; const int kInvalidFgenSession = -1074130544; @@ -104,10 +106,10 @@ TEST_F(NiFgenSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) fgen::InitWithOptionsResponse response; ::grpc::Status status = call_init_with_options(kTestInvalidFgenRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidFgenRsrc, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidFgenRsrc, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiFgenSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -141,15 +143,22 @@ TEST_F(NiFgenSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError EXPECT_EQ(kInvalidFgenSession, response.status()); std::string error_message = get_error_message(response.status()); EXPECT_STREQ(kInvalidFgenSessionMessage, error_message.c_str()); + + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidFgenSession, error.value("code", 0)); + EXPECT_STREQ(kInvalidFgenSessionMessage, error.value("message", "").c_str()); } TEST_F(NiFgenSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { fgen::InitWithOptionsResponse initialize_response; - call_init_with_options(kTestInvalidFgenRsrc, "", "", &initialize_response); + auto status = call_init_with_options(kTestInvalidFgenRsrc, "", "", &initialize_response); - EXPECT_EQ(kInvalidFgenRsrc, initialize_response.status()); - EXPECT_STREQ(kViErrorFgenResourceNotFoundMessage, initialize_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidFgenRsrc, error.value("code", 0)); + EXPECT_STREQ(kViErrorFgenResourceNotFoundMessage, error.value("message", "").c_str()); } } // namespace system diff --git a/source/tests/system/nirfmxbluetooth_driver_api_tests.cpp b/source/tests/system/nirfmxbluetooth_driver_api_tests.cpp index 128573afb..91daa3fea 100644 --- a/source/tests/system/nirfmxbluetooth_driver_api_tests.cpp +++ b/source/tests/system/nirfmxbluetooth_driver_api_tests.cpp @@ -7,6 +7,7 @@ #include "rfmx_macros.h" #include "waveform_helpers.h" +using namespace ::nlohmann; using namespace ::testing; using namespace nirfmxbluetooth_grpc; namespace client = nirfmxbluetooth_grpc::experimental::client; diff --git a/source/tests/system/nirfmxbluetooth_session_tests.cpp b/source/tests/system/nirfmxbluetooth_session_tests.cpp index a59d92191..d64098b0d 100644 --- a/source/tests/system/nirfmxbluetooth_session_tests.cpp +++ b/source/tests/system/nirfmxbluetooth_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nirfmxbluetooth/nirfmxbluetooth_client.h" @@ -9,6 +10,7 @@ namespace system { namespace { namespace rfmxbluetooth = nirfmxbluetooth_grpc; +using namespace ::nlohmann; const int kInvalidRsrc = -200220; const int kInvalidRFmxBTSession = -380598; @@ -87,9 +89,9 @@ TEST_F(NiRFmxBluetoothSessionTest, InitializeSessionWithoutDevice_ReturnsDriverE rfmxbluetooth::InitializeResponse response; ::grpc::Status status = call_initialize(kRFmxBTTestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.instrument().id()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); } TEST_F(NiRFmxBluetoothSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -151,10 +153,11 @@ TEST_F(NiRFmxBluetoothSessionTest, CallInitializeTwiceWithSameSessionNameOnSameD EXPECT_TRUE(status_one.ok()); EXPECT_EQ(0, close_response_one.status()); - EXPECT_TRUE(status_two.ok()); // Initialize was only called once in the driver since the second init call to the service found the Session by the same name and returned it. // Therefore if we try to close the session again the driver will respond that it's not a valid session (it's already been closed). - EXPECT_EQ(kInvalidRFmxBTSession, close_response_two.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status_two.error_code()); + auto error = json::parse(status_two.error_message()); + EXPECT_EQ(kInvalidRFmxBTSession, error.value("code", 0)); } TEST_F(NiRFmxBluetoothSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError) @@ -169,8 +172,9 @@ TEST_F(NiRFmxBluetoothSessionTest, InvalidSession_CloseSession_ReturnsInvalidSes rfmxbluetooth::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRFmxBTSession, response.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRFmxBTSession, error.value("code", 0)); } } // namespace diff --git a/source/tests/system/nirfmxlte_session_tests.cpp b/source/tests/system/nirfmxlte_session_tests.cpp index f3e88719a..725d399cf 100644 --- a/source/tests/system/nirfmxlte_session_tests.cpp +++ b/source/tests/system/nirfmxlte_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nirfmxlte/nirfmxlte_client.h" @@ -9,6 +10,7 @@ namespace system { namespace { namespace rfmxlte = nirfmxlte_grpc; +using namespace ::nlohmann; const int kInvalidRsrc = -200220; const int kInvalidRFmxLTESession = -380598; @@ -87,9 +89,9 @@ TEST_F(NiRFmxLTESessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) rfmxlte::InitializeResponse response; ::grpc::Status status = call_initialize(kRFmxLTETestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.instrument().id()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); } TEST_F(NiRFmxLTESessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -151,10 +153,11 @@ TEST_F(NiRFmxLTESessionTest, CallInitializeTwiceWithSameSessionNameOnSameDevice_ EXPECT_TRUE(status_one.ok()); EXPECT_EQ(0, close_response_one.status()); - EXPECT_TRUE(status_two.ok()); // Initialize was only called once in the driver since the second init call to the service found the Session by the same name and returned it. // Therefore if we try to close the session again the driver will respond that it's not a valid session (it's already been closed). - EXPECT_EQ(kInvalidRFmxLTESession, close_response_two.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status_two.error_code()); + auto error = json::parse(status_two.error_message()); + EXPECT_EQ(kInvalidRFmxLTESession, error.value("code", 0)); } TEST_F(NiRFmxLTESessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError) @@ -169,8 +172,9 @@ TEST_F(NiRFmxLTESessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionEr rfmxlte::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRFmxLTESession, response.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRFmxLTESession, error.value("code", 0)); } } // namespace diff --git a/source/tests/system/nirfmxnr_driver_api_tests.cpp b/source/tests/system/nirfmxnr_driver_api_tests.cpp index e3b588cbc..9bf2b226a 100644 --- a/source/tests/system/nirfmxnr_driver_api_tests.cpp +++ b/source/tests/system/nirfmxnr_driver_api_tests.cpp @@ -155,8 +155,7 @@ TEST_F(NiRFmxNRDriverApiTests, AcpNonContiguousMultiCarrierFromExample_FetchData EXPECT_SUCCESS(session, client::set_attribute_f64(stub(), session, carrier_string_response.selector_string_out(), NIRFMXNR_ATTRIBUTE_COMPONENT_CARRIER_FREQUENCY, componentCarrierFrequency[i][j])); } } - auto auto_level_response = client::auto_level(stub(), session, "", 10.0e-3); - EXPECT_ERROR(IVI_INVALID_VALUE_ERROR, IVI_INVALID_VALUE_ERROR_STR, session, auto_level_response); + EXPECT_ERROR(IVI_INVALID_VALUE_ERROR, IVI_INVALID_VALUE_ERROR_STR, session, client::auto_level(stub(), session, "", 10.0e-3)); EXPECT_SUCCESS(session, client::select_measurements(stub(), session, "", MEASUREMENT_TYPES_ACP, true)); EXPECT_SUCCESS(session, client::acp_cfg_measurement_method(stub(), session, "", ACP_MEASUREMENT_METHOD_NORMAL)); EXPECT_SUCCESS(session, client::acp_cfg_noise_compensation_enabled(stub(), session, "", ACP_NOISE_COMPENSATION_ENABLED_FALSE)); @@ -172,7 +171,6 @@ TEST_F(NiRFmxNRDriverApiTests, AcpNonContiguousMultiCarrierFromExample_FetchData fetch_measurement_responses[i] = EXPECT_SUCCESS(session, client::acp_fetch_offset_measurement(stub(), session, subblock_string_response.selector_string_out(), 10.0)); } - EXPECT_EQ(0.0, auto_level_response.reference_level()); EXPECT_LT(0.0, fetch_subblock_responses[0].subblock_power()); EXPECT_LT(0.0, fetch_subblock_responses[0].integration_bandwidth()); EXPECT_LT(0.0, fetch_subblock_responses[0].frequency()); diff --git a/source/tests/system/nirfmxnr_session_tests.cpp b/source/tests/system/nirfmxnr_session_tests.cpp index 94a5cba6f..6569816cc 100644 --- a/source/tests/system/nirfmxnr_session_tests.cpp +++ b/source/tests/system/nirfmxnr_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nirfmxnr/nirfmxnr_client.h" @@ -9,6 +10,7 @@ namespace system { namespace { namespace rfmxnr = nirfmxnr_grpc; +using namespace ::nlohmann; const int kInvalidRsrc = -200220; const int kInvalidRFmxNRSession = -380598; @@ -87,9 +89,9 @@ TEST_F(NiRFmxNRSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) rfmxnr::InitializeResponse response; ::grpc::Status status = call_initialize(kRFmxNRTestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.instrument().id()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); } TEST_F(NiRFmxNRSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -151,10 +153,11 @@ TEST_F(NiRFmxNRSessionTest, CallInitializeTwiceWithSameSessionNameOnSameDevice_C EXPECT_TRUE(status_one.ok()); EXPECT_EQ(0, close_response_one.status()); - EXPECT_TRUE(status_two.ok()); // Initialize was only called once in the driver since the second init call to the service found the Session by the same name and returned it. // Therefore if we try to close the session again the driver will respond that it's not a valid session (it's already been closed). - EXPECT_EQ(kInvalidRFmxNRSession, close_response_two.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status_two.error_code()); + auto error = json::parse(status_two.error_message()); + EXPECT_EQ(kInvalidRFmxNRSession, error.value("code", 0)); } TEST_F(NiRFmxNRSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError) @@ -169,8 +172,9 @@ TEST_F(NiRFmxNRSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionErr rfmxnr::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRFmxNRSession, response.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRFmxNRSession, error.value("code", 0)); } } // namespace diff --git a/source/tests/system/nirfmxspecan_driver_api_tests.cpp b/source/tests/system/nirfmxspecan_driver_api_tests.cpp index 3a99912f6..eb8402e0d 100644 --- a/source/tests/system/nirfmxspecan_driver_api_tests.cpp +++ b/source/tests/system/nirfmxspecan_driver_api_tests.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -14,6 +15,7 @@ using namespace nirfmxspecan_grpc; namespace client = nirfmxspecan_grpc::experimental::client; namespace instr_client = nirfmxinstr_grpc::experimental::client; namespace pb = google::protobuf; +using nlohmann::json; using namespace ::testing; namespace ni { @@ -61,8 +63,16 @@ class NiRFmxSpecAnDriverApiTests : public ::testing::Test { bool is_driver_session_valid(const instr_client::StubPtr& stub, const nidevice_grpc::Session& session) { - auto response = instr_client::get_attribute_string(stub, session, "", nirfmxinstr_grpc::NiRFmxInstrAttribute::NIRFMXINSTR_ATTRIBUTE_INSTRUMENT_MODEL); - return response.status() != INVALID_SESSION_HANDLE_ERROR; + try { + auto response = instr_client::get_attribute_string(stub, session, "", nirfmxinstr_grpc::NiRFmxInstrAttribute::NIRFMXINSTR_ATTRIBUTE_INSTRUMENT_MODEL); + EXPECT_EQ(0, response.status()); + return true; + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_EQ(INVALID_SESSION_HANDLE_ERROR, error.value("code", 0)); + return false; + } } void config_dpd_reference_waveform(const nidevice_grpc::Session& session) @@ -639,9 +649,13 @@ TEST_P(NiRFmxSpecAnDriverApiConflictingResourceInitTests, InitializeResource_Ini const auto session1 = init_session(stub(), PXI_5663, std::get<0>(GetParam())); EXPECT_VALID_DRIVER_SESSION(session1); - const auto second_init_response = init(stub(), PXI_5663, std::get<1>(GetParam())); - - EXPECT_RESPONSE_ERROR(DEVICE_IN_USE_ERROR, second_init_response); + try { + init(stub(), PXI_5663, std::get<1>(GetParam())); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_STATUS_ERROR(DEVICE_IN_USE_ERROR, ex.what()); + } } TEST_P(NiRFmxSpecAnDriverApiConflictingResourceInitTests, InitializeAndCloseResource_InitializeResourceThatWouldHaveConflicted_Succeeds) diff --git a/source/tests/system/nirfmxspecan_session_tests.cpp b/source/tests/system/nirfmxspecan_session_tests.cpp index f84e64abe..b6884332c 100644 --- a/source/tests/system/nirfmxspecan_session_tests.cpp +++ b/source/tests/system/nirfmxspecan_session_tests.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "device_server.h" #include "nirfmxspecan/nirfmxspecan_client.h" @@ -9,6 +10,7 @@ namespace tests { namespace system { namespace rfmxspecan = nirfmxspecan_grpc; +using namespace ::nlohmann; using ::testing::IsEmpty; const int kInvalidRsrc = -200220; @@ -77,9 +79,9 @@ TEST_F(NiRFmxSpecAnSessionTest, InitializeSessionWithoutDevice_ReturnsDriverErro rfmxspecan::InitializeResponse response; ::grpc::Status status = call_initialize(kRFmxSpecAnTestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.instrument().id()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); } TEST_F(NiRFmxSpecAnSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -105,22 +107,27 @@ TEST_F(NiRFmxSpecAnSessionTest, InitializedSession_CloseSession_ClosesDriverSess TEST_F(NiRFmxSpecAnSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { rfmxspecan::InitializeResponse init_response; - call_initialize(kRFmxSpecAnTestInvalidRsrc, "", "", &init_response); - EXPECT_EQ(kInvalidRsrc, init_response.status()); + auto status = call_initialize(kRFmxSpecAnTestInvalidRsrc, "", "", &init_response); - nidevice_grpc::Session session = init_response.instrument(); - EXPECT_EQ(std::string(kRFmxSpecAnErrorResourceNotFoundMessage), init_response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); + EXPECT_STREQ(kRFmxSpecAnErrorResourceNotFoundMessage, error.value("message", "").c_str()); } TEST_F(NiRFmxSpecAnSessionTest, InitWithErrorFromDriver_ReinitSuccessfully_ErrorMessageIsEmpty) { rfmxspecan::InitializeResponse failed_init_response; - call_initialize(kRFmxSpecAnTestInvalidRsrc, "", "", &failed_init_response); + auto status_one = call_initialize(kRFmxSpecAnTestInvalidRsrc, "", "", &failed_init_response); rfmxspecan::InitializeResponse successful_init_response; - call_initialize(kRFmxSpecAnTestRsrc, kRFmxSpecAnOptionsString, kRFmxSpecAnTestSession, &successful_init_response); + auto status_two = call_initialize(kRFmxSpecAnTestRsrc, kRFmxSpecAnOptionsString, kRFmxSpecAnTestSession, &successful_init_response); - EXPECT_EQ(std::string(kRFmxSpecAnErrorResourceNotFoundMessage), failed_init_response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status_one.error_code()); + auto error = json::parse(status_one.error_message()); + EXPECT_STREQ(kRFmxSpecAnErrorResourceNotFoundMessage, error.value("message", "").c_str()); + EXPECT_EQ(::grpc::StatusCode::OK, status_two.error_code()); + EXPECT_THAT(status_two.error_message(), IsEmpty()); EXPECT_THAT(successful_init_response.error_message(), IsEmpty()); } @@ -136,8 +143,9 @@ TEST_F(NiRFmxSpecAnSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessio rfmxspecan::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRFmxSpecAnSession, response.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRFmxSpecAnSession, error.value("code", 0)); } } // namespace system diff --git a/source/tests/system/nirfmxwlan_session_tests.cpp b/source/tests/system/nirfmxwlan_session_tests.cpp index 3a46fda9a..ac33edd53 100644 --- a/source/tests/system/nirfmxwlan_session_tests.cpp +++ b/source/tests/system/nirfmxwlan_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nirfmxwlan/nirfmxwlan_client.h" @@ -9,6 +10,7 @@ namespace system { namespace { namespace rfmxwlan = nirfmxwlan_grpc; +using namespace ::nlohmann; const int kInvalidRsrc = -200220; const int kInvalidRFmxWLANSession = -380598; @@ -87,9 +89,9 @@ TEST_F(NiRFmxWLANSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) rfmxwlan::InitializeResponse response; ::grpc::Status status = call_initialize(kRFmxWLANTestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.instrument().id()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); } TEST_F(NiRFmxWLANSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -144,8 +146,9 @@ TEST_F(NiRFmxWLANSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionE rfmxwlan::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRFmxWLANSession, response.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRFmxWLANSession, error.value("code", 0)); } TEST_F(NiRFmxWLANSessionTest, CallInitializeTwiceWithSameSessionNameOnSameDevice_CloseSessionTwice_SecondCloseReturnsInvalidSessionError) @@ -167,10 +170,11 @@ TEST_F(NiRFmxWLANSessionTest, CallInitializeTwiceWithSameSessionNameOnSameDevice EXPECT_TRUE(status_one.ok()); EXPECT_EQ(0, close_response_one.status()); - EXPECT_TRUE(status_two.ok()); // Initialize was only called once in the driver since the second init call to the service found the Session by the same name and returned it. // Therefore if we try to close the session again the driver will respond that it's not a valid session (it's already been closed). - EXPECT_EQ(kInvalidRFmxWLANSession, close_response_two.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status_two.error_code()); + auto error = json::parse(status_two.error_message()); + EXPECT_EQ(kInvalidRFmxWLANSession, error.value("code", 0)); } } // namespace diff --git a/source/tests/system/nirfsa_driver_api_tests.cpp b/source/tests/system/nirfsa_driver_api_tests.cpp index c72504f04..6361a3c30 100644 --- a/source/tests/system/nirfsa_driver_api_tests.cpp +++ b/source/tests/system/nirfsa_driver_api_tests.cpp @@ -1,5 +1,6 @@ #include #include // For EXPECT matchers. +#include #include @@ -9,6 +10,7 @@ #include "niscope/niscope_client.h" #include "nitclk/nitclk_client.h" +using namespace ::nlohmann; using namespace ::testing; using namespace nirfsa_grpc; namespace client = nirfsa_grpc::experimental::client; @@ -32,12 +34,6 @@ void EXPECT_SUCCESS(const TResponse& response) EXPECT_EQ(0, response.status()); } -template -void EXPECT_RFSA_ERROR(pb::int32 expected_error, const TResponse& response) -{ - EXPECT_EQ(expected_error, response.status()); -} - class NiRFSADriverApiTests : public Test { protected: NiRFSADriverApiTests() @@ -87,12 +83,17 @@ class NiRFSADriverApiTests : public Test { check_error(session); } - template - void EXPECT_RFSA_ERROR(pb::int32 expected_error, const std::string& message_substring, const nidevice_grpc::Session& session, const TResponse& response) + std::string EXPECT_RFSA_ERROR(int32_t expected_error, const std::string& error_message) + { + auto error = json::parse(error_message); + EXPECT_EQ(expected_error, error.value("code", 0)); + return error.value("message", ""); + } + + void EXPECT_RFSA_ERROR(pb::int32 expected_error, const std::string& message_substring, const char* error_message, const nidevice_grpc::Session& session) { - ni::tests::system::EXPECT_RFSA_ERROR(expected_error, response); - const auto error = client::get_error(stub(), session); - EXPECT_THAT(error.error_description(), HasSubstr(message_substring)); + auto message = EXPECT_RFSA_ERROR(expected_error, error_message); + EXPECT_THAT(message, HasSubstr(message_substring)); clear_error(session); } @@ -128,10 +129,14 @@ TEST_F(NiRFSADriverApiTests, Init_Close_Succeeds) TEST_F(NiRFSADriverApiTests, InitWithErrorFromDriver_ReturnsUserErrorMessage) { - auto initialize_response = client::init_with_options(stub(), "", false, false, ""); - - EXPECT_EQ(-200220, initialize_response.status()); - EXPECT_STREQ("Device identifier is invalid.", initialize_response.error_message().c_str()); + try { + client::init_with_options(stub(), "", false, false, ""); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto message = EXPECT_RFSA_ERROR(-200220, ex.what()); + EXPECT_STREQ("Device identifier is invalid.", message.c_str()); + } } MATCHER(IsNonDefaultComplexArray, "") @@ -498,14 +503,19 @@ TEST_F(NiRFSADriverApiTests, CreateConfigurationListWithInvalidAttribute_Reports { const auto LIST_NAME = "MyList"; auto session = init_session(stub(), PXI_5663E); - auto response = client::create_configuration_list( + + try { + client::create_configuration_list( stub(), session, LIST_NAME, {NiRFSAAttribute::NIRFSA_ATTRIBUTE_EXTERNAL_GAIN, NiRFSAAttribute::NIRFSA_ATTRIBUTE_NOTCH_FILTER_ENABLED}, true); - - EXPECT_RFSA_ERROR(IVI_ATTRIBUTE_NOT_SUPPORTED_ERROR, "Attribute or property not supported.", session, response); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + EXPECT_RFSA_ERROR(IVI_ATTRIBUTE_NOT_SUPPORTED_ERROR, "Attribute or property not supported.", ex.what(), session); + } } TEST_F(NiRFSADriverApiTests, GetScalingCoefficients_ReturnsCoefficients) diff --git a/source/tests/system/nirfsg_session_tests.cpp b/source/tests/system/nirfsg_session_tests.cpp index dfa15e2b0..bc9d59bf1 100644 --- a/source/tests/system/nirfsg_session_tests.cpp +++ b/source/tests/system/nirfsg_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "nirfsg/nirfsg_client.h" @@ -8,6 +9,7 @@ namespace tests { namespace system { namespace rfsg = nirfsg_grpc; +using namespace ::nlohmann; const int kInvalidRsrc = -200220; const int kInvalidRFSGSession = -1074130544; @@ -91,10 +93,10 @@ TEST_F(NiRFSGSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) rfsg::InitWithOptionsResponse response; ::grpc::Status status = call_init_with_options(kRFSGTestInvalidRsrc, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRsrc, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiRFSGSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -116,10 +118,12 @@ TEST_F(NiRFSGSessionTest, InitializedSession_CloseSession_ClosesDriverSession) TEST_F(NiRFSGSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { rfsg::InitWithOptionsResponse init_response; - call_init_with_options(kRFSGTestInvalidRsrc, "", "", &init_response); + auto status = call_init_with_options(kRFSGTestInvalidRsrc, "", "", &init_response); - EXPECT_EQ(kInvalidRsrc, init_response.status()); - EXPECT_STREQ(kRFSGErrorResourceNotFoundMessage, init_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRsrc, error.value("code", 0)); + EXPECT_STREQ(kRFSGErrorResourceNotFoundMessage, error.value("message", "").c_str()); } TEST_F(NiRFSGSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError) @@ -133,8 +137,9 @@ TEST_F(NiRFSGSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError rfsg::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidRFSGSession, response.status()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidRFSGSession, error.value("code", 0)); } } // namespace system diff --git a/source/tests/system/niscope_session_tests.cpp b/source/tests/system/niscope_session_tests.cpp index 721465bc2..f03fcf087 100644 --- a/source/tests/system/niscope_session_tests.cpp +++ b/source/tests/system/niscope_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "niscope/niscope_client.h" @@ -8,6 +9,7 @@ namespace tests { namespace system { namespace scope = niscope_grpc; +using namespace ::nlohmann; const int kViErrorRsrcNFound = -1073807343; const int kInvalidScopeSession = -1074130544; @@ -97,10 +99,10 @@ TEST_F(NiScopeSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) scope::InitWithOptionsResponse response; ::grpc::Status status = call_init_with_options(kInvalidResourceName, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kViErrorRsrcNFound, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kViErrorRsrcNFound, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiScopeSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -130,19 +132,21 @@ TEST_F(NiScopeSessionTest, InvalidSession_CloseSession_ReturnsInvalidSesssionErr scope::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidScopeSession, response.status()); - std::string error_message = get_error_message(response.status()); - EXPECT_STREQ(kInvalidScopeSessionMessage, error_message.c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidScopeSession, error.value("code", 0)); + EXPECT_STREQ(kInvalidScopeSessionMessage, error.value("message", "").c_str()); } TEST_F(NiScopeSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { scope::InitWithOptionsResponse init_response; - call_init_with_options(kInvalidResourceName, "", "", &init_response); + auto status = call_init_with_options(kInvalidResourceName, "", "", &init_response); - EXPECT_EQ(kViErrorRsrcNFound, init_response.status()); - EXPECT_STREQ(kViErrorRsrcNFoundMessage, init_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kViErrorRsrcNFound, error.value("code", 0)); + EXPECT_STREQ(kViErrorRsrcNFoundMessage, error.value("message", "").c_str()); } } // namespace system diff --git a/source/tests/system/niswitch_session_tests.cpp b/source/tests/system/niswitch_session_tests.cpp index e73ddc09f..5f4d383aa 100644 --- a/source/tests/system/niswitch_session_tests.cpp +++ b/source/tests/system/niswitch_session_tests.cpp @@ -1,4 +1,5 @@ #include +#include #include "device_server.h" #include "niswitch/niswitch_client.h" @@ -8,6 +9,7 @@ namespace tests { namespace system { namespace niswitch = niswitch_grpc; +using namespace ::nlohmann; const int kViErrorRsrcNotFound = -1074118654; const int kInvalidSwitchSession = -1074130544; @@ -97,10 +99,10 @@ TEST_F(NiSwitchSessionTest, InitializeSessionWithoutDevice_ReturnsDriverError) niswitch::InitWithTopologyResponse response; ::grpc::Status status = call_init_with_topology(kInvalidRsrcName, "", "", &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kViErrorRsrcNotFound, response.status()); - EXPECT_EQ(0, response.vi().id()); - EXPECT_NE("", response.error_message()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kViErrorRsrcNotFound, error.value("code", 0)); + EXPECT_NE("", error.value("message", "")); } TEST_F(NiSwitchSessionTest, InitializedSession_CloseSession_ClosesDriverSession) @@ -130,19 +132,21 @@ TEST_F(NiSwitchSessionTest, InvalidSession_CloseSession_ReturnsInvalidSesssionEr niswitch::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidSwitchSession, response.status()); - std::string error_message = get_error_message(response.status()); - EXPECT_STREQ(kInvalidSwitchSessionMessage, error_message.c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kInvalidSwitchSession, error.value("code", 0)); + EXPECT_STREQ(kInvalidSwitchSessionMessage, error.value("message", "").c_str()); } TEST_F(NiSwitchSessionTest, InitWithErrorFromDriver_ReturnsUserErrorMessage) { niswitch::InitWithTopologyResponse init_response; - call_init_with_topology(kInvalidRsrcName, "", "", &init_response); + auto status = call_init_with_topology(kInvalidRsrcName, "", "", &init_response); - EXPECT_EQ(kViErrorRsrcNotFound, init_response.status()); - EXPECT_STREQ(kViErrorRsrcNotFoundMessage, init_response.error_message().c_str()); + EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); + auto error = json::parse(status.error_message()); + EXPECT_EQ(kViErrorRsrcNotFound, error.value("code", 0)); + EXPECT_STREQ(kViErrorRsrcNotFoundMessage, error.value("message", "").c_str()); } } // namespace system diff --git a/source/tests/system/rfmx_macros.h b/source/tests/system/rfmx_macros.h index d300988b3..b7571dbe5 100644 --- a/source/tests/system/rfmx_macros.h +++ b/source/tests/system/rfmx_macros.h @@ -3,6 +3,7 @@ #include #include +#include #define EXPECT_NO_ERROR_MESSAGE(session, response) \ if (1) { \ @@ -31,10 +32,11 @@ EXPECT_EQ(expected_warning, (response).status()); \ } -#define EXPECT_RESPONSE_ERROR(expected_error, response) \ - if (1) { \ - EXPECT_LT(expected_error, 0); \ - EXPECT_EQ(expected_error, (response).status()); \ +#define EXPECT_STATUS_ERROR(expected_error, error_message) \ + if (1) { \ + EXPECT_LT(expected_error, 0); \ + auto error = nlohmann::json::parse(error_message); \ + EXPECT_EQ(expected_error, error.value("code", 0)); \ } #define EXPECT_SUCCESS(session_, response_) \ @@ -44,12 +46,15 @@ return response; \ })((session_), (response_)) -#define EXPECT_ERROR(expected_error_, message_substring_, session_, response_) \ - ([this](auto expected_error, const auto& message_substring, auto& session, auto& response) { \ - EXPECT_RESPONSE_ERROR(expected_error, response) \ - EXPECT_ERROR_SUBSTRING(message_substring, session); \ - return response; \ - })(expected_error_, message_substring_, session_, response_) +#define EXPECT_ERROR(expected_error_, message_substring_, session_, response_call_) \ + try { \ + response_call_; \ + EXPECT_FALSE(true); \ + } \ + catch (const std::runtime_error& ex) { \ + EXPECT_STATUS_ERROR(expected_error_, ex.what()); \ + EXPECT_ERROR_SUBSTRING(message_substring_, session_); \ + } #define EXPECT_WARNING(expected_warning_, message_substring_, session_, response_) \ ([this](auto expected_warning, const auto& message_substring, auto& session, auto& response) { \ From f4e602128df338cf34fc4901e4f226bf7c848137 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Tue, 9 Aug 2022 17:08:20 -0500 Subject: [PATCH 08/11] Ensure proper json encoding. Lower string length limit to 2K. --- source/custom/nirfmxspecan_service.custom.cpp | 7 +++---- source/server/converters.h | 7 ++++--- source/tests/unit/ni_fake_non_ivi_service_tests.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/custom/nirfmxspecan_service.custom.cpp b/source/custom/nirfmxspecan_service.custom.cpp index 00bc3193f..16abe8f58 100644 --- a/source/custom/nirfmxspecan_service.custom.cpp +++ b/source/custom/nirfmxspecan_service.custom.cpp @@ -4,14 +4,13 @@ namespace nirfmxspecan_grpc { ::grpc::Status NiRFmxSpecAnService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) { - const ViInt32 buffer_size = 4096; ViStatus error_code {}; - std::string description(buffer_size, '\0'); + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); // Try first to get the most recent error with a dynamic message. - library_->GetError(instrumentHandle, &error_code, buffer_size, &description[0]); + library_->GetError(instrumentHandle, &error_code, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); if (error_code != status) { // Since another thread has changed the status, fall back to the static message lookup. - library_->GetErrorString(instrumentHandle, status, buffer_size, &description[0]); + library_->GetErrorString(instrumentHandle, status, nidevice_grpc::kMaxGrpcErrorDescriptionSize, &description[0]); } return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); } diff --git a/source/server/converters.h b/source/server/converters.h index 693b9904d..a74c4a633 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -5,6 +5,7 @@ #include #include #include // For common grpc types. +#include #include // For common C types. #include @@ -319,7 +320,7 @@ typename TypeToStorageType::StorageType allocate_output_ } // namespace converters -const int kMaxGrpcErrorDescriptionSize = 4096; +const int kMaxGrpcErrorDescriptionSize = 2048; inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 status, std::string& description) { @@ -330,8 +331,8 @@ inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 sta for (size_t index = 0; (index = description.find('"', index)) != std::string::npos; index += 2) { description.replace(index, 1, "\\\""); } - std::string errorMessage = "{ \"code\":" + std::to_string(status) + ", \"message\":\"" + description + "\" }"; - return ::grpc::Status(grpc::StatusCode::UNKNOWN, errorMessage); + nlohmann::json jsonError{{"code", status}, {"message", description}}; + return ::grpc::Status(grpc::StatusCode::UNKNOWN, nlohmann::to_string(jsonError)); } } // namespace nidevice_grpc diff --git a/source/tests/unit/ni_fake_non_ivi_service_tests.cpp b/source/tests/unit/ni_fake_non_ivi_service_tests.cpp index f3f142663..e433b02b7 100644 --- a/source/tests/unit/ni_fake_non_ivi_service_tests.cpp +++ b/source/tests/unit/ni_fake_non_ivi_service_tests.cpp @@ -1756,7 +1756,7 @@ TEST_F(NiFakeNonIviServiceTests, InitWithError_CallsGetLatestErrorAndReturnsMess const auto ERROR_MESSAGE_BUFFER_SIZE = static_cast(ERROR_MESSAGE.size() + 1); EXPECT_CALL(library_, Init(_, _)) .WillOnce(Return(SOME_ERROR)); - EXPECT_CALL(library_, GetLatestErrorMessage(_, 4096)) + EXPECT_CALL(library_, GetLatestErrorMessage(_, 2048)) .WillOnce( DoAll( SetArrayArgument<0>(ERROR_MESSAGE.c_str(), ERROR_MESSAGE.c_str() + ERROR_MESSAGE_BUFFER_SIZE), From 3f8560c8eb295ea37bd61e7e6faa01d67fb82b81 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Tue, 9 Aug 2022 18:40:10 -0500 Subject: [PATCH 09/11] Fix integration tests build. --- CMakeLists.txt | 3 ++- source/server/converters.h | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b5311589..ca9ae0cb8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -371,7 +371,8 @@ target_link_libraries(IntegrationTestsRunner gmock ${_GRPC_GRPCPP} ${CMAKE_DL_LIBS} - Threads::Threads) + Threads::Threads + nlohmann_json::nlohmann_json) add_library(TestApi SHARED "source/tests/utilities/test_api.cpp") diff --git a/source/server/converters.h b/source/server/converters.h index a74c4a633..f55f77067 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -325,12 +325,6 @@ const int kMaxGrpcErrorDescriptionSize = 2048; inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 status, std::string& description) { converters::trim_trailing_nulls(description); - // TODO: AB#2103383: Ensure description strings are properly JSON encoded. - // Alex: grpc-device already uses nlohmann::json to parse the config file. - // Brad: If you don't want to add a dependency on a full-fledged JSON parser, consider the encodeAndStrcpy function from jsonz. - for (size_t index = 0; (index = description.find('"', index)) != std::string::npos; index += 2) { - description.replace(index, 1, "\\\""); - } nlohmann::json jsonError{{"code", status}, {"message", description}}; return ::grpc::Status(grpc::StatusCode::UNKNOWN, nlohmann::to_string(jsonError)); } From ae3b2975a38be667493dbf3894456e5e9e6059a0 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Wed, 10 Aug 2022 16:35:15 -0500 Subject: [PATCH 10/11] Fixing tests --- source/custom/nixnetsocket_service.custom.cpp | 10 +- source/server/converters.h | 14 ++- source/tests/system/nifgen_session_tests.cpp | 5 - .../system/nirfmxlte_driver_api_tests.cpp | 43 ++++--- .../system/nirfmxspecan_driver_api_tests.cpp | 3 +- .../tests/system/niswitch_session_tests.cpp | 2 +- .../system/nixnetsocket_driver_api_tests.cpp | 107 ++++++++++++------ source/tests/system/rfmx_macros.h | 10 +- 8 files changed, 127 insertions(+), 67 deletions(-) diff --git a/source/custom/nixnetsocket_service.custom.cpp b/source/custom/nixnetsocket_service.custom.cpp index ff9e3e2fc..93a085302 100644 --- a/source/custom/nixnetsocket_service.custom.cpp +++ b/source/custom/nixnetsocket_service.custom.cpp @@ -7,7 +7,10 @@ ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxSOCKET(google::pro // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetLastErrorStr(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); - return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); + // XNET sockets have special behavior that returns both the API error code and the sockets error number. + int errorNumber = library_->GetLastErrorNum(); + nlohmann::json jsonError{{"errorNumber", errorNumber}}; + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description, jsonError); } ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxIpStackRef_t(google::protobuf::int32 status, nxIpStackRef_t socket) @@ -15,7 +18,10 @@ ::grpc::Status NiXnetSocketService::ConvertApiErrorStatusForNxIpStackRef_t(googl // This implementation assumes this method is always called on the same thread where the error occurred. std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); library_->GetLastErrorStr(&description[0], nidevice_grpc::kMaxGrpcErrorDescriptionSize); - return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); + // XNET sockets have special behavior that returns both the API error code and the sockets error number. + int errorNumber = library_->GetLastErrorNum(); + nlohmann::json jsonError{{"errorNumber", errorNumber}}; + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description, jsonError); } } // namespace nixnetsocket_grpc diff --git a/source/server/converters.h b/source/server/converters.h index f55f77067..eb9a46585 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -322,11 +322,17 @@ typename TypeToStorageType::StorageType allocate_output_ const int kMaxGrpcErrorDescriptionSize = 2048; -inline ::grpc::Status ApiErrorAndDescriptionToStatus(google::protobuf::int32 status, std::string& description) +inline ::grpc::Status ApiErrorAndDescriptionToStatus(int32_t status, std::string& description, nlohmann::json& jsonError) { - converters::trim_trailing_nulls(description); - nlohmann::json jsonError{{"code", status}, {"message", description}}; - return ::grpc::Status(grpc::StatusCode::UNKNOWN, nlohmann::to_string(jsonError)); + converters::trim_trailing_nulls(description); + jsonError["code"] = status; + jsonError["message"] = description; + return ::grpc::Status(grpc::StatusCode::UNKNOWN, nlohmann::to_string(jsonError)); +} + +inline ::grpc::Status ApiErrorAndDescriptionToStatus(int32_t status, std::string& description) +{ + return ApiErrorAndDescriptionToStatus(status, description, nlohmann::json()); } } // namespace nidevice_grpc diff --git a/source/tests/system/nifgen_session_tests.cpp b/source/tests/system/nifgen_session_tests.cpp index a0809c91d..91ceed9c9 100644 --- a/source/tests/system/nifgen_session_tests.cpp +++ b/source/tests/system/nifgen_session_tests.cpp @@ -139,11 +139,6 @@ TEST_F(NiFgenSessionTest, InvalidSession_CloseSession_ReturnsInvalidSessionError fgen::CloseResponse response; ::grpc::Status status = GetStub()->Close(&context, request, &response); - EXPECT_TRUE(status.ok()); - EXPECT_EQ(kInvalidFgenSession, response.status()); - std::string error_message = get_error_message(response.status()); - EXPECT_STREQ(kInvalidFgenSessionMessage, error_message.c_str()); - EXPECT_EQ(::grpc::StatusCode::UNKNOWN, status.error_code()); auto error = json::parse(status.error_message()); EXPECT_EQ(kInvalidFgenSession, error.value("code", 0)); diff --git a/source/tests/system/nirfmxlte_driver_api_tests.cpp b/source/tests/system/nirfmxlte_driver_api_tests.cpp index 1f20ab3d8..8c7672656 100644 --- a/source/tests/system/nirfmxlte_driver_api_tests.cpp +++ b/source/tests/system/nirfmxlte_driver_api_tests.cpp @@ -1,10 +1,12 @@ #include +#include #include "device_server.h" #include "nirfmxlte/nirfmxlte_client.h" #include "nirfsa/nirfsa_client.h" #include "rfmx_macros.h" +using namespace ::nlohmann; using namespace ::testing; using namespace nirfmxlte_grpc; namespace client = nirfmxlte_grpc::experimental::client; @@ -341,7 +343,7 @@ TEST_F(NiRFmxLTEDriverApiTests, NBIoTModAccFromExample_FetchData_DataLooksReason { nidevice_grpc::Session session; ModAccFetchCompositeEVMResponse mod_acc_fetch_composite_evm_response; - int attempts = 1; + int actualStatus = -1, attempts = 1; while (1) { session = init_session(stub(), PXI_5663E); EXPECT_SUCCESS(session, client::cfg_frequency_reference(stub(), session, "", FREQUENCY_REFERENCE_SOURCE_ONBOARD_CLOCK, 10e6)); @@ -359,8 +361,15 @@ TEST_F(NiRFmxLTEDriverApiTests, NBIoTModAccFromExample_FetchData_DataLooksReason EXPECT_SUCCESS(session, client::initiate(stub(), session, "", "")); // Intermittently fails with: "Autodetected NPUSCH channel parameters are not 3GPP spec compliant." - mod_acc_fetch_composite_evm_response = client::mod_acc_fetch_composite_evm(stub(), session, "", 10.0); - if (mod_acc_fetch_composite_evm_response.status() == MODACC_NB_IOT_AUTODETECT_CHECK && attempts < 5) { + try { + mod_acc_fetch_composite_evm_response = client::mod_acc_fetch_composite_evm(stub(), session, "", 10.0); + actualStatus = mod_acc_fetch_composite_evm_response.status(); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + actualStatus = error.value("code", -1); + } + if (actualStatus == MODACC_NB_IOT_AUTODETECT_CHECK && attempts < 5) { TearDown(); SetUp(); ++attempts; @@ -369,10 +378,9 @@ TEST_F(NiRFmxLTEDriverApiTests, NBIoTModAccFromExample_FetchData_DataLooksReason break; } } - EXPECT_SUCCESS(session, mod_acc_fetch_composite_evm_response); - if (mod_acc_fetch_composite_evm_response.status() < 0) { - return; - } + // If this fails, we want the test to be over now. + ASSERT_GE(actualStatus, 0); + const auto mod_acc_fetch_iq_impairments_response = EXPECT_SUCCESS(session, client::mod_acc_fetch_iq_impairments(stub(), session, "", 10.0)); const auto mod_acc_fetch_in_band_emission_margin_response = EXPECT_SUCCESS(session, client::mod_acc_fetch_in_band_emission_margin(stub(), session, "", 10.0)); const auto mod_acc_fetch_npusch_constellation_trace_response = EXPECT_SUCCESS(session, client::mod_acc_fetch_npusch_constellation_trace(stub(), session, "", 10.0)); @@ -407,7 +415,7 @@ TEST_F(NiRFmxLTEDriverApiTests, NBIoTModAccAcpChpObwSemCompositeSingleCarrierFro { nidevice_grpc::Session session; ModAccFetchCompositeEVMResponse mod_acc_fetch_composite_evm_response; - int attempts = 1; + int actualStatus = -1, attempts = 1; while (1) { session = init_session(stub(), PXI_5663E); EXPECT_SUCCESS(session, client::cfg_frequency_reference(stub(), session, "", FREQUENCY_REFERENCE_SOURCE_ONBOARD_CLOCK, 10e6)); @@ -433,8 +441,15 @@ TEST_F(NiRFmxLTEDriverApiTests, NBIoTModAccAcpChpObwSemCompositeSingleCarrierFro EXPECT_SUCCESS(session, client::initiate(stub(), session, "", "")); // Intermittently fails with: "Autodetected NPUSCH channel parameters are not 3GPP spec compliant." - mod_acc_fetch_composite_evm_response = client::mod_acc_fetch_composite_evm(stub(), session, "", 10.0); - if (mod_acc_fetch_composite_evm_response.status() == MODACC_NB_IOT_AUTODETECT_CHECK && attempts < 5) { + try { + mod_acc_fetch_composite_evm_response = client::mod_acc_fetch_composite_evm(stub(), session, "", 10.0); + actualStatus = mod_acc_fetch_composite_evm_response.status(); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + actualStatus = error.value("code", -1); + } + if (actualStatus == MODACC_NB_IOT_AUTODETECT_CHECK && attempts < 5) { TearDown(); SetUp(); ++attempts; @@ -443,10 +458,9 @@ TEST_F(NiRFmxLTEDriverApiTests, NBIoTModAccAcpChpObwSemCompositeSingleCarrierFro break; } } - EXPECT_SUCCESS(session, mod_acc_fetch_composite_evm_response); - if (mod_acc_fetch_composite_evm_response.status() < 0) { - return; - } + // If this fails, we want the test to be over now. + ASSERT_GE(actualStatus, 0); + const auto mod_acc_fetch_iq_impairments_response = EXPECT_SUCCESS(session, client::mod_acc_fetch_iq_impairments(stub(), session, "", 10.0)); const auto mod_acc_fetch_in_band_emission_margin_response = EXPECT_SUCCESS(session, client::mod_acc_fetch_in_band_emission_margin(stub(), session, "", 10.0)); const auto acp_fetch_offset_measurement_array_response = EXPECT_SUCCESS(session, client::acp_fetch_offset_measurement_array(stub(), session, "", 10.0)); @@ -1098,7 +1112,6 @@ TEST_F(NiRFmxLTEDriverApiTests, ULModAccSingleCarrierFromExample_FetchData_DataL EXPECT_SUCCESS(session, client::initiate(stub(), session, "", "")); // Intermittently gives "374603: Unable to synchronize." and outputs nan values - mod_acc_fetch_composite_evm_response = client::mod_acc_fetch_composite_evm(stub(), session, "", 10.0); if (mod_acc_fetch_composite_evm_response.status() == SYNC_FAILURE_WARNING && attempts < 5) { TearDown(); SetUp(); diff --git a/source/tests/system/nirfmxspecan_driver_api_tests.cpp b/source/tests/system/nirfmxspecan_driver_api_tests.cpp index eb8402e0d..4aca5c0bd 100644 --- a/source/tests/system/nirfmxspecan_driver_api_tests.cpp +++ b/source/tests/system/nirfmxspecan_driver_api_tests.cpp @@ -70,8 +70,7 @@ class NiRFmxSpecAnDriverApiTests : public ::testing::Test { } catch (const std::runtime_error& ex) { auto error = json::parse(ex.what()); - EXPECT_EQ(INVALID_SESSION_HANDLE_ERROR, error.value("code", 0)); - return false; + return error.value("code", 0) != INVALID_SESSION_HANDLE_ERROR; } } diff --git a/source/tests/system/niswitch_session_tests.cpp b/source/tests/system/niswitch_session_tests.cpp index 5f4d383aa..9dabe1440 100644 --- a/source/tests/system/niswitch_session_tests.cpp +++ b/source/tests/system/niswitch_session_tests.cpp @@ -14,7 +14,7 @@ using namespace ::nlohmann; const int kViErrorRsrcNotFound = -1074118654; const int kInvalidSwitchSession = -1074130544; const char* kViErrorRsrcNotFoundMessage = "Invalid resource name.\n\nInvalid Identifier: InvalidName"; -const char* kInvalidSwitchSessionMessage = "The session handle is not valid."; +const char* kInvalidSwitchSessionMessage = "IVI: The session handle is not valid."; const char* kTestRsrcName = ""; const char* kTestSessName = "SessionName"; const char* kInvalidRsrcName = "InvalidName"; diff --git a/source/tests/system/nixnetsocket_driver_api_tests.cpp b/source/tests/system/nixnetsocket_driver_api_tests.cpp index 52046a909..e741228d2 100644 --- a/source/tests/system/nixnetsocket_driver_api_tests.cpp +++ b/source/tests/system/nixnetsocket_driver_api_tests.cpp @@ -235,6 +235,12 @@ class NiXnetSocketNoHardwareTests : public NiXnetSocketDriverApiTests { EXPECT_EQ(error, (response).status()); \ } +#define EXPECT_XNET_ERROR_CODE(expected, error) \ + EXPECT_EQ(expected, error.value("code", 0)); + +#define EXPECT_XNET_ERROR_NUMBER(expected, error) \ + EXPECT_EQ(expected, error.value("errorNumber", 0)); + #define EXPECT_XNET_ERROR(expected_status, error, message, response) \ if (1) { \ EXPECT_EQ(expected_status, (response).status()); \ @@ -280,36 +286,47 @@ SocketResponse socket(client::StubPtr& stub) TEST_F(NiXnetSocketNoHardwareTests, InitWithInvalidIpStack_Close_ReturnsAndSetsExpectedErrors) { - auto socket_response = socket(stub()); - - auto close_response = client::close(stub(), socket_response.socket()); + SocketResponse invalid_socket; + invalid_socket.mutable_socket()->set_id(static_cast(INVALID_XNET_SOCKET)); - EXPECT_XNET_STATUS(GENERIC_NXSOCKET_ERROR, socket_response); - EXPECT_EQ(INVALID_IP_STACK_ERROR, socket_response.error_num()); - EXPECT_THAT(socket_response.error_message(), HasSubstr(INVALID_IP_STACK_MESSAGE)); - EXPECT_XNET_STATUS(GENERIC_NXSOCKET_ERROR, close_response); - EXPECT_EQ(INVALID_SOCKET_ERROR, close_response.error_num()); - EXPECT_THAT(close_response.error_message(), HasSubstr(INVALID_SOCKET_MESSAGE)); + try { + client::close(stub(), invalid_socket.socket()); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_XNET_ERROR_CODE(GENERIC_NXSOCKET_ERROR, error); + EXPECT_XNET_ERROR_NUMBER(INVALID_SOCKET_ERROR, error); + EXPECT_THAT(error.value("message", ""), HasSubstr(INVALID_SOCKET_MESSAGE)); + } } TEST_F(NiXnetSocketNoHardwareTests, InitWithInvalidIpStack_Bind_ReturnsAndSetsExpectedErrors) { + SocketResponse invalid_socket; + invalid_socket.mutable_socket()->set_id(static_cast(INVALID_XNET_SOCKET)); auto sock_addr = SockAddr{}; sock_addr.mutable_ipv4()->mutable_addr()->set_addr(0x7F000001); sock_addr.mutable_ipv4()->set_port(31764); - auto socket_response = socket(stub()); - auto bind_response = client::bind(stub(), socket_response.socket(), sock_addr); - EXPECT_XNET_STATUS(GENERIC_NXSOCKET_ERROR, socket_response); - EXPECT_XNET_STATUS(GENERIC_NXSOCKET_ERROR, bind_response); - EXPECT_EQ(INVALID_SOCKET_ERROR, bind_response.error_num()); - EXPECT_THAT(bind_response.error_message(), HasSubstr(INVALID_SOCKET_MESSAGE)); + try { + client::bind(stub(), invalid_socket.socket(), sock_addr); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_XNET_ERROR_CODE(GENERIC_NXSOCKET_ERROR, error); + EXPECT_XNET_ERROR_NUMBER(INVALID_SOCKET_ERROR, error); + EXPECT_THAT(error.value("message", ""), HasSubstr(INVALID_SOCKET_MESSAGE)); + } } TEST_F(NiXnetSocketNoHardwareTests, SocketAndEmptySet_IsSet_ReturnsFalse) { - auto socket_response = socket(stub()); - auto is_set_response = client::fd_is_set(stub(), socket_response.socket(), {}); + SocketResponse invalid_socket; + invalid_socket.mutable_socket()->set_id(static_cast(INVALID_XNET_SOCKET)); + + auto is_set_response = client::fd_is_set(stub(), invalid_socket.socket(), {}); EXPECT_SUCCESS(is_set_response); EXPECT_EQ(NXSOCKET_FALSE, is_set_response.is_set()); @@ -317,8 +334,10 @@ TEST_F(NiXnetSocketNoHardwareTests, SocketAndEmptySet_IsSet_ReturnsFalse) TEST_F(NiXnetSocketNoHardwareTests, SocketAndSetContainingSocket_IsSet_ReturnsTrue) { - auto socket_response = socket(stub()); - auto is_set_response = client::fd_is_set(stub(), socket_response.socket(), {socket_response.socket()}); + SocketResponse invalid_socket; + invalid_socket.mutable_socket()->set_id(static_cast(INVALID_XNET_SOCKET)); + + auto is_set_response = client::fd_is_set(stub(), invalid_socket.socket(), {invalid_socket.socket()}); EXPECT_SUCCESS(is_set_response); EXPECT_EQ(NXSOCKET_TRUE, is_set_response.is_set()); @@ -326,33 +345,52 @@ TEST_F(NiXnetSocketNoHardwareTests, SocketAndSetContainingSocket_IsSet_ReturnsTr TEST_F(NiXnetSocketNoHardwareTests, InvalidSocket_Select_ReturnsAndSetsExpectedErrors) { - auto socket_response = socket(stub()); + SocketResponse invalid_socket; + invalid_socket.mutable_socket()->set_id(static_cast(INVALID_XNET_SOCKET)); auto duration = pb::Duration{}; duration.set_seconds(1); duration.set_nanos(500000); - auto select_response = client::select(stub(), {socket_response.socket()}, {socket_response.socket()}, {}, duration); - EXPECT_XNET_STATUS(GENERIC_NXSOCKET_ERROR, select_response); - EXPECT_EQ(INVALID_SOCKET_ERROR, select_response.error_num()); - EXPECT_THAT(select_response.error_message(), HasSubstr(INVALID_SOCKET_MESSAGE)); + try { + client::select(stub(), {invalid_socket.socket()}, {invalid_socket.socket()}, {}, duration); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_XNET_ERROR_CODE(GENERIC_NXSOCKET_ERROR, error); + EXPECT_XNET_ERROR_NUMBER(INVALID_SOCKET_ERROR, error); + EXPECT_THAT(error.value("message", ""), HasSubstr(INVALID_SOCKET_MESSAGE)); + } } TEST_F(NiXnetSocketNoHardwareTests, InvalidEmptyConfigJson_IpStackCreate_ReturnsInvalidInterfaceNameError) { constexpr auto TEST_CONFIG = "{}"; constexpr auto JSON_OBJECT_MISSING_VALUE = -13017; - const auto stack_response = client::ip_stack_create(stub(), "", "{}"); - EXPECT_XNET_STATUS(JSON_OBJECT_MISSING_VALUE, stack_response); + try { + client::ip_stack_create(stub(), "", "{}"); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_XNET_ERROR_CODE(JSON_OBJECT_MISSING_VALUE, error); + } } TEST_F(NiXnetSocketNoHardwareTests, ValidConfigJsonForMissingDevice_IpStackCreate_ReturnsInvalidInterfaceNameError) { const auto TEST_CONFIG = create_simple_config("ENET6"); constexpr auto INVALID_INTERFACE_NAME = -1074384758; - const auto stack_response = client::ip_stack_create(stub(), "", TEST_CONFIG); - EXPECT_XNET_STATUS(INVALID_INTERFACE_NAME, stack_response); + try { + client::ip_stack_create(stub(), "", TEST_CONFIG); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_XNET_ERROR_CODE(INVALID_INTERFACE_NAME, error); + } } TEST_F(NiXnetSocketNoHardwareTests, StackAlreadyExistsError_StrErrR_ReturnsExpectedMessage) @@ -369,10 +407,15 @@ TEST_F(NiXnetSocketNoHardwareTests, StackAlreadyExistsError_StrErrRWithZeroBuffe { constexpr auto STACK_ALREADY_EXISTS = static_cast(0xFFFFCD24); - const auto str_err = client::str_err_r(stub(), STACK_ALREADY_EXISTS, 0); - - EXPECT_XNET_STATUS(GENERIC_NXSOCKET_ERROR, str_err); - EXPECT_EQ("", str_err.error()); + try { + client::str_err_r(stub(), STACK_ALREADY_EXISTS, 0); + EXPECT_FALSE(true); + } + catch (const std::runtime_error& ex) { + auto error = json::parse(ex.what()); + EXPECT_XNET_ERROR_CODE(GENERIC_NXSOCKET_ERROR, error); + EXPECT_EQ(std::string(), error.value("message", "default")); + } } TEST_F(NiXnetSocketLoopbackTests, IPv4LocalhostAddress_AToNAndPToNRoundtrip_ReturnsCorrectAddr) diff --git a/source/tests/system/rfmx_macros.h b/source/tests/system/rfmx_macros.h index b7571dbe5..96d37b56f 100644 --- a/source/tests/system/rfmx_macros.h +++ b/source/tests/system/rfmx_macros.h @@ -33,11 +33,9 @@ } #define EXPECT_STATUS_ERROR(expected_error, error_message) \ - if (1) { \ - EXPECT_LT(expected_error, 0); \ - auto error = nlohmann::json::parse(error_message); \ - EXPECT_EQ(expected_error, error.value("code", 0)); \ - } + EXPECT_LT(expected_error, 0); \ + auto error = nlohmann::json::parse(error_message); \ + EXPECT_EQ(expected_error, error.value("code", 0)); #define EXPECT_SUCCESS(session_, response_) \ ([this](auto& session, auto& response) { \ @@ -53,7 +51,7 @@ } \ catch (const std::runtime_error& ex) { \ EXPECT_STATUS_ERROR(expected_error_, ex.what()); \ - EXPECT_ERROR_SUBSTRING(message_substring_, session_); \ + EXPECT_THAT(error.value("message", ""), HasSubstr(message_substring_)); \ } #define EXPECT_WARNING(expected_warning_, message_substring_, session_, response_) \ From c708c93fb77aea4552d6628848d0f92976d88f62 Mon Sep 17 00:00:00 2001 From: Dan Mondrik Date: Wed, 10 Aug 2022 18:05:52 -0500 Subject: [PATCH 11/11] Fixing the build --- .../nirfmxinstr_restricted_service.cpp | 365 ++++++++++-------- .../nirfmxinstr_restricted_service.h | 1 + .../nirfmxinstr_restricted_service.custom.cpp | 12 +- ...nirfmxspecan_restricted_service.custom.cpp | 2 +- source/server/converters.h | 3 +- 5 files changed, 217 insertions(+), 166 deletions(-) diff --git a/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.cpp b/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.cpp index 2dce0cee7..2e5572009 100644 --- a/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.cpp +++ b/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.cpp @@ -54,6 +54,9 @@ namespace nirfmxinstr_restricted_grpc { try { char* resource_name = (char*)request->resource_name().c_str(); auto status = library_->RegisterSpecialClientSnapshotInterest(resource_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -74,9 +77,8 @@ namespace nirfmxinstr_restricted_grpc { while (true) { auto status = library_->GetOpenSessionsInformation(resource_name, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } int32 info_json_size = status; @@ -89,11 +91,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_info_json(info_json); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info_json())); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); } + response->set_status(status); + response->set_info_json(info_json); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_info_json())); return ::grpc::Status::OK; } } @@ -115,9 +118,8 @@ namespace nirfmxinstr_restricted_grpc { while (true) { auto status = library_->GetRFmxVersion(instrument, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -130,11 +132,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_version(version); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_version())); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_version(version); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_version())); return ::grpc::Status::OK; } } @@ -156,10 +159,11 @@ namespace nirfmxinstr_restricted_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 all_traces_enabled {}; auto status = library_->GetTracesInfoForMonitorSnapshot(instrument, selector_string, &all_traces_enabled); - response->set_status(status); - if (status_ok(status)) { - response->set_all_traces_enabled(all_traces_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_all_traces_enabled(all_traces_enabled); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -180,10 +184,11 @@ namespace nirfmxinstr_restricted_grpc { char* channel_name = (char*)request->channel_name().c_str(); int32 attr_val {}; auto status = library_->GetForceAllTracesEnabled(instrument, channel_name, &attr_val); - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -204,6 +209,9 @@ namespace nirfmxinstr_restricted_grpc { char* channel_name = (char*)request->channel_name().c_str(); int32 attr_val = request->attr_val(); auto status = library_->SetForceAllTracesEnabled(instrument, channel_name, attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -226,9 +234,8 @@ namespace nirfmxinstr_restricted_grpc { int32 actual_array_size {}; while (true) { auto status = library_->SaveConfigurationsToJSON(instrument, signal_names, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string json_string_out; if (actual_array_size > 0) { @@ -240,12 +247,13 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_json_string_out(json_string_out); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_json_string_out())); - response->set_actual_array_size(actual_array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_json_string_out(json_string_out); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_json_string_out())); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -267,6 +275,9 @@ namespace nirfmxinstr_restricted_grpc { char* json_string = (char*)request->json_string().c_str(); int32 array_size = request->array_size(); auto status = library_->LoadConfigurationsFromJSON(instrument, json_string, array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -289,10 +300,11 @@ namespace nirfmxinstr_restricted_grpc { int32 attribute_id = request->attribute_id(); float64 attr_val {}; auto status = library_->GetAttributeDesiredF64(instrument, channel_name, attribute_id, &attr_val); - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -314,10 +326,11 @@ namespace nirfmxinstr_restricted_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeDesiredI32(instrument, channel_name, attribute_id, &attr_val); - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -339,10 +352,11 @@ namespace nirfmxinstr_restricted_grpc { int32 attribute_id = request->attribute_id(); int64 attr_val {}; auto status = library_->GetAttributeDesiredI64(instrument, channel_name, attribute_id, &attr_val); - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -365,9 +379,8 @@ namespace nirfmxinstr_restricted_grpc { while (true) { auto status = library_->GetAttributeDesiredString(instrument, channel_name, attribute_id, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -380,11 +393,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_attr_val())); return ::grpc::Status::OK; } } @@ -408,9 +422,8 @@ namespace nirfmxinstr_restricted_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeDesiredF64Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float64* attr_val = response->mutable_attr_val()->mutable_data(); @@ -420,11 +433,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -448,9 +462,8 @@ namespace nirfmxinstr_restricted_grpc { int32 actual_array_size {}; while (true) { auto status = library_->GetAttributeDesiredF32Array(instrument, channel_name, attribute_id, nullptr, 0, &actual_array_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_attr_val()->Resize(actual_array_size, 0); float32* attr_val = response->mutable_attr_val()->mutable_data(); @@ -460,11 +473,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->mutable_attr_val()->Resize(actual_array_size, 0); - response->set_actual_array_size(actual_array_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->mutable_attr_val()->Resize(actual_array_size, 0); + response->set_actual_array_size(actual_array_size); return ::grpc::Status::OK; } } @@ -487,10 +501,11 @@ namespace nirfmxinstr_restricted_grpc { int32 attribute_id = request->attribute_id(); float32 attr_val {}; auto status = library_->GetAttributeDesiredF32(instrument, channel_name, attribute_id, &attr_val); - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -512,10 +527,11 @@ namespace nirfmxinstr_restricted_grpc { int32 attribute_id = request->attribute_id(); int32 attr_val {}; auto status = library_->GetAttributeAuthor(instrument, selector_string, attribute_id, &attr_val); - response->set_status(status); - if (status_ok(status)) { - response->set_attr_val(attr_val); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_attr_val(attr_val); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -536,11 +552,12 @@ namespace nirfmxinstr_restricted_grpc { int32 is_connection_alive {}; int32 privilege_level {}; auto status = library_->GetPrivilegeLevel(instrument, &is_connection_alive, &privilege_level); - response->set_status(status); - if (status_ok(status)) { - response->set_is_connection_alive(is_connection_alive); - response->set_privilege_level(privilege_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_is_connection_alive(is_connection_alive); + response->set_privilege_level(privilege_level); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -560,6 +577,9 @@ namespace nirfmxinstr_restricted_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); int32 privilege_level = request->privilege_level(); auto status = library_->RequestPrivilege(instrument, privilege_level); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -580,6 +600,9 @@ namespace nirfmxinstr_restricted_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* file_path = (char*)request->file_path().c_str(); auto status = library_->SaveAllForRevert(instrument, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -600,6 +623,9 @@ namespace nirfmxinstr_restricted_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); char* file_path = (char*)request->file_path().c_str(); auto status = library_->LoadAllForRevert(instrument, file_path); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -626,9 +652,8 @@ namespace nirfmxinstr_restricted_grpc { int32 snapshot_timestamp_array_actual_size {}; while (true) { auto status = library_->GetInitiaitedSnapshotStrings(instrument, &snapshot_info_cache_index, nullptr, 0, &personality_id_array_actual_size, nullptr, 0, &signal_names_actual_size, nullptr, 0, &result_names_actual_size, nullptr, 0, &snapshot_identifiers_actual_size, nullptr, 0, &snapshot_timestamp_array_actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_personality_id_array()->Resize(personality_id_array_actual_size, 0); int32* personality_id_array = reinterpret_cast(response->mutable_personality_id_array()->mutable_data()); @@ -656,23 +681,24 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_snapshot_info_cache_index(snapshot_info_cache_index); - response->mutable_personality_id_array()->Resize(personality_id_array_actual_size, 0); - response->set_personality_id_array_actual_size(personality_id_array_actual_size); - response->set_signal_names(signal_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); - response->set_signal_names_actual_size(signal_names_actual_size); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_result_names_actual_size(result_names_actual_size); - response->set_snapshot_identifiers(snapshot_identifiers); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_snapshot_identifiers())); - response->set_snapshot_identifiers_actual_size(snapshot_identifiers_actual_size); - response->mutable_snapshot_timestamp_array()->Resize(snapshot_timestamp_array_actual_size, 0); - response->set_snapshot_timestamp_array_actual_size(snapshot_timestamp_array_actual_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_snapshot_info_cache_index(snapshot_info_cache_index); + response->mutable_personality_id_array()->Resize(personality_id_array_actual_size, 0); + response->set_personality_id_array_actual_size(personality_id_array_actual_size); + response->set_signal_names(signal_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); + response->set_signal_names_actual_size(signal_names_actual_size); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_result_names_actual_size(result_names_actual_size); + response->set_snapshot_identifiers(snapshot_identifiers); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_snapshot_identifiers())); + response->set_snapshot_identifiers_actual_size(snapshot_identifiers_actual_size); + response->mutable_snapshot_timestamp_array()->Resize(snapshot_timestamp_array_actual_size, 0); + response->set_snapshot_timestamp_array_actual_size(snapshot_timestamp_array_actual_size); return ::grpc::Status::OK; } } @@ -699,9 +725,8 @@ namespace nirfmxinstr_restricted_grpc { int32 snapshot_timestamp_array_actual_size {}; while (true) { auto status = library_->GetSnapshotInfoFromCache(instrument, snapshot_info_cache_index, nullptr, 0, &personality_id_array_actual_size, nullptr, 0, &signal_names_actual_size, nullptr, 0, &result_names_actual_size, nullptr, 0, &snapshot_identifiers_actual_size, nullptr, 0, &snapshot_timestamp_array_actual_size); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } response->mutable_personality_id_array()->Resize(personality_id_array_actual_size, 0); int32* personality_id_array = reinterpret_cast(response->mutable_personality_id_array()->mutable_data()); @@ -729,22 +754,23 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->mutable_personality_id_array()->Resize(personality_id_array_actual_size, 0); - response->set_personality_id_array_actual_size(personality_id_array_actual_size); - response->set_signal_names(signal_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); - response->set_signal_names_actual_size(signal_names_actual_size); - response->set_result_names(result_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); - response->set_result_names_actual_size(result_names_actual_size); - response->set_snapshot_identifiers(snapshot_identifiers); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_snapshot_identifiers())); - response->set_snapshot_identifiers_actual_size(snapshot_identifiers_actual_size); - response->mutable_snapshot_timestamp_array()->Resize(snapshot_timestamp_array_actual_size, 0); - response->set_snapshot_timestamp_array_actual_size(snapshot_timestamp_array_actual_size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->mutable_personality_id_array()->Resize(personality_id_array_actual_size, 0); + response->set_personality_id_array_actual_size(personality_id_array_actual_size); + response->set_signal_names(signal_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_names())); + response->set_signal_names_actual_size(signal_names_actual_size); + response->set_result_names(result_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_names())); + response->set_result_names_actual_size(result_names_actual_size); + response->set_snapshot_identifiers(snapshot_identifiers); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_snapshot_identifiers())); + response->set_snapshot_identifiers_actual_size(snapshot_identifiers_actual_size); + response->mutable_snapshot_timestamp_array()->Resize(snapshot_timestamp_array_actual_size, 0); + response->set_snapshot_timestamp_array_actual_size(snapshot_timestamp_array_actual_size); return ::grpc::Status::OK; } } @@ -771,9 +797,8 @@ namespace nirfmxinstr_restricted_grpc { uInt64 signal_timestamp {}; while (true) { auto status = library_->GetLatestConfigurationSnapshot(instrument, &snapshot_info_cache_index, &personality_id, nullptr, 0, &signal_name_actual_size, nullptr, 0, &snapshot_identifier_actual_size, &signal_configuration_state, &signal_timestamp); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string signal_name; if (signal_name_actual_size > 0) { @@ -790,19 +815,20 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_snapshot_info_cache_index(snapshot_info_cache_index); - response->set_personality_id(personality_id); - response->set_signal_name(signal_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_name())); - response->set_signal_name_actual_size(signal_name_actual_size); - response->set_snapshot_identifier(snapshot_identifier); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_snapshot_identifier())); - response->set_snapshot_identifier_actual_size(snapshot_identifier_actual_size); - response->set_signal_configuration_state(signal_configuration_state); - response->set_signal_timestamp(signal_timestamp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_snapshot_info_cache_index(snapshot_info_cache_index); + response->set_personality_id(personality_id); + response->set_signal_name(signal_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_signal_name())); + response->set_signal_name_actual_size(signal_name_actual_size); + response->set_snapshot_identifier(snapshot_identifier); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_snapshot_identifier())); + response->set_snapshot_identifier_actual_size(snapshot_identifier_actual_size); + response->set_signal_configuration_state(signal_configuration_state); + response->set_signal_timestamp(signal_timestamp); return ::grpc::Status::OK; } } @@ -825,10 +851,11 @@ namespace nirfmxinstr_restricted_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 snapshot_state {}; auto status = library_->GetSnapshotState(instrument, personality, selector_string, &snapshot_state); - response->set_status(status); - if (status_ok(status)) { - response->set_snapshot_state(snapshot_state); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_snapshot_state(snapshot_state); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -849,6 +876,9 @@ namespace nirfmxinstr_restricted_grpc { int32 personality = request->personality(); char* selector_string = (char*)request->selector_string().c_str(); auto status = library_->DeleteSnapshot(instrument, personality, selector_string); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -874,10 +904,11 @@ namespace nirfmxinstr_restricted_grpc { float64 bandwidth = request->bandwidth(); float64 reference_or_trigger_level_out {}; auto status = library_->ConvertForPowerUnitsUtility(instrument, reference_or_trigger_level_in, input_power_units, output_power_units, terminal_configuration, bandwidth, &reference_or_trigger_level_out); - response->set_status(status); - if (status_ok(status)) { - response->set_reference_or_trigger_level_out(reference_or_trigger_level_out); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_reference_or_trigger_level_out(reference_or_trigger_level_out); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -895,6 +926,9 @@ namespace nirfmxinstr_restricted_grpc { try { char* resource_name = (char*)request->resource_name().c_str(); auto status = library_->UnregisterSpecialClientSnapshotInterest(resource_name); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, 0); + } response->set_status(status); return ::grpc::Status::OK; } @@ -917,9 +951,8 @@ namespace nirfmxinstr_restricted_grpc { while (true) { auto status = library_->GetCalibrationPlaneNames(instrument, selector_string, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -932,11 +965,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_calibration_plane_names(calibration_plane_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_calibration_plane_names())); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_calibration_plane_names(calibration_plane_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_calibration_plane_names())); return ::grpc::Status::OK; } } @@ -958,10 +992,11 @@ namespace nirfmxinstr_restricted_grpc { char* selector_string = (char*)request->selector_string().c_str(); int32 calibration_plane_enabled {}; auto status = library_->GetCalibrationPlaneEnabled(instrument, selector_string, &calibration_plane_enabled); - response->set_status(status); - if (status_ok(status)) { - response->set_calibration_plane_enabled(calibration_plane_enabled); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_calibration_plane_enabled(calibration_plane_enabled); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -983,9 +1018,8 @@ namespace nirfmxinstr_restricted_grpc { while (true) { auto status = library_->GetExternalAttenuationTableNames(instrument, selector_string, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -998,11 +1032,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_external_attenuation_table_names(external_attenuation_table_names); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_external_attenuation_table_names())); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_external_attenuation_table_names(external_attenuation_table_names); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_external_attenuation_table_names())); return ::grpc::Status::OK; } } @@ -1025,9 +1060,8 @@ namespace nirfmxinstr_restricted_grpc { while (true) { auto status = library_->GetActiveTableName(instrument, selector_string, 0, nullptr); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } int32 array_size = status; @@ -1040,11 +1074,12 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_active_table_name(active_table_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_active_table_name())); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_active_table_name(active_table_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_active_table_name())); return ::grpc::Status::OK; } } @@ -1068,11 +1103,12 @@ namespace nirfmxinstr_restricted_grpc { int32 signal_state {}; uInt64 time_stamp {}; auto status = library_->GetSignalConfigurationState64(instrument, signal_name, signal_type, &signal_state, &time_stamp); - response->set_status(status); - if (status_ok(status)) { - response->set_signal_state(signal_state); - response->set_time_stamp(time_stamp); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_signal_state(signal_state); + response->set_time_stamp(time_stamp); return ::grpc::Status::OK; } catch (nidevice_grpc::LibraryLoadException& ex) { @@ -1092,6 +1128,9 @@ namespace nirfmxinstr_restricted_grpc { niRFmxInstrHandle instrument = session_repository_->access_session(instrument_grpc_session.id(), instrument_grpc_session.name()); int32 io_trace_status = request->io_trace_status(); auto status = library_->SetIOTraceStatus(instrument, io_trace_status); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); + } response->set_status(status); return ::grpc::Status::OK; } @@ -1116,9 +1155,8 @@ namespace nirfmxinstr_restricted_grpc { int32 result_state {}; while (true) { auto status = library_->GetActiveResultName(instrument, signal_name, signal_type, 0, nullptr, &actual_result_size, &result_state); - if (status < 0) { - response->set_status(status); - return ::grpc::Status::OK; + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } std::string result_name; if (actual_result_size > 0) { @@ -1130,13 +1168,14 @@ namespace nirfmxinstr_restricted_grpc { // buffer is now too small, try again continue; } - response->set_status(status); - if (status_ok(status)) { - response->set_result_name(result_name); - nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_name())); - response->set_actual_result_size(actual_result_size); - response->set_result_state(result_state); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiRFmxInstrHandle(status, instrument); } + response->set_status(status); + response->set_result_name(result_name); + nidevice_grpc::converters::trim_trailing_nulls(*(response->mutable_result_name())); + response->set_actual_result_size(actual_result_size); + response->set_result_state(result_state); return ::grpc::Status::OK; } } diff --git a/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.h b/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.h index 09d156cd8..663c03147 100644 --- a/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.h +++ b/generated/nirfmxinstr_restricted/nirfmxinstr_restricted_service.h @@ -78,6 +78,7 @@ class NiRFmxInstrRestrictedService final : public NiRFmxInstrRestricted::Service private: NiRFmxInstrRestrictedLibraryInterface* library_; ResourceRepositorySharedPtr session_repository_; + ::grpc::Status ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrument); NiRFmxInstrRestrictedFeatureToggles feature_toggles_; }; diff --git a/source/custom/nirfmxinstr_restricted_service.custom.cpp b/source/custom/nirfmxinstr_restricted_service.custom.cpp index 3f96b4ab8..9e5522c55 100644 --- a/source/custom/nirfmxinstr_restricted_service.custom.cpp +++ b/source/custom/nirfmxinstr_restricted_service.custom.cpp @@ -1,2 +1,12 @@ +#include + namespace nirfmxinstr_restricted_grpc { -} // namespace nirfmxinstr_restricted_grpc \ No newline at end of file + +::grpc::Status NiRFmxInstrRestrictedService::ConvertApiErrorStatusForNiRFmxInstrHandle(google::protobuf::int32 status, niRFmxInstrHandle instrumentHandle) +{ + std::string description(nidevice_grpc::kMaxGrpcErrorDescriptionSize, '\0'); + // TODO: How do we get access to a library that can return a useful string? + return nidevice_grpc::ApiErrorAndDescriptionToStatus(status, description); +} + +} // namespace nirfmxinstr_restricted_grpc diff --git a/source/custom/nirfmxspecan_restricted_service.custom.cpp b/source/custom/nirfmxspecan_restricted_service.custom.cpp index 9e0418959..d8732a4bf 100644 --- a/source/custom/nirfmxspecan_restricted_service.custom.cpp +++ b/source/custom/nirfmxspecan_restricted_service.custom.cpp @@ -1,4 +1,4 @@ -#include > +#include namespace nirfmxspecan_restricted_grpc { diff --git a/source/server/converters.h b/source/server/converters.h index eb9a46585..b165646b4 100644 --- a/source/server/converters.h +++ b/source/server/converters.h @@ -332,7 +332,8 @@ inline ::grpc::Status ApiErrorAndDescriptionToStatus(int32_t status, std::string inline ::grpc::Status ApiErrorAndDescriptionToStatus(int32_t status, std::string& description) { - return ApiErrorAndDescriptionToStatus(status, description, nlohmann::json()); + nlohmann::json jsonError; + return ApiErrorAndDescriptionToStatus(status, description, jsonError); } } // namespace nidevice_grpc