diff --git a/generated/nidaqmx/nidaqmx.proto b/generated/nidaqmx/nidaqmx.proto index 483f69452..7e726dc5b 100644 --- a/generated/nidaqmx/nidaqmx.proto +++ b/generated/nidaqmx/nidaqmx.proto @@ -6,6 +6,7 @@ //--------------------------------------------------------------------- syntax = "proto3"; +option cc_enable_arenas = true; option java_multiple_files = true; option java_package = "com.ni.grpc.nidaqmx"; option java_outer_classname = "NiDAQmx"; @@ -14,6 +15,7 @@ option csharp_namespace = "NationalInstruments.Grpc.NiDAQmx"; package nidaqmx_grpc; import "session.proto"; +import "data_moniker.proto"; import "google/protobuf/timestamp.proto"; service NiDAQmx { @@ -263,17 +265,29 @@ service NiDAQmx { rpc PerformStrainShuntCalEx(PerformStrainShuntCalExRequest) returns (PerformStrainShuntCalExResponse); rpc PerformThrmcplLeadOffsetNullingCal(PerformThrmcplLeadOffsetNullingCalRequest) returns (PerformThrmcplLeadOffsetNullingCalResponse); rpc ReadAnalogF64(ReadAnalogF64Request) returns (ReadAnalogF64Response); + rpc BeginReadAnalogF64(BeginReadAnalogF64Request) returns (BeginReadAnalogF64Response); rpc ReadAnalogScalarF64(ReadAnalogScalarF64Request) returns (ReadAnalogScalarF64Response); + rpc BeginReadAnalogScalarF64(BeginReadAnalogScalarF64Request) returns (BeginReadAnalogScalarF64Response); rpc ReadBinaryI16(ReadBinaryI16Request) returns (ReadBinaryI16Response); + rpc BeginReadBinaryI16(BeginReadBinaryI16Request) returns (BeginReadBinaryI16Response); rpc ReadBinaryI32(ReadBinaryI32Request) returns (ReadBinaryI32Response); + rpc BeginReadBinaryI32(BeginReadBinaryI32Request) returns (BeginReadBinaryI32Response); rpc ReadBinaryU16(ReadBinaryU16Request) returns (ReadBinaryU16Response); + rpc BeginReadBinaryU16(BeginReadBinaryU16Request) returns (BeginReadBinaryU16Response); rpc ReadBinaryU32(ReadBinaryU32Request) returns (ReadBinaryU32Response); + rpc BeginReadBinaryU32(BeginReadBinaryU32Request) returns (BeginReadBinaryU32Response); rpc ReadCounterF64(ReadCounterF64Request) returns (ReadCounterF64Response); + rpc BeginReadCounterF64(BeginReadCounterF64Request) returns (BeginReadCounterF64Response); rpc ReadCounterF64Ex(ReadCounterF64ExRequest) returns (ReadCounterF64ExResponse); + rpc BeginReadCounterF64Ex(BeginReadCounterF64ExRequest) returns (BeginReadCounterF64ExResponse); rpc ReadCounterScalarF64(ReadCounterScalarF64Request) returns (ReadCounterScalarF64Response); + rpc BeginReadCounterScalarF64(BeginReadCounterScalarF64Request) returns (BeginReadCounterScalarF64Response); rpc ReadCounterScalarU32(ReadCounterScalarU32Request) returns (ReadCounterScalarU32Response); + rpc BeginReadCounterScalarU32(BeginReadCounterScalarU32Request) returns (BeginReadCounterScalarU32Response); rpc ReadCounterU32(ReadCounterU32Request) returns (ReadCounterU32Response); + rpc BeginReadCounterU32(BeginReadCounterU32Request) returns (BeginReadCounterU32Response); rpc ReadCounterU32Ex(ReadCounterU32ExRequest) returns (ReadCounterU32ExResponse); + rpc BeginReadCounterU32Ex(BeginReadCounterU32ExRequest) returns (BeginReadCounterU32ExResponse); rpc ReadCtrFreq(ReadCtrFreqRequest) returns (ReadCtrFreqResponse); rpc ReadCtrFreqScalar(ReadCtrFreqScalarRequest) returns (ReadCtrFreqScalarResponse); rpc ReadCtrTicks(ReadCtrTicksRequest) returns (ReadCtrTicksResponse); @@ -282,8 +296,11 @@ service NiDAQmx { rpc ReadCtrTimeScalar(ReadCtrTimeScalarRequest) returns (ReadCtrTimeScalarResponse); rpc ReadDigitalLines(ReadDigitalLinesRequest) returns (ReadDigitalLinesResponse); rpc ReadDigitalScalarU32(ReadDigitalScalarU32Request) returns (ReadDigitalScalarU32Response); + rpc BeginReadDigitalScalarU32(BeginReadDigitalScalarU32Request) returns (BeginReadDigitalScalarU32Response); rpc ReadDigitalU16(ReadDigitalU16Request) returns (ReadDigitalU16Response); + rpc BeginReadDigitalU16(BeginReadDigitalU16Request) returns (BeginReadDigitalU16Response); rpc ReadDigitalU32(ReadDigitalU32Request) returns (ReadDigitalU32Response); + rpc BeginReadDigitalU32(BeginReadDigitalU32Request) returns (BeginReadDigitalU32Response); rpc ReadDigitalU8(ReadDigitalU8Request) returns (ReadDigitalU8Response); rpc ReadPowerBinaryI16(ReadPowerBinaryI16Request) returns (ReadPowerBinaryI16Response); rpc ReadPowerF64(ReadPowerF64Request) returns (ReadPowerF64Response); @@ -393,14 +410,21 @@ service NiDAQmx { rpc UnregisterSignalEvent(UnregisterSignalEventRequest) returns (UnregisterSignalEventResponse); rpc UnreserveNetworkDevice(UnreserveNetworkDeviceRequest) returns (UnreserveNetworkDeviceResponse); rpc WaitForNextSampleClock(WaitForNextSampleClockRequest) returns (WaitForNextSampleClockResponse); + rpc BeginWaitForNextSampleClock(BeginWaitForNextSampleClockRequest) returns (BeginWaitForNextSampleClockResponse); rpc WaitForValidTimestamp(WaitForValidTimestampRequest) returns (WaitForValidTimestampResponse); rpc WaitUntilTaskDone(WaitUntilTaskDoneRequest) returns (WaitUntilTaskDoneResponse); rpc WriteAnalogF64(WriteAnalogF64Request) returns (WriteAnalogF64Response); + rpc BeginWriteAnalogF64(BeginWriteAnalogF64Request) returns (BeginWriteAnalogF64Response); rpc WriteAnalogScalarF64(WriteAnalogScalarF64Request) returns (WriteAnalogScalarF64Response); + rpc BeginWriteAnalogScalarF64(BeginWriteAnalogScalarF64Request) returns (BeginWriteAnalogScalarF64Response); rpc WriteBinaryI16(WriteBinaryI16Request) returns (WriteBinaryI16Response); + rpc BeginWriteBinaryI16(BeginWriteBinaryI16Request) returns (BeginWriteBinaryI16Response); rpc WriteBinaryI32(WriteBinaryI32Request) returns (WriteBinaryI32Response); + rpc BeginWriteBinaryI32(BeginWriteBinaryI32Request) returns (BeginWriteBinaryI32Response); rpc WriteBinaryU16(WriteBinaryU16Request) returns (WriteBinaryU16Response); + rpc BeginWriteBinaryU16(BeginWriteBinaryU16Request) returns (BeginWriteBinaryU16Response); rpc WriteBinaryU32(WriteBinaryU32Request) returns (WriteBinaryU32Response); + rpc BeginWriteBinaryU32(BeginWriteBinaryU32Request) returns (BeginWriteBinaryU32Response); rpc WriteCtrFreq(WriteCtrFreqRequest) returns (WriteCtrFreqResponse); rpc WriteCtrFreqScalar(WriteCtrFreqScalarRequest) returns (WriteCtrFreqScalarResponse); rpc WriteCtrTicks(WriteCtrTicksRequest) returns (WriteCtrTicksResponse); @@ -409,8 +433,11 @@ service NiDAQmx { rpc WriteCtrTimeScalar(WriteCtrTimeScalarRequest) returns (WriteCtrTimeScalarResponse); rpc WriteDigitalLines(WriteDigitalLinesRequest) returns (WriteDigitalLinesResponse); rpc WriteDigitalScalarU32(WriteDigitalScalarU32Request) returns (WriteDigitalScalarU32Response); + rpc BeginWriteDigitalScalarU32(BeginWriteDigitalScalarU32Request) returns (BeginWriteDigitalScalarU32Response); rpc WriteDigitalU16(WriteDigitalU16Request) returns (WriteDigitalU16Response); + rpc BeginWriteDigitalU16(BeginWriteDigitalU16Request) returns (BeginWriteDigitalU16Response); rpc WriteDigitalU32(WriteDigitalU32Request) returns (WriteDigitalU32Response); + rpc BeginWriteDigitalU32(BeginWriteDigitalU32Request) returns (BeginWriteDigitalU32Response); rpc WriteDigitalU8(WriteDigitalU8Request) returns (WriteDigitalU8Response); rpc WriteRaw(WriteRawRequest) returns (WriteRawResponse); rpc WriteToTEDSFromArray(WriteToTEDSFromArrayRequest) returns (WriteToTEDSFromArrayResponse); @@ -4328,6 +4355,41 @@ enum WriteInt32AttributeValues { WRITE_INT32_WRITE_RELATIVE_TO_CURR_WRITE_POS = 10430; } +message DoubleData { + double value = 1; +} + +message I32Data { + int32 value = 1; +} + +message BoolData { + bool value = 1; +} + +message U32Data { + uint32 value = 1; +} + +message ArrayDoubleData { + repeated double value = 1; +} + +message ArrayI16Data { + repeated int32 value = 1; +} + +message ArrayI32Data { + repeated int32 value = 1; +} + +message ArrayU16Data { + repeated uint32 value = 1; +} + +message ArrayU32Data { + repeated uint32 value = 1; +} message AnalogPowerUpChannelsAndState { string channel_names = 1; double state = 2; @@ -8440,6 +8502,22 @@ message ReadAnalogF64Response { int32 samps_per_chan_read = 3; } +message BeginReadAnalogF64Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadAnalogF64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadAnalogScalarF64Request { nidevice_grpc.Session task = 1; double timeout = 2; @@ -8450,6 +8528,16 @@ message ReadAnalogScalarF64Response { double value = 2; } +message BeginReadAnalogScalarF64Request { + nidevice_grpc.Session task = 1; + double timeout = 2; +} + +message BeginReadAnalogScalarF64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadBinaryI16Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8467,6 +8555,22 @@ message ReadBinaryI16Response { int32 samps_per_chan_read = 3; } +message BeginReadBinaryI16Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadBinaryI16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadBinaryI32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8484,6 +8588,22 @@ message ReadBinaryI32Response { int32 samps_per_chan_read = 3; } +message BeginReadBinaryI32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadBinaryI32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadBinaryU16Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8501,6 +8621,22 @@ message ReadBinaryU16Response { int32 samps_per_chan_read = 3; } +message BeginReadBinaryU16Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadBinaryU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadBinaryU32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8518,6 +8654,22 @@ message ReadBinaryU32Response { int32 samps_per_chan_read = 3; } +message BeginReadBinaryU32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadBinaryU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCounterF64Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8531,6 +8683,18 @@ message ReadCounterF64Response { int32 samps_per_chan_read = 3; } +message BeginReadCounterF64Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + uint32 array_size_in_samps = 4; +} + +message BeginReadCounterF64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCounterF64ExRequest { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8548,6 +8712,22 @@ message ReadCounterF64ExResponse { int32 samps_per_chan_read = 3; } +message BeginReadCounterF64ExRequest { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadCounterF64ExResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCounterScalarF64Request { nidevice_grpc.Session task = 1; double timeout = 2; @@ -8558,6 +8738,16 @@ message ReadCounterScalarF64Response { double value = 2; } +message BeginReadCounterScalarF64Request { + nidevice_grpc.Session task = 1; + double timeout = 2; +} + +message BeginReadCounterScalarF64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCounterScalarU32Request { nidevice_grpc.Session task = 1; double timeout = 2; @@ -8568,6 +8758,16 @@ message ReadCounterScalarU32Response { uint32 value = 2; } +message BeginReadCounterScalarU32Request { + nidevice_grpc.Session task = 1; + double timeout = 2; +} + +message BeginReadCounterScalarU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCounterU32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8581,6 +8781,18 @@ message ReadCounterU32Response { int32 samps_per_chan_read = 3; } +message BeginReadCounterU32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + uint32 array_size_in_samps = 4; +} + +message BeginReadCounterU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCounterU32ExRequest { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8598,6 +8810,22 @@ message ReadCounterU32ExResponse { int32 samps_per_chan_read = 3; } +message BeginReadCounterU32ExRequest { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadCounterU32ExResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadCtrFreqRequest { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8713,6 +8941,16 @@ message ReadDigitalScalarU32Response { uint32 value = 2; } +message BeginReadDigitalScalarU32Request { + nidevice_grpc.Session task = 1; + double timeout = 2; +} + +message BeginReadDigitalScalarU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadDigitalU16Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8730,6 +8968,22 @@ message ReadDigitalU16Response { int32 samps_per_chan_read = 3; } +message BeginReadDigitalU16Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadDigitalU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadDigitalU32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -8747,6 +9001,22 @@ message ReadDigitalU32Response { int32 samps_per_chan_read = 3; } +message BeginReadDigitalU32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + double timeout = 3; + oneof fill_mode_enum { + GroupBy fill_mode = 4; + int32 fill_mode_raw = 5; + } + uint32 array_size_in_samps = 6; +} + +message BeginReadDigitalU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadDigitalU8Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10125,6 +10395,16 @@ message WaitForNextSampleClockResponse { bool is_late = 2; } +message BeginWaitForNextSampleClockRequest { + nidevice_grpc.Session task = 1; + double timeout = 2; +} + +message BeginWaitForNextSampleClockResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WaitForValidTimestampRequest { nidevice_grpc.Session task = 1; oneof timestamp_event_enum { @@ -10165,6 +10445,22 @@ message WriteAnalogF64Response { int32 samps_per_chan_written = 2; } +message BeginWriteAnalogF64Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteAnalogF64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteAnalogScalarF64Request { nidevice_grpc.Session task = 1; bool auto_start = 2; @@ -10176,6 +10472,17 @@ message WriteAnalogScalarF64Response { int32 status = 1; } +message BeginWriteAnalogScalarF64Request { + nidevice_grpc.Session task = 1; + bool auto_start = 2; + double timeout = 3; +} + +message BeginWriteAnalogScalarF64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteBinaryI16Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10193,6 +10500,22 @@ message WriteBinaryI16Response { int32 samps_per_chan_written = 2; } +message BeginWriteBinaryI16Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteBinaryI16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteBinaryI32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10210,6 +10533,22 @@ message WriteBinaryI32Response { int32 samps_per_chan_written = 2; } +message BeginWriteBinaryI32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteBinaryI32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteBinaryU16Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10227,6 +10566,22 @@ message WriteBinaryU16Response { int32 samps_per_chan_written = 2; } +message BeginWriteBinaryU16Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteBinaryU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteBinaryU32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10244,6 +10599,22 @@ message WriteBinaryU32Response { int32 samps_per_chan_written = 2; } +message BeginWriteBinaryU32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteBinaryU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteCtrFreqRequest { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10362,6 +10733,17 @@ message WriteDigitalScalarU32Response { int32 status = 1; } +message BeginWriteDigitalScalarU32Request { + nidevice_grpc.Session task = 1; + bool auto_start = 2; + double timeout = 3; +} + +message BeginWriteDigitalScalarU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteDigitalU16Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10379,6 +10761,22 @@ message WriteDigitalU16Response { int32 samps_per_chan_written = 2; } +message BeginWriteDigitalU16Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteDigitalU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteDigitalU32Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; @@ -10396,6 +10794,22 @@ message WriteDigitalU32Response { int32 samps_per_chan_written = 2; } +message BeginWriteDigitalU32Request { + nidevice_grpc.Session task = 1; + int32 num_samps_per_chan = 2; + bool auto_start = 3; + double timeout = 4; + oneof data_layout_enum { + GroupBy data_layout = 5; + int32 data_layout_raw = 6; + } +} + +message BeginWriteDigitalU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteDigitalU8Request { nidevice_grpc.Session task = 1; int32 num_samps_per_chan = 2; diff --git a/generated/nidaqmx/nidaqmx_client.cpp b/generated/nidaqmx/nidaqmx_client.cpp index 25026957e..e3aa0f60d 100644 --- a/generated/nidaqmx/nidaqmx_client.cpp +++ b/generated/nidaqmx/nidaqmx_client.cpp @@ -7492,6 +7492,34 @@ read_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const p return response; } +BeginReadAnalogF64Response +begin_read_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadAnalogF64Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadAnalogF64Response{}; + + raise_if_error( + stub->BeginReadAnalogF64(&context, request, &response), + context); + + return response; +} + ReadAnalogScalarF64Response read_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) { @@ -7510,6 +7538,24 @@ read_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, return response; } +BeginReadAnalogScalarF64Response +begin_read_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginReadAnalogScalarF64Request{}; + request.mutable_task()->CopyFrom(task); + request.set_timeout(timeout); + + auto response = BeginReadAnalogScalarF64Response{}; + + raise_if_error( + stub->BeginReadAnalogScalarF64(&context, request, &response), + context); + + return response; +} + ReadBinaryI16Response read_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7538,6 +7584,34 @@ read_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const p return response; } +BeginReadBinaryI16Response +begin_read_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadBinaryI16Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadBinaryI16Response{}; + + raise_if_error( + stub->BeginReadBinaryI16(&context, request, &response), + context); + + return response; +} + ReadBinaryI32Response read_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7566,6 +7640,34 @@ read_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const p return response; } +BeginReadBinaryI32Response +begin_read_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadBinaryI32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadBinaryI32Response{}; + + raise_if_error( + stub->BeginReadBinaryI32(&context, request, &response), + context); + + return response; +} + ReadBinaryU16Response read_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7594,6 +7696,34 @@ read_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const p return response; } +BeginReadBinaryU16Response +begin_read_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadBinaryU16Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadBinaryU16Response{}; + + raise_if_error( + stub->BeginReadBinaryU16(&context, request, &response), + context); + + return response; +} + ReadBinaryU32Response read_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7622,6 +7752,34 @@ read_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const p return response; } +BeginReadBinaryU32Response +begin_read_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadBinaryU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadBinaryU32Response{}; + + raise_if_error( + stub->BeginReadBinaryU32(&context, request, &response), + context); + + return response; +} + ReadCounterF64Response read_counter_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps) { @@ -7642,6 +7800,26 @@ read_counter_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginReadCounterF64Response +begin_read_counter_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadCounterF64Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadCounterF64Response{}; + + raise_if_error( + stub->BeginReadCounterF64(&context, request, &response), + context); + + return response; +} + ReadCounterF64ExResponse read_counter_f64_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7670,6 +7848,34 @@ read_counter_f64_ex(const StubPtr& stub, const nidevice_grpc::Session& task, con return response; } +BeginReadCounterF64ExResponse +begin_read_counter_f64_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadCounterF64ExRequest{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadCounterF64ExResponse{}; + + raise_if_error( + stub->BeginReadCounterF64Ex(&context, request, &response), + context); + + return response; +} + ReadCounterScalarF64Response read_counter_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) { @@ -7688,6 +7894,24 @@ read_counter_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, return response; } +BeginReadCounterScalarF64Response +begin_read_counter_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginReadCounterScalarF64Request{}; + request.mutable_task()->CopyFrom(task); + request.set_timeout(timeout); + + auto response = BeginReadCounterScalarF64Response{}; + + raise_if_error( + stub->BeginReadCounterScalarF64(&context, request, &response), + context); + + return response; +} + ReadCounterScalarU32Response read_counter_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) { @@ -7706,6 +7930,24 @@ read_counter_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, return response; } +BeginReadCounterScalarU32Response +begin_read_counter_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginReadCounterScalarU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_timeout(timeout); + + auto response = BeginReadCounterScalarU32Response{}; + + raise_if_error( + stub->BeginReadCounterScalarU32(&context, request, &response), + context); + + return response; +} + ReadCounterU32Response read_counter_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps) { @@ -7726,6 +7968,26 @@ read_counter_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginReadCounterU32Response +begin_read_counter_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadCounterU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadCounterU32Response{}; + + raise_if_error( + stub->BeginReadCounterU32(&context, request, &response), + context); + + return response; +} + ReadCounterU32ExResponse read_counter_u32_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7754,6 +8016,34 @@ read_counter_u32_ex(const StubPtr& stub, const nidevice_grpc::Session& task, con return response; } +BeginReadCounterU32ExResponse +begin_read_counter_u32_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadCounterU32ExRequest{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadCounterU32ExResponse{}; + + raise_if_error( + stub->BeginReadCounterU32Ex(&context, request, &response), + context); + + return response; +} + ReadCtrFreqResponse read_ctr_freq(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& interleaved, const pb::uint32& array_size_in_samps) { @@ -7938,6 +8228,24 @@ read_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, return response; } +BeginReadDigitalScalarU32Response +begin_read_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginReadDigitalScalarU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_timeout(timeout); + + auto response = BeginReadDigitalScalarU32Response{}; + + raise_if_error( + stub->BeginReadDigitalScalarU32(&context, request, &response), + context); + + return response; +} + ReadDigitalU16Response read_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7966,6 +8274,34 @@ read_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginReadDigitalU16Response +begin_read_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadDigitalU16Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadDigitalU16Response{}; + + raise_if_error( + stub->BeginReadDigitalU16(&context, request, &response), + context); + + return response; +} + ReadDigitalU32Response read_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -7994,6 +8330,34 @@ read_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginReadDigitalU32Response +begin_read_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) +{ + ::grpc::ClientContext context; + + auto request = BeginReadDigitalU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_timeout(timeout); + const auto fill_mode_ptr = fill_mode.get_if(); + const auto fill_mode_raw_ptr = fill_mode.get_if(); + if (fill_mode_ptr) { + request.set_fill_mode(*fill_mode_ptr); + } + else if (fill_mode_raw_ptr) { + request.set_fill_mode_raw(*fill_mode_raw_ptr); + } + request.set_array_size_in_samps(array_size_in_samps); + + auto response = BeginReadDigitalU32Response{}; + + raise_if_error( + stub->BeginReadDigitalU32(&context, request, &response), + context); + + return response; +} + ReadDigitalU8Response read_digital_u8(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps) { @@ -10683,6 +11047,24 @@ wait_for_next_sample_clock(const StubPtr& stub, const nidevice_grpc::Session& ta return response; } +BeginWaitForNextSampleClockResponse +begin_wait_for_next_sample_clock(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginWaitForNextSampleClockRequest{}; + request.mutable_task()->CopyFrom(task); + request.set_timeout(timeout); + + auto response = BeginWaitForNextSampleClockResponse{}; + + raise_if_error( + stub->BeginWaitForNextSampleClock(&context, request, &response), + context); + + return response; +} + WaitForValidTimestampResponse wait_for_valid_timestamp(const StubPtr& stub, const nidevice_grpc::Session& task, const simple_variant& timestamp_event, const double& timeout) { @@ -10756,6 +11138,34 @@ write_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteAnalogF64Response +begin_write_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteAnalogF64Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteAnalogF64Response{}; + + raise_if_error( + stub->BeginWriteAnalogF64(&context, request, &response), + context); + + return response; +} + WriteAnalogScalarF64Response write_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout, const double& value) { @@ -10776,6 +11186,25 @@ write_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, return response; } +BeginWriteAnalogScalarF64Response +begin_write_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteAnalogScalarF64Request{}; + request.mutable_task()->CopyFrom(task); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + + auto response = BeginWriteAnalogScalarF64Response{}; + + raise_if_error( + stub->BeginWriteAnalogScalarF64(&context, request, &response), + context); + + return response; +} + WriteBinaryI16Response write_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array) { @@ -10805,6 +11234,34 @@ write_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteBinaryI16Response +begin_write_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteBinaryI16Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteBinaryI16Response{}; + + raise_if_error( + stub->BeginWriteBinaryI16(&context, request, &response), + context); + + return response; +} + WriteBinaryI32Response write_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array) { @@ -10834,6 +11291,34 @@ write_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteBinaryI32Response +begin_write_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteBinaryI32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteBinaryI32Response{}; + + raise_if_error( + stub->BeginWriteBinaryI32(&context, request, &response), + context); + + return response; +} + WriteBinaryU16Response write_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array) { @@ -10863,6 +11348,34 @@ write_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteBinaryU16Response +begin_write_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteBinaryU16Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteBinaryU16Response{}; + + raise_if_error( + stub->BeginWriteBinaryU16(&context, request, &response), + context); + + return response; +} + WriteBinaryU32Response write_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array) { @@ -10892,6 +11405,34 @@ write_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteBinaryU32Response +begin_write_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteBinaryU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteBinaryU32Response{}; + + raise_if_error( + stub->BeginWriteBinaryU32(&context, request, &response), + context); + + return response; +} + WriteCtrFreqResponse write_ctr_freq(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& frequency, const std::vector& duty_cycle) { @@ -11094,6 +11635,25 @@ write_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task return response; } +BeginWriteDigitalScalarU32Response +begin_write_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteDigitalScalarU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + + auto response = BeginWriteDigitalScalarU32Response{}; + + raise_if_error( + stub->BeginWriteDigitalScalarU32(&context, request, &response), + context); + + return response; +} + WriteDigitalU16Response write_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array) { @@ -11123,6 +11683,34 @@ write_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteDigitalU16Response +begin_write_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteDigitalU16Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteDigitalU16Response{}; + + raise_if_error( + stub->BeginWriteDigitalU16(&context, request, &response), + context); + + return response; +} + WriteDigitalU32Response write_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array) { @@ -11152,6 +11740,34 @@ write_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const return response; } +BeginWriteDigitalU32Response +begin_write_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteDigitalU32Request{}; + request.mutable_task()->CopyFrom(task); + request.set_num_samps_per_chan(num_samps_per_chan); + request.set_auto_start(auto_start); + request.set_timeout(timeout); + const auto data_layout_ptr = data_layout.get_if(); + const auto data_layout_raw_ptr = data_layout.get_if(); + if (data_layout_ptr) { + request.set_data_layout(*data_layout_ptr); + } + else if (data_layout_raw_ptr) { + request.set_data_layout_raw(*data_layout_raw_ptr); + } + + auto response = BeginWriteDigitalU32Response{}; + + raise_if_error( + stub->BeginWriteDigitalU32(&context, request, &response), + context); + + return response; +} + WriteDigitalU8Response write_digital_u8(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::string& write_array) { diff --git a/generated/nidaqmx/nidaqmx_client.h b/generated/nidaqmx/nidaqmx_client.h index 226ab6311..3ecc1e4f4 100644 --- a/generated/nidaqmx/nidaqmx_client.h +++ b/generated/nidaqmx/nidaqmx_client.h @@ -268,17 +268,29 @@ PerformBridgeShuntCalExResponse perform_bridge_shunt_cal_ex(const StubPtr& stub, PerformStrainShuntCalExResponse perform_strain_shunt_cal_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const double& shunt_resistor_value, const simple_variant& shunt_resistor_location, const simple_variant& shunt_resistor_select, const simple_variant& shunt_resistor_source, const bool& skip_unsupported_channels); PerformThrmcplLeadOffsetNullingCalResponse perform_thrmcpl_lead_offset_nulling_cal(const StubPtr& stub, const nidevice_grpc::Session& task, const std::string& channel, const bool& skip_unsupported_channels); ReadAnalogF64Response read_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadAnalogF64Response begin_read_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadAnalogScalarF64Response read_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); +BeginReadAnalogScalarF64Response begin_read_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); ReadBinaryI16Response read_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadBinaryI16Response begin_read_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadBinaryI32Response read_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadBinaryI32Response begin_read_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadBinaryU16Response read_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadBinaryU16Response begin_read_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadBinaryU32Response read_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadBinaryU32Response begin_read_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadCounterF64Response read_counter_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps); +BeginReadCounterF64Response begin_read_counter_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps); ReadCounterF64ExResponse read_counter_f64_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadCounterF64ExResponse begin_read_counter_f64_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadCounterScalarF64Response read_counter_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); +BeginReadCounterScalarF64Response begin_read_counter_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); ReadCounterScalarU32Response read_counter_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); +BeginReadCounterScalarU32Response begin_read_counter_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); ReadCounterU32Response read_counter_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps); +BeginReadCounterU32Response begin_read_counter_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const pb::uint32& array_size_in_samps); ReadCounterU32ExResponse read_counter_u32_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadCounterU32ExResponse begin_read_counter_u32_ex(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadCtrFreqResponse read_ctr_freq(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& interleaved, const pb::uint32& array_size_in_samps); ReadCtrFreqScalarResponse read_ctr_freq_scalar(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); ReadCtrTicksResponse read_ctr_ticks(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& interleaved, const pb::uint32& array_size_in_samps); @@ -287,8 +299,11 @@ ReadCtrTimeResponse read_ctr_time(const StubPtr& stub, const nidevice_grpc::Sess ReadCtrTimeScalarResponse read_ctr_time_scalar(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); ReadDigitalLinesResponse read_digital_lines(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_bytes); ReadDigitalScalarU32Response read_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); +BeginReadDigitalScalarU32Response begin_read_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); ReadDigitalU16Response read_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadDigitalU16Response begin_read_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadDigitalU32Response read_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); +BeginReadDigitalU32Response begin_read_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadDigitalU8Response read_digital_u8(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadPowerBinaryI16Response read_power_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); ReadPowerF64Response read_power_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const double& timeout, const simple_variant& fill_mode, const pb::uint32& array_size_in_samps); @@ -398,14 +413,21 @@ UnregisterEveryNSamplesEventResponse unregister_every_n_samples_event(const Stub UnregisterSignalEventResponse unregister_signal_event(const StubPtr& stub, const nidevice_grpc::Session& task, const simple_variant& signal_id); UnreserveNetworkDeviceResponse unreserve_network_device(const StubPtr& stub, const std::string& device_name); WaitForNextSampleClockResponse wait_for_next_sample_clock(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); +BeginWaitForNextSampleClockResponse begin_wait_for_next_sample_clock(const StubPtr& stub, const nidevice_grpc::Session& task, const double& timeout); WaitForValidTimestampResponse wait_for_valid_timestamp(const StubPtr& stub, const nidevice_grpc::Session& task, const simple_variant& timestamp_event, const double& timeout); WaitUntilTaskDoneResponse wait_until_task_done(const StubPtr& stub, const nidevice_grpc::Session& task, const double& time_to_wait); WriteAnalogF64Response write_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteAnalogF64Response begin_write_analog_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteAnalogScalarF64Response write_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout, const double& value); +BeginWriteAnalogScalarF64Response begin_write_analog_scalar_f64(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout); WriteBinaryI16Response write_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteBinaryI16Response begin_write_binary_i16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteBinaryI32Response write_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteBinaryI32Response begin_write_binary_i32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteBinaryU16Response write_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteBinaryU16Response begin_write_binary_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteBinaryU32Response write_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteBinaryU32Response begin_write_binary_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteCtrFreqResponse write_ctr_freq(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& frequency, const std::vector& duty_cycle); WriteCtrFreqScalarResponse write_ctr_freq_scalar(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout, const double& frequency, const double& duty_cycle); WriteCtrTicksResponse write_ctr_ticks(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& high_ticks, const std::vector& low_ticks); @@ -414,8 +436,11 @@ WriteCtrTimeResponse write_ctr_time(const StubPtr& stub, const nidevice_grpc::Se WriteCtrTimeScalarResponse write_ctr_time_scalar(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout, const double& high_time, const double& low_time); WriteDigitalLinesResponse write_digital_lines(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::string& write_array); WriteDigitalScalarU32Response write_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout, const pb::uint32& value); +BeginWriteDigitalScalarU32Response begin_write_digital_scalar_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const bool& auto_start, const double& timeout); WriteDigitalU16Response write_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteDigitalU16Response begin_write_digital_u16(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteDigitalU32Response write_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::vector& write_array); +BeginWriteDigitalU32Response begin_write_digital_u32(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout); WriteDigitalU8Response write_digital_u8(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps_per_chan, const bool& auto_start, const double& timeout, const simple_variant& data_layout, const std::string& write_array); WriteRawResponse write_raw(const StubPtr& stub, const nidevice_grpc::Session& task, const pb::int32& num_samps, const bool& auto_start, const double& timeout, const std::string& write_array); WriteToTEDSFromArrayResponse write_to_teds_from_array(const StubPtr& stub, const std::string& physical_channel, const std::string& bit_stream, const simple_variant& basic_teds_options); diff --git a/generated/nidaqmx/nidaqmx_service.cpp b/generated/nidaqmx/nidaqmx_service.cpp index 7e343874b..1acd25300 100644 --- a/generated/nidaqmx/nidaqmx_service.cpp +++ b/generated/nidaqmx/nidaqmx_service.cpp @@ -15,6 +15,7 @@ #include #include #include "nidaqmx_library.h" +#include namespace nidaqmx_grpc { @@ -24,6 +25,284 @@ namespace nidaqmx_grpc { using nidevice_grpc::converters::convert_to_grpc; using nidevice_grpc::converters::MatchState; + struct MonikerReadAnalogF64Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayDoubleData data; + std::shared_ptr library; + }; + + struct MonikerReadAnalogScalarF64Data + { + TaskHandle task; + float64 timeout; + bool32* reserved; + nidaqmx_grpc::DoubleData data; + std::shared_ptr library; + }; + + struct MonikerReadBinaryI16Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayI16Data data; + std::shared_ptr library; + }; + + struct MonikerReadBinaryI32Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerReadBinaryU16Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayU16Data data; + std::shared_ptr library; + }; + + struct MonikerReadBinaryU32Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerReadCounterF64Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayDoubleData data; + std::shared_ptr library; + }; + + struct MonikerReadCounterF64ExData + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayDoubleData data; + std::shared_ptr library; + }; + + struct MonikerReadCounterScalarF64Data + { + TaskHandle task; + float64 timeout; + bool32* reserved; + nidaqmx_grpc::DoubleData data; + std::shared_ptr library; + }; + + struct MonikerReadCounterScalarU32Data + { + TaskHandle task; + float64 timeout; + bool32* reserved; + nidaqmx_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerReadCounterU32Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerReadCounterU32ExData + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerReadDigitalScalarU32Data + { + TaskHandle task; + float64 timeout; + bool32* reserved; + nidaqmx_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerReadDigitalU16Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayU16Data data; + std::shared_ptr library; + }; + + struct MonikerReadDigitalU32Data + { + TaskHandle task; + int32 num_samps_per_chan; + float64 timeout; + int32 fill_mode; + uInt32 array_size_in_samps; + bool32* reserved; + nidaqmx_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerWaitForNextSampleClockData + { + TaskHandle task; + float64 timeout; + nidaqmx_grpc::BoolData data; + std::shared_ptr library; + }; + + struct MonikerWriteAnalogF64Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayDoubleData data; + std::shared_ptr library; + }; + + struct MonikerWriteAnalogScalarF64Data + { + TaskHandle task; + bool32 auto_start; + float64 timeout; + bool32* reserved; + nidaqmx_grpc::DoubleData data; + std::shared_ptr library; + }; + + struct MonikerWriteBinaryI16Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayI16Data data; + std::shared_ptr library; + }; + + struct MonikerWriteBinaryI32Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteBinaryU16Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayU16Data data; + std::shared_ptr library; + }; + + struct MonikerWriteBinaryU32Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteDigitalScalarU32Data + { + TaskHandle task; + bool32 auto_start; + float64 timeout; + bool32* reserved; + nidaqmx_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteDigitalU16Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayU16Data data; + std::shared_ptr library; + }; + + struct MonikerWriteDigitalU32Data + { + TaskHandle task; + int32 num_samps_per_chan; + bool32 auto_start; + float64 timeout; + int32 data_layout; + bool32* reserved; + nidaqmx_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + const auto kErrorReadBufferTooSmall = -200229; const auto kWarningCAPIStringTruncatedToFitBuffer = 200026; @@ -47,6 +326,687 @@ namespace nidaqmx_grpc { return status >= 0; } + void RegisterMonikerEndpoints() + { + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadAnalogF64", MonikerReadAnalogF64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadAnalogScalarF64", MonikerReadAnalogScalarF64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadBinaryI16", MonikerReadBinaryI16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadBinaryI32", MonikerReadBinaryI32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadBinaryU16", MonikerReadBinaryU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadBinaryU32", MonikerReadBinaryU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadCounterF64", MonikerReadCounterF64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadCounterF64Ex", MonikerReadCounterF64Ex); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadCounterScalarF64", MonikerReadCounterScalarF64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadCounterScalarU32", MonikerReadCounterScalarU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadCounterU32", MonikerReadCounterU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadCounterU32Ex", MonikerReadCounterU32Ex); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadDigitalScalarU32", MonikerReadDigitalScalarU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadDigitalU16", MonikerReadDigitalU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadDigitalU32", MonikerReadDigitalU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWaitForNextSampleClock", MonikerWaitForNextSampleClock); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteAnalogF64", MonikerWriteAnalogF64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteAnalogScalarF64", MonikerWriteAnalogScalarF64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteBinaryI16", MonikerWriteBinaryI16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteBinaryI32", MonikerWriteBinaryI32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteBinaryU16", MonikerWriteBinaryU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteBinaryU32", MonikerWriteBinaryU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteDigitalScalarU32", MonikerWriteDigitalScalarU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteDigitalU16", MonikerWriteDigitalU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteDigitalU32", MonikerWriteDigitalU32); + } + +::grpc::Status MonikerReadAnalogF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadAnalogF64Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = function_data->data.mutable_value()->mutable_data(); + 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 >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadAnalogF64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadAnalogScalarF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadAnalogScalarF64Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto timeout = function_data->timeout; + auto reserved = function_data->reserved; + + float64 value {}; + auto status = library->ReadAnalogScalarF64(task, timeout, &value, reserved); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadAnalogScalarF64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadBinaryI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadBinaryI16Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + std::vector read_array(array_size_in_samps); + 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 >= 0) { + std::transform( + read_array.begin(), + read_array.begin() + array_size_in_samps, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadBinaryI16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadBinaryI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadBinaryI32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = reinterpret_cast(function_data->data.mutable_value()->mutable_data()); + 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 >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadBinaryI32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadBinaryU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadBinaryU16Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + std::vector read_array(array_size_in_samps); + 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 >= 0) { + std::transform( + read_array.begin(), + read_array.begin() + array_size_in_samps, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadBinaryU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadBinaryU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadBinaryU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = reinterpret_cast(function_data->data.mutable_value()->mutable_data()); + 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 >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadBinaryU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadCounterF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadCounterF64Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = function_data->data.mutable_value()->mutable_data(); + auto status = library->ReadCounterF64(task, num_samps_per_chan, timeout, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadCounterF64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadCounterF64Ex(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadCounterF64ExData* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = function_data->data.mutable_value()->mutable_data(); + 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 >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadCounterF64Ex error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadCounterScalarF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadCounterScalarF64Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto timeout = function_data->timeout; + auto reserved = function_data->reserved; + + float64 value {}; + auto status = library->ReadCounterScalarF64(task, timeout, &value, reserved); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadCounterScalarF64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadCounterScalarU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadCounterScalarU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto timeout = function_data->timeout; + auto reserved = function_data->reserved; + + uInt32 value {}; + auto status = library->ReadCounterScalarU32(task, timeout, &value, reserved); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadCounterScalarU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadCounterU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadCounterU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = reinterpret_cast(function_data->data.mutable_value()->mutable_data()); + auto status = library->ReadCounterU32(task, num_samps_per_chan, timeout, read_array, array_size_in_samps, &samps_per_chan_read, reserved); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadCounterU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadCounterU32Ex(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadCounterU32ExData* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = reinterpret_cast(function_data->data.mutable_value()->mutable_data()); + 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 >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadCounterU32Ex error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadDigitalScalarU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadDigitalScalarU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto timeout = function_data->timeout; + auto reserved = function_data->reserved; + + uInt32 value {}; + auto status = library->ReadDigitalScalarU32(task, timeout, &value, reserved); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadDigitalScalarU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadDigitalU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadDigitalU16Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + std::vector read_array(array_size_in_samps); + 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 >= 0) { + std::transform( + read_array.begin(), + read_array.begin() + array_size_in_samps, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadDigitalU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadDigitalU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadDigitalU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto timeout = function_data->timeout; + auto fill_mode = function_data->fill_mode; + auto array_size_in_samps = function_data->array_size_in_samps; + auto reserved = function_data->reserved; + + int32 samps_per_chan_read = {}; + function_data->data.mutable_value()->Resize(array_size_in_samps, 0); + auto read_array = reinterpret_cast(function_data->data.mutable_value()->mutable_data()); + 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 >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadDigitalU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWaitForNextSampleClock(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWaitForNextSampleClockData* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto timeout = function_data->timeout; + + bool32 is_late {}; + auto status = library->WaitForNextSampleClock(task, timeout, &is_late); + function_data->data.set_value(is_late); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerWaitForNextSampleClock error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteAnalogF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteAnalogF64Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayDoubleData arraydoubledata_message; + packedData.UnpackTo(&arraydoubledata_message); + + auto data_array = arraydoubledata_message.value(); + auto write_array = const_cast(arraydoubledata_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteAnalogF64(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteAnalogF64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteAnalogScalarF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteAnalogScalarF64Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto reserved = function_data->reserved; + + DoubleData doubledata_message; + packedData.UnpackTo(&doubledata_message); + auto value = doubledata_message.value(); + + auto status = library->WriteAnalogScalarF64(task, auto_start, timeout, value, reserved); + if (status < 0) { + std::cout << "MonikerWriteAnalogScalarF64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteBinaryI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteBinaryI16Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayI16Data arrayi16data_message; + packedData.UnpackTo(&arrayi16data_message); + + auto data_array = arrayi16data_message.value(); + auto write_array = std::vector(); + auto size = data_array.size(); + write_array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(write_array), + [](auto x) { + if (x < std::numeric_limits::min() || x > std::numeric_limits::max()) { + std::string message("value " + std::to_string(x) + " doesn't fit in datatype int16"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteBinaryI16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteBinaryI16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteBinaryI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteBinaryI32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayI32Data arrayi32data_message; + packedData.UnpackTo(&arrayi32data_message); + + auto data_array = arrayi32data_message.value(); + auto write_array = reinterpret_cast(arrayi32data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteBinaryI32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteBinaryI32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteBinaryU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteBinaryU16Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayU16Data arrayu16data_message; + packedData.UnpackTo(&arrayu16data_message); + + auto data_array = arrayu16data_message.value(); + auto write_array = std::vector(); + auto size = data_array.size(); + write_array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(write_array), + [](auto x) { + if (x < std::numeric_limits::min() || x > std::numeric_limits::max()) { + std::string message("value " + std::to_string(x) + " doesn't fit in datatype uInt16"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteBinaryU16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteBinaryU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteBinaryU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteBinaryU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayU32Data arrayu32data_message; + packedData.UnpackTo(&arrayu32data_message); + + auto data_array = arrayu32data_message.value(); + auto write_array = reinterpret_cast(arrayu32data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteBinaryU32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteBinaryU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteDigitalScalarU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteDigitalScalarU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto reserved = function_data->reserved; + + U32Data u32data_message; + packedData.UnpackTo(&u32data_message); + auto value = u32data_message.value(); + + auto status = library->WriteDigitalScalarU32(task, auto_start, timeout, value, reserved); + if (status < 0) { + std::cout << "MonikerWriteDigitalScalarU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteDigitalU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteDigitalU16Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayU16Data arrayu16data_message; + packedData.UnpackTo(&arrayu16data_message); + + auto data_array = arrayu16data_message.value(); + auto write_array = std::vector(); + auto size = data_array.size(); + write_array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(write_array), + [](auto x) { + if (x < std::numeric_limits::min() || x > std::numeric_limits::max()) { + std::string message("value " + std::to_string(x) + " doesn't fit in datatype uInt16"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteDigitalU16(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array.data(), &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteDigitalU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteDigitalU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteDigitalU32Data* function_data = static_cast(data); + auto library = function_data->library; + auto task = function_data->task; + auto num_samps_per_chan = function_data->num_samps_per_chan; + auto auto_start = function_data->auto_start; + auto timeout = function_data->timeout; + auto data_layout = function_data->data_layout; + auto reserved = function_data->reserved; + + int32 samps_per_chan_written = {}; + ArrayU32Data arrayu32data_message; + packedData.UnpackTo(&arrayu32data_message); + + auto data_array = arrayu32data_message.value(); + auto write_array = reinterpret_cast(arrayu32data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteDigitalU32(task, num_samps_per_chan, auto_start, timeout, data_layout, write_array, &samps_per_chan_written, reserved); + if (status < 0) { + std::cout << "MonikerWriteDigitalU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::AddCDAQSyncConnection(::grpc::ServerContext* context, const AddCDAQSyncConnectionRequest* request, AddCDAQSyncConnectionResponse* response) @@ -13207,6 +14167,59 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadAnalogF64(::grpc::ServerContext* context, const BeginReadAnalogF64Request* request, BeginReadAnalogF64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::BeginReadAnalogF64Request::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::BeginReadAnalogF64Request::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::BeginReadAnalogF64Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadAnalogF64", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadAnalogScalarF64(::grpc::ServerContext* context, const ReadAnalogScalarF64Request* request, ReadAnalogScalarF64Response* response) @@ -13233,6 +14246,36 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadAnalogScalarF64(::grpc::ServerContext* context, const BeginReadAnalogScalarF64Request* request, BeginReadAnalogScalarF64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + float64 timeout = request->timeout(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->timeout = timeout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadAnalogScalarF64", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadBinaryI16(::grpc::ServerContext* context, const ReadBinaryI16Request* request, ReadBinaryI16Response* response) @@ -13288,6 +14331,59 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadBinaryI16(::grpc::ServerContext* context, const BeginReadBinaryI16Request* request, BeginReadBinaryI16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::BeginReadBinaryI16Request::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::BeginReadBinaryI16Request::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::BeginReadBinaryI16Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadBinaryI16", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadBinaryI32(::grpc::ServerContext* context, const ReadBinaryI32Request* request, ReadBinaryI32Response* response) @@ -13335,6 +14431,59 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadBinaryI32(::grpc::ServerContext* context, const BeginReadBinaryI32Request* request, BeginReadBinaryI32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::BeginReadBinaryI32Request::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::BeginReadBinaryI32Request::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::BeginReadBinaryI32Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadBinaryI32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadBinaryU16(::grpc::ServerContext* context, const ReadBinaryU16Request* request, ReadBinaryU16Response* response) @@ -13392,7 +14541,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadBinaryU32(::grpc::ServerContext* context, const ReadBinaryU32Request* request, ReadBinaryU32Response* response) + ::grpc::Status NiDAQmxService::BeginReadBinaryU16(::grpc::ServerContext* context, const BeginReadBinaryU16Request* request, BeginReadBinaryU16Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13404,15 +14553,15 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); int32 fill_mode; switch (request->fill_mode_enum_case()) { - case nidaqmx_grpc::ReadBinaryU32Request::FillModeEnumCase::kFillMode: { + case nidaqmx_grpc::BeginReadBinaryU16Request::FillModeEnumCase::kFillMode: { fill_mode = static_cast(request->fill_mode()); break; } - case nidaqmx_grpc::ReadBinaryU32Request::FillModeEnumCase::kFillModeRaw: { + case nidaqmx_grpc::BeginReadBinaryU16Request::FillModeEnumCase::kFillModeRaw: { fill_mode = static_cast(request->fill_mode_raw()); break; } - case nidaqmx_grpc::ReadBinaryU32Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + case nidaqmx_grpc::BeginReadBinaryU16Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); break; } @@ -13420,16 +14569,22 @@ namespace nidaqmx_grpc { uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; - response->mutable_read_array()->Resize(array_size_in_samps, 0); - 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); - context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); - if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { - return ConvertApiErrorStatusForTaskHandle(context, status, task); - } - response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadBinaryU16", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -13439,7 +14594,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCounterF64(::grpc::ServerContext* context, const ReadCounterF64Request* request, ReadCounterF64Response* response) + ::grpc::Status NiDAQmxService::ReadBinaryU32(::grpc::ServerContext* context, const ReadBinaryU32Request* request, ReadBinaryU32Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13449,12 +14604,28 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.name()); int32 num_samps_per_chan = request->num_samps_per_chan(); float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::ReadBinaryU32Request::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::ReadBinaryU32Request::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::ReadBinaryU32Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; response->mutable_read_array()->Resize(array_size_in_samps, 0); - float64* read_array = response->mutable_read_array()->mutable_data(); + uInt32* read_array = reinterpret_cast(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); + auto status = library_->ReadBinaryU32(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { return ConvertApiErrorStatusForTaskHandle(context, status, task); @@ -13470,7 +14641,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCounterF64Ex(::grpc::ServerContext* context, const ReadCounterF64ExRequest* request, ReadCounterF64ExResponse* response) + ::grpc::Status NiDAQmxService::BeginReadBinaryU32(::grpc::ServerContext* context, const BeginReadBinaryU32Request* request, BeginReadBinaryU32Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13482,15 +14653,15 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); int32 fill_mode; switch (request->fill_mode_enum_case()) { - case nidaqmx_grpc::ReadCounterF64ExRequest::FillModeEnumCase::kFillMode: { + case nidaqmx_grpc::BeginReadBinaryU32Request::FillModeEnumCase::kFillMode: { fill_mode = static_cast(request->fill_mode()); break; } - case nidaqmx_grpc::ReadCounterF64ExRequest::FillModeEnumCase::kFillModeRaw: { + case nidaqmx_grpc::BeginReadBinaryU32Request::FillModeEnumCase::kFillModeRaw: { fill_mode = static_cast(request->fill_mode_raw()); break; } - case nidaqmx_grpc::ReadCounterF64ExRequest::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + case nidaqmx_grpc::BeginReadBinaryU32Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); break; } @@ -13498,16 +14669,22 @@ namespace nidaqmx_grpc { uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; - response->mutable_read_array()->Resize(array_size_in_samps, 0); - 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); - context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); - if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { - return ConvertApiErrorStatusForTaskHandle(context, status, task); - } - response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadBinaryU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -13517,7 +14694,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCounterScalarF64(::grpc::ServerContext* context, const ReadCounterScalarF64Request* request, ReadCounterScalarF64Response* response) + ::grpc::Status NiDAQmxService::ReadCounterF64(::grpc::ServerContext* context, const ReadCounterF64Request* request, ReadCounterF64Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13525,15 +14702,20 @@ namespace nidaqmx_grpc { try { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); float64 timeout = request->timeout(); + uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; - float64 value {}; - auto status = library_->ReadCounterScalarF64(task, timeout, &value, reserved); - if (!status_ok(status)) { + response->mutable_read_array()->Resize(array_size_in_samps, 0); + 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); + context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); + if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { return ConvertApiErrorStatusForTaskHandle(context, status, task); } response->set_status(status); - response->set_value(value); + response->set_samps_per_chan_read(samps_per_chan_read); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -13543,7 +14725,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCounterScalarU32(::grpc::ServerContext* context, const ReadCounterScalarU32Request* request, ReadCounterScalarU32Response* response) + ::grpc::Status NiDAQmxService::BeginReadCounterF64(::grpc::ServerContext* context, const BeginReadCounterF64Request* request, BeginReadCounterF64Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13551,15 +14733,25 @@ namespace nidaqmx_grpc { try { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); float64 timeout = request->timeout(); + uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; - uInt32 value {}; - auto status = library_->ReadCounterScalarU32(task, timeout, &value, reserved); - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(context, status, task); - } - response->set_status(status); - response->set_value(value); + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadCounterF64", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -13569,7 +14761,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCounterU32(::grpc::ServerContext* context, const ReadCounterU32Request* request, ReadCounterU32Response* response) + ::grpc::Status NiDAQmxService::ReadCounterF64Ex(::grpc::ServerContext* context, const ReadCounterF64ExRequest* request, ReadCounterF64ExResponse* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13579,12 +14771,28 @@ namespace nidaqmx_grpc { TaskHandle task = session_repository_->access_session(task_grpc_session.name()); int32 num_samps_per_chan = request->num_samps_per_chan(); float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::ReadCounterF64ExRequest::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::ReadCounterF64ExRequest::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::ReadCounterF64ExRequest::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; response->mutable_read_array()->Resize(array_size_in_samps, 0); - uInt32* read_array = reinterpret_cast(response->mutable_read_array()->mutable_data()); + float64* read_array = 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); + auto status = library_->ReadCounterF64Ex(task, num_samps_per_chan, timeout, fill_mode, read_array, array_size_in_samps, &samps_per_chan_read, reserved); context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { return ConvertApiErrorStatusForTaskHandle(context, status, task); @@ -13600,7 +14808,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCounterU32Ex(::grpc::ServerContext* context, const ReadCounterU32ExRequest* request, ReadCounterU32ExResponse* response) + ::grpc::Status NiDAQmxService::BeginReadCounterF64Ex(::grpc::ServerContext* context, const BeginReadCounterF64ExRequest* request, BeginReadCounterF64ExResponse* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13612,15 +14820,15 @@ namespace nidaqmx_grpc { float64 timeout = request->timeout(); int32 fill_mode; switch (request->fill_mode_enum_case()) { - case nidaqmx_grpc::ReadCounterU32ExRequest::FillModeEnumCase::kFillMode: { + case nidaqmx_grpc::BeginReadCounterF64ExRequest::FillModeEnumCase::kFillMode: { fill_mode = static_cast(request->fill_mode()); break; } - case nidaqmx_grpc::ReadCounterU32ExRequest::FillModeEnumCase::kFillModeRaw: { + case nidaqmx_grpc::BeginReadCounterF64ExRequest::FillModeEnumCase::kFillModeRaw: { fill_mode = static_cast(request->fill_mode_raw()); break; } - case nidaqmx_grpc::ReadCounterU32ExRequest::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + case nidaqmx_grpc::BeginReadCounterF64ExRequest::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); break; } @@ -13628,16 +14836,22 @@ namespace nidaqmx_grpc { uInt32 array_size_in_samps = request->array_size_in_samps(); auto reserved = nullptr; - response->mutable_read_array()->Resize(array_size_in_samps, 0); - 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); - context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); - if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { - return ConvertApiErrorStatusForTaskHandle(context, status, task); - } - response->set_status(status); - response->set_samps_per_chan_read(samps_per_chan_read); + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadCounterF64Ex", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -13647,7 +14861,7 @@ namespace nidaqmx_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiDAQmxService::ReadCtrFreq(::grpc::ServerContext* context, const ReadCtrFreqRequest* request, ReadCtrFreqResponse* response) + ::grpc::Status NiDAQmxService::ReadCounterScalarF64(::grpc::ServerContext* context, const ReadCounterScalarF64Request* request, ReadCounterScalarF64Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -13655,21 +14869,300 @@ namespace nidaqmx_grpc { try { auto task_grpc_session = request->task(); TaskHandle task = session_repository_->access_session(task_grpc_session.name()); - int32 num_samps_per_chan = request->num_samps_per_chan(); float64 timeout = request->timeout(); - int32 interleaved; - switch (request->interleaved_enum_case()) { - case nidaqmx_grpc::ReadCtrFreqRequest::InterleavedEnumCase::kInterleaved: { - interleaved = static_cast(request->interleaved()); - break; - } - case nidaqmx_grpc::ReadCtrFreqRequest::InterleavedEnumCase::kInterleavedRaw: { - interleaved = static_cast(request->interleaved_raw()); - break; - } - case nidaqmx_grpc::ReadCtrFreqRequest::InterleavedEnumCase::INTERLEAVED_ENUM_NOT_SET: { - return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for interleaved was not specified or out of range"); - break; + auto reserved = nullptr; + float64 value {}; + auto status = library_->ReadCounterScalarF64(task, timeout, &value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(context, status, task); + } + response->set_status(status); + response->set_value(value); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadCounterScalarF64(::grpc::ServerContext* context, const BeginReadCounterScalarF64Request* request, BeginReadCounterScalarF64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + float64 timeout = request->timeout(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->timeout = timeout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadCounterScalarF64", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::ReadCounterScalarU32(::grpc::ServerContext* context, const ReadCounterScalarU32Request* request, ReadCounterScalarU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + float64 timeout = request->timeout(); + auto reserved = nullptr; + uInt32 value {}; + auto status = library_->ReadCounterScalarU32(task, timeout, &value, reserved); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(context, status, task); + } + response->set_status(status); + response->set_value(value); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadCounterScalarU32(::grpc::ServerContext* context, const BeginReadCounterScalarU32Request* request, BeginReadCounterScalarU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + float64 timeout = request->timeout(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->timeout = timeout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadCounterScalarU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::ReadCounterU32(::grpc::ServerContext* context, const ReadCounterU32Request* request, ReadCounterU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + response->mutable_read_array()->Resize(array_size_in_samps, 0); + 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); + context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); + if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { + return ConvertApiErrorStatusForTaskHandle(context, status, task); + } + response->set_status(status); + response->set_samps_per_chan_read(samps_per_chan_read); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadCounterU32(::grpc::ServerContext* context, const BeginReadCounterU32Request* request, BeginReadCounterU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadCounterU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::ReadCounterU32Ex(::grpc::ServerContext* context, const ReadCounterU32ExRequest* request, ReadCounterU32ExResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::ReadCounterU32ExRequest::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::ReadCounterU32ExRequest::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::ReadCounterU32ExRequest::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + response->mutable_read_array()->Resize(array_size_in_samps, 0); + 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); + context->AddTrailingMetadata("ni-samps-per-chan-read", std::to_string(samps_per_chan_read)); + if (!status_ok(status) && status != DAQmxErrorSamplesNotYetAvailable) { + return ConvertApiErrorStatusForTaskHandle(context, status, task); + } + response->set_status(status); + response->set_samps_per_chan_read(samps_per_chan_read); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadCounterU32Ex(::grpc::ServerContext* context, const BeginReadCounterU32ExRequest* request, BeginReadCounterU32ExResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::BeginReadCounterU32ExRequest::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::BeginReadCounterU32ExRequest::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::BeginReadCounterU32ExRequest::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadCounterU32Ex", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::ReadCtrFreq(::grpc::ServerContext* context, const ReadCtrFreqRequest* request, ReadCtrFreqResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 interleaved; + switch (request->interleaved_enum_case()) { + case nidaqmx_grpc::ReadCtrFreqRequest::InterleavedEnumCase::kInterleaved: { + interleaved = static_cast(request->interleaved()); + break; + } + case nidaqmx_grpc::ReadCtrFreqRequest::InterleavedEnumCase::kInterleavedRaw: { + interleaved = static_cast(request->interleaved_raw()); + break; + } + case nidaqmx_grpc::ReadCtrFreqRequest::InterleavedEnumCase::INTERLEAVED_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for interleaved was not specified or out of range"); + break; } } @@ -13951,6 +15444,36 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadDigitalScalarU32(::grpc::ServerContext* context, const BeginReadDigitalScalarU32Request* request, BeginReadDigitalScalarU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + float64 timeout = request->timeout(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->timeout = timeout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadDigitalScalarU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadDigitalU16(::grpc::ServerContext* context, const ReadDigitalU16Request* request, ReadDigitalU16Response* response) @@ -14006,6 +15529,59 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadDigitalU16(::grpc::ServerContext* context, const BeginReadDigitalU16Request* request, BeginReadDigitalU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::BeginReadDigitalU16Request::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::BeginReadDigitalU16Request::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::BeginReadDigitalU16Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadDigitalU16", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadDigitalU32(::grpc::ServerContext* context, const ReadDigitalU32Request* request, ReadDigitalU32Response* response) @@ -14053,6 +15629,59 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginReadDigitalU32(::grpc::ServerContext* context, const BeginReadDigitalU32Request* request, BeginReadDigitalU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + float64 timeout = request->timeout(); + int32 fill_mode; + switch (request->fill_mode_enum_case()) { + case nidaqmx_grpc::BeginReadDigitalU32Request::FillModeEnumCase::kFillMode: { + fill_mode = static_cast(request->fill_mode()); + break; + } + case nidaqmx_grpc::BeginReadDigitalU32Request::FillModeEnumCase::kFillModeRaw: { + fill_mode = static_cast(request->fill_mode_raw()); + break; + } + case nidaqmx_grpc::BeginReadDigitalU32Request::FillModeEnumCase::FILL_MODE_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for fill_mode was not specified or out of range"); + break; + } + } + + uInt32 array_size_in_samps = request->array_size_in_samps(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->timeout = timeout; + data->fill_mode = fill_mode; + data->array_size_in_samps = array_size_in_samps; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->array_size_in_samps()); + data->data.mutable_value()->Resize(request->array_size_in_samps(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadDigitalU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::ReadDigitalU8(::grpc::ServerContext* context, const ReadDigitalU8Request* request, ReadDigitalU8Response* response) @@ -18556,6 +20185,34 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWaitForNextSampleClock(::grpc::ServerContext* context, const BeginWaitForNextSampleClockRequest* request, BeginWaitForNextSampleClockResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + float64 timeout = request->timeout(); + + auto data = std::make_unique(); + data->task = task; + data->timeout = timeout; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWaitForNextSampleClock", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WaitForValidTimestamp(::grpc::ServerContext* context, const WaitForValidTimestampRequest* request, WaitForValidTimestampResponse* response) @@ -18639,26 +20296,77 @@ namespace nidaqmx_grpc { data_layout = static_cast(request->data_layout()); break; } - case nidaqmx_grpc::WriteAnalogF64Request::DataLayoutEnumCase::kDataLayoutRaw: { + case nidaqmx_grpc::WriteAnalogF64Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::WriteAnalogF64Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto write_array = const_cast(request->write_array().data()); + 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); + context->AddTrailingMetadata("ni-samps-per-chan-written", std::to_string(samps_per_chan_written)); + if (!status_ok(status)) { + return ConvertApiErrorStatusForTaskHandle(context, status, task); + } + response->set_status(status); + response->set_samps_per_chan_written(samps_per_chan_written); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteAnalogF64(::grpc::ServerContext* context, const BeginWriteAnalogF64Request* request, BeginWriteAnalogF64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteAnalogF64Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteAnalogF64Request::DataLayoutEnumCase::kDataLayoutRaw: { data_layout = static_cast(request->data_layout_raw()); break; } - case nidaqmx_grpc::WriteAnalogF64Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + case nidaqmx_grpc::BeginWriteAnalogF64Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); break; } } - auto write_array = const_cast(request->write_array().data()); 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); - context->AddTrailingMetadata("ni-samps-per-chan-written", std::to_string(samps_per_chan_written)); - if (!status_ok(status)) { - return ConvertApiErrorStatusForTaskHandle(context, status, task); - } - response->set_status(status); - response->set_samps_per_chan_written(samps_per_chan_written); + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteAnalogF64", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -18692,6 +20400,38 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteAnalogScalarF64(::grpc::ServerContext* context, const BeginWriteAnalogScalarF64Request* request, BeginWriteAnalogScalarF64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->auto_start = auto_start; + data->timeout = timeout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteAnalogScalarF64", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteBinaryI16(::grpc::ServerContext* context, const WriteBinaryI16Request* request, WriteBinaryI16Response* response) @@ -18755,6 +20495,57 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteBinaryI16(::grpc::ServerContext* context, const BeginWriteBinaryI16Request* request, BeginWriteBinaryI16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteBinaryI16Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryI16Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryI16Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteBinaryI16", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteBinaryI32(::grpc::ServerContext* context, const WriteBinaryI32Request* request, WriteBinaryI32Response* response) @@ -18801,6 +20592,57 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteBinaryI32(::grpc::ServerContext* context, const BeginWriteBinaryI32Request* request, BeginWriteBinaryI32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteBinaryI32Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryI32Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryI32Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteBinaryI32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteBinaryU16(::grpc::ServerContext* context, const WriteBinaryU16Request* request, WriteBinaryU16Response* response) @@ -18864,6 +20706,57 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteBinaryU16(::grpc::ServerContext* context, const BeginWriteBinaryU16Request* request, BeginWriteBinaryU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteBinaryU16Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryU16Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryU16Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteBinaryU16", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteBinaryU32(::grpc::ServerContext* context, const WriteBinaryU32Request* request, WriteBinaryU32Response* response) @@ -18910,6 +20803,57 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteBinaryU32(::grpc::ServerContext* context, const BeginWriteBinaryU32Request* request, BeginWriteBinaryU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteBinaryU32Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryU32Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::BeginWriteBinaryU32Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteBinaryU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteCtrFreq(::grpc::ServerContext* context, const WriteCtrFreqRequest* request, WriteCtrFreqResponse* response) @@ -19204,6 +21148,38 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteDigitalScalarU32(::grpc::ServerContext* context, const BeginWriteDigitalScalarU32Request* request, BeginWriteDigitalScalarU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->auto_start = auto_start; + data->timeout = timeout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteDigitalScalarU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteDigitalU16(::grpc::ServerContext* context, const WriteDigitalU16Request* request, WriteDigitalU16Response* response) @@ -19267,6 +21243,57 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteDigitalU16(::grpc::ServerContext* context, const BeginWriteDigitalU16Request* request, BeginWriteDigitalU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteDigitalU16Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteDigitalU16Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::BeginWriteDigitalU16Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteDigitalU16", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteDigitalU32(::grpc::ServerContext* context, const WriteDigitalU32Request* request, WriteDigitalU32Response* response) @@ -19313,6 +21340,57 @@ namespace nidaqmx_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiDAQmxService::BeginWriteDigitalU32(::grpc::ServerContext* context, const BeginWriteDigitalU32Request* request, BeginWriteDigitalU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto task_grpc_session = request->task(); + TaskHandle task = session_repository_->access_session(task_grpc_session.name()); + int32 num_samps_per_chan = request->num_samps_per_chan(); + bool32 auto_start = request->auto_start(); + float64 timeout = request->timeout(); + int32 data_layout; + switch (request->data_layout_enum_case()) { + case nidaqmx_grpc::BeginWriteDigitalU32Request::DataLayoutEnumCase::kDataLayout: { + data_layout = static_cast(request->data_layout()); + break; + } + case nidaqmx_grpc::BeginWriteDigitalU32Request::DataLayoutEnumCase::kDataLayoutRaw: { + data_layout = static_cast(request->data_layout_raw()); + break; + } + case nidaqmx_grpc::BeginWriteDigitalU32Request::DataLayoutEnumCase::DATA_LAYOUT_ENUM_NOT_SET: { + return ::grpc::Status(::grpc::INVALID_ARGUMENT, "The value for data_layout was not specified or out of range"); + break; + } + } + + auto reserved = nullptr; + + auto data = std::make_unique(); + data->task = task; + data->num_samps_per_chan = num_samps_per_chan; + data->auto_start = auto_start; + data->timeout = timeout; + data->data_layout = data_layout; + data->reserved = reserved; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteDigitalU32", data.release(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiDAQmxService::WriteDigitalU8(::grpc::ServerContext* context, const WriteDigitalU8Request* request, WriteDigitalU8Response* response) diff --git a/generated/nidaqmx/nidaqmx_service.h b/generated/nidaqmx/nidaqmx_service.h index 2419070eb..03c2324d1 100644 --- a/generated/nidaqmx/nidaqmx_service.h +++ b/generated/nidaqmx/nidaqmx_service.h @@ -32,6 +32,34 @@ struct NiDAQmxFeatureToggles bool is_allow_undefined_attributes_enabled; }; +void RegisterMonikerEndpoints(); + +::grpc::Status MonikerReadAnalogF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadAnalogScalarF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadBinaryI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadBinaryI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadBinaryU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadBinaryU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadCounterF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadCounterF64Ex(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadCounterScalarF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadCounterScalarU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadCounterU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadCounterU32Ex(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadDigitalScalarU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadDigitalU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadDigitalU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWaitForNextSampleClock(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteAnalogF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteAnalogScalarF64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteBinaryI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteBinaryI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteBinaryU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteBinaryU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteDigitalScalarU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteDigitalU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteDigitalU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); + class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEvent>> { public: using LibrarySharedPtr = std::shared_ptr; @@ -289,17 +317,29 @@ class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEv ::grpc::Status PerformStrainShuntCalEx(::grpc::ServerContext* context, const PerformStrainShuntCalExRequest* request, PerformStrainShuntCalExResponse* response) override; ::grpc::Status PerformThrmcplLeadOffsetNullingCal(::grpc::ServerContext* context, const PerformThrmcplLeadOffsetNullingCalRequest* request, PerformThrmcplLeadOffsetNullingCalResponse* response) override; ::grpc::Status ReadAnalogF64(::grpc::ServerContext* context, const ReadAnalogF64Request* request, ReadAnalogF64Response* response) override; + ::grpc::Status BeginReadAnalogF64(::grpc::ServerContext* context, const BeginReadAnalogF64Request* request, BeginReadAnalogF64Response* response) override; ::grpc::Status ReadAnalogScalarF64(::grpc::ServerContext* context, const ReadAnalogScalarF64Request* request, ReadAnalogScalarF64Response* response) override; + ::grpc::Status BeginReadAnalogScalarF64(::grpc::ServerContext* context, const BeginReadAnalogScalarF64Request* request, BeginReadAnalogScalarF64Response* response) override; ::grpc::Status ReadBinaryI16(::grpc::ServerContext* context, const ReadBinaryI16Request* request, ReadBinaryI16Response* response) override; + ::grpc::Status BeginReadBinaryI16(::grpc::ServerContext* context, const BeginReadBinaryI16Request* request, BeginReadBinaryI16Response* response) override; ::grpc::Status ReadBinaryI32(::grpc::ServerContext* context, const ReadBinaryI32Request* request, ReadBinaryI32Response* response) override; + ::grpc::Status BeginReadBinaryI32(::grpc::ServerContext* context, const BeginReadBinaryI32Request* request, BeginReadBinaryI32Response* response) override; ::grpc::Status ReadBinaryU16(::grpc::ServerContext* context, const ReadBinaryU16Request* request, ReadBinaryU16Response* response) override; + ::grpc::Status BeginReadBinaryU16(::grpc::ServerContext* context, const BeginReadBinaryU16Request* request, BeginReadBinaryU16Response* response) override; ::grpc::Status ReadBinaryU32(::grpc::ServerContext* context, const ReadBinaryU32Request* request, ReadBinaryU32Response* response) override; + ::grpc::Status BeginReadBinaryU32(::grpc::ServerContext* context, const BeginReadBinaryU32Request* request, BeginReadBinaryU32Response* response) override; ::grpc::Status ReadCounterF64(::grpc::ServerContext* context, const ReadCounterF64Request* request, ReadCounterF64Response* response) override; + ::grpc::Status BeginReadCounterF64(::grpc::ServerContext* context, const BeginReadCounterF64Request* request, BeginReadCounterF64Response* response) override; ::grpc::Status ReadCounterF64Ex(::grpc::ServerContext* context, const ReadCounterF64ExRequest* request, ReadCounterF64ExResponse* response) override; + ::grpc::Status BeginReadCounterF64Ex(::grpc::ServerContext* context, const BeginReadCounterF64ExRequest* request, BeginReadCounterF64ExResponse* response) override; ::grpc::Status ReadCounterScalarF64(::grpc::ServerContext* context, const ReadCounterScalarF64Request* request, ReadCounterScalarF64Response* response) override; + ::grpc::Status BeginReadCounterScalarF64(::grpc::ServerContext* context, const BeginReadCounterScalarF64Request* request, BeginReadCounterScalarF64Response* response) override; ::grpc::Status ReadCounterScalarU32(::grpc::ServerContext* context, const ReadCounterScalarU32Request* request, ReadCounterScalarU32Response* response) override; + ::grpc::Status BeginReadCounterScalarU32(::grpc::ServerContext* context, const BeginReadCounterScalarU32Request* request, BeginReadCounterScalarU32Response* response) override; ::grpc::Status ReadCounterU32(::grpc::ServerContext* context, const ReadCounterU32Request* request, ReadCounterU32Response* response) override; + ::grpc::Status BeginReadCounterU32(::grpc::ServerContext* context, const BeginReadCounterU32Request* request, BeginReadCounterU32Response* response) override; ::grpc::Status ReadCounterU32Ex(::grpc::ServerContext* context, const ReadCounterU32ExRequest* request, ReadCounterU32ExResponse* response) override; + ::grpc::Status BeginReadCounterU32Ex(::grpc::ServerContext* context, const BeginReadCounterU32ExRequest* request, BeginReadCounterU32ExResponse* response) override; ::grpc::Status ReadCtrFreq(::grpc::ServerContext* context, const ReadCtrFreqRequest* request, ReadCtrFreqResponse* response) override; ::grpc::Status ReadCtrFreqScalar(::grpc::ServerContext* context, const ReadCtrFreqScalarRequest* request, ReadCtrFreqScalarResponse* response) override; ::grpc::Status ReadCtrTicks(::grpc::ServerContext* context, const ReadCtrTicksRequest* request, ReadCtrTicksResponse* response) override; @@ -308,8 +348,11 @@ class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEv ::grpc::Status ReadCtrTimeScalar(::grpc::ServerContext* context, const ReadCtrTimeScalarRequest* request, ReadCtrTimeScalarResponse* response) override; ::grpc::Status ReadDigitalLines(::grpc::ServerContext* context, const ReadDigitalLinesRequest* request, ReadDigitalLinesResponse* response) override; ::grpc::Status ReadDigitalScalarU32(::grpc::ServerContext* context, const ReadDigitalScalarU32Request* request, ReadDigitalScalarU32Response* response) override; + ::grpc::Status BeginReadDigitalScalarU32(::grpc::ServerContext* context, const BeginReadDigitalScalarU32Request* request, BeginReadDigitalScalarU32Response* response) override; ::grpc::Status ReadDigitalU16(::grpc::ServerContext* context, const ReadDigitalU16Request* request, ReadDigitalU16Response* response) override; + ::grpc::Status BeginReadDigitalU16(::grpc::ServerContext* context, const BeginReadDigitalU16Request* request, BeginReadDigitalU16Response* response) override; ::grpc::Status ReadDigitalU32(::grpc::ServerContext* context, const ReadDigitalU32Request* request, ReadDigitalU32Response* response) override; + ::grpc::Status BeginReadDigitalU32(::grpc::ServerContext* context, const BeginReadDigitalU32Request* request, BeginReadDigitalU32Response* response) override; ::grpc::Status ReadDigitalU8(::grpc::ServerContext* context, const ReadDigitalU8Request* request, ReadDigitalU8Response* response) override; ::grpc::Status ReadPowerBinaryI16(::grpc::ServerContext* context, const ReadPowerBinaryI16Request* request, ReadPowerBinaryI16Response* response) override; ::grpc::Status ReadPowerF64(::grpc::ServerContext* context, const ReadPowerF64Request* request, ReadPowerF64Response* response) override; @@ -419,14 +462,21 @@ class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEv ::grpc::Status UnregisterSignalEvent(::grpc::ServerContext* context, const UnregisterSignalEventRequest* request, UnregisterSignalEventResponse* response) override; ::grpc::Status UnreserveNetworkDevice(::grpc::ServerContext* context, const UnreserveNetworkDeviceRequest* request, UnreserveNetworkDeviceResponse* response) override; ::grpc::Status WaitForNextSampleClock(::grpc::ServerContext* context, const WaitForNextSampleClockRequest* request, WaitForNextSampleClockResponse* response) override; + ::grpc::Status BeginWaitForNextSampleClock(::grpc::ServerContext* context, const BeginWaitForNextSampleClockRequest* request, BeginWaitForNextSampleClockResponse* response) override; ::grpc::Status WaitForValidTimestamp(::grpc::ServerContext* context, const WaitForValidTimestampRequest* request, WaitForValidTimestampResponse* response) override; ::grpc::Status WaitUntilTaskDone(::grpc::ServerContext* context, const WaitUntilTaskDoneRequest* request, WaitUntilTaskDoneResponse* response) override; ::grpc::Status WriteAnalogF64(::grpc::ServerContext* context, const WriteAnalogF64Request* request, WriteAnalogF64Response* response) override; + ::grpc::Status BeginWriteAnalogF64(::grpc::ServerContext* context, const BeginWriteAnalogF64Request* request, BeginWriteAnalogF64Response* response) override; ::grpc::Status WriteAnalogScalarF64(::grpc::ServerContext* context, const WriteAnalogScalarF64Request* request, WriteAnalogScalarF64Response* response) override; + ::grpc::Status BeginWriteAnalogScalarF64(::grpc::ServerContext* context, const BeginWriteAnalogScalarF64Request* request, BeginWriteAnalogScalarF64Response* response) override; ::grpc::Status WriteBinaryI16(::grpc::ServerContext* context, const WriteBinaryI16Request* request, WriteBinaryI16Response* response) override; + ::grpc::Status BeginWriteBinaryI16(::grpc::ServerContext* context, const BeginWriteBinaryI16Request* request, BeginWriteBinaryI16Response* response) override; ::grpc::Status WriteBinaryI32(::grpc::ServerContext* context, const WriteBinaryI32Request* request, WriteBinaryI32Response* response) override; + ::grpc::Status BeginWriteBinaryI32(::grpc::ServerContext* context, const BeginWriteBinaryI32Request* request, BeginWriteBinaryI32Response* response) override; ::grpc::Status WriteBinaryU16(::grpc::ServerContext* context, const WriteBinaryU16Request* request, WriteBinaryU16Response* response) override; + ::grpc::Status BeginWriteBinaryU16(::grpc::ServerContext* context, const BeginWriteBinaryU16Request* request, BeginWriteBinaryU16Response* response) override; ::grpc::Status WriteBinaryU32(::grpc::ServerContext* context, const WriteBinaryU32Request* request, WriteBinaryU32Response* response) override; + ::grpc::Status BeginWriteBinaryU32(::grpc::ServerContext* context, const BeginWriteBinaryU32Request* request, BeginWriteBinaryU32Response* response) override; ::grpc::Status WriteCtrFreq(::grpc::ServerContext* context, const WriteCtrFreqRequest* request, WriteCtrFreqResponse* response) override; ::grpc::Status WriteCtrFreqScalar(::grpc::ServerContext* context, const WriteCtrFreqScalarRequest* request, WriteCtrFreqScalarResponse* response) override; ::grpc::Status WriteCtrTicks(::grpc::ServerContext* context, const WriteCtrTicksRequest* request, WriteCtrTicksResponse* response) override; @@ -435,8 +485,11 @@ class NiDAQmxService final : public NiDAQmx::WithCallbackMethod_RegisterSignalEv ::grpc::Status WriteCtrTimeScalar(::grpc::ServerContext* context, const WriteCtrTimeScalarRequest* request, WriteCtrTimeScalarResponse* response) override; ::grpc::Status WriteDigitalLines(::grpc::ServerContext* context, const WriteDigitalLinesRequest* request, WriteDigitalLinesResponse* response) override; ::grpc::Status WriteDigitalScalarU32(::grpc::ServerContext* context, const WriteDigitalScalarU32Request* request, WriteDigitalScalarU32Response* response) override; + ::grpc::Status BeginWriteDigitalScalarU32(::grpc::ServerContext* context, const BeginWriteDigitalScalarU32Request* request, BeginWriteDigitalScalarU32Response* response) override; ::grpc::Status WriteDigitalU16(::grpc::ServerContext* context, const WriteDigitalU16Request* request, WriteDigitalU16Response* response) override; + ::grpc::Status BeginWriteDigitalU16(::grpc::ServerContext* context, const BeginWriteDigitalU16Request* request, BeginWriteDigitalU16Response* response) override; ::grpc::Status WriteDigitalU32(::grpc::ServerContext* context, const WriteDigitalU32Request* request, WriteDigitalU32Response* response) override; + ::grpc::Status BeginWriteDigitalU32(::grpc::ServerContext* context, const BeginWriteDigitalU32Request* request, BeginWriteDigitalU32Response* response) override; ::grpc::Status WriteDigitalU8(::grpc::ServerContext* context, const WriteDigitalU8Request* request, WriteDigitalU8Response* response) override; ::grpc::Status WriteRaw(::grpc::ServerContext* context, const WriteRawRequest* request, WriteRawResponse* response) override; ::grpc::Status WriteToTEDSFromArray(::grpc::ServerContext* context, const WriteToTEDSFromArrayRequest* request, WriteToTEDSFromArrayResponse* response) override; diff --git a/generated/nidaqmx/nidaqmx_service_registrar.cpp b/generated/nidaqmx/nidaqmx_service_registrar.cpp index 91d5653df..123d65fc4 100644 --- a/generated/nidaqmx/nidaqmx_service_registrar.cpp +++ b/generated/nidaqmx/nidaqmx_service_registrar.cpp @@ -10,6 +10,7 @@ #include "nidaqmx_service.h" #include "nidaqmx_service_registrar.h" +#include namespace nidaqmx_grpc { @@ -28,6 +29,11 @@ std::shared_ptr register_service( resource_repository, toggles); builder.RegisterService(service.get()); + + if (ni::data_monikers::is_sideband_streaming_enabled(feature_toggles)) { + nidaqmx_grpc::RegisterMonikerEndpoints(); + } + return service; } diff --git a/generated/nifpga/nifpga_service.cpp b/generated/nifpga/nifpga_service.cpp index 65be89dc2..86c5651cb 100644 --- a/generated/nifpga/nifpga_service.cpp +++ b/generated/nifpga/nifpga_service.cpp @@ -456,11 +456,11 @@ namespace nifpga_grpc { ::grpc::Status MonikerReadArrayBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayBoolData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + std::vector array(size, NiFpga_Bool()); auto status = library->ReadArrayBool(session, indicator, array.data(), size); if (status >= 0) { @@ -483,11 +483,11 @@ ::grpc::Status MonikerReadArrayBool(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerReadArrayDbl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayDblData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + function_data->data.mutable_value()->Resize(size, 0); auto array = function_data->data.mutable_value()->mutable_data(); auto status = library->ReadArrayDbl(session, indicator, array, size); @@ -504,11 +504,11 @@ ::grpc::Status MonikerReadArrayDbl(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayI16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + std::vector array(size); auto status = library->ReadArrayI16(session, indicator, array.data(), size); if (status >= 0) { @@ -531,11 +531,11 @@ ::grpc::Status MonikerReadArrayI16(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayI32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + function_data->data.mutable_value()->Resize(size, 0); auto array = function_data->data.mutable_value()->mutable_data(); auto status = library->ReadArrayI32(session, indicator, array, size); @@ -552,11 +552,11 @@ ::grpc::Status MonikerReadArrayI32(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayI64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + function_data->data.mutable_value()->Resize(size, 0); auto array = function_data->data.mutable_value()->mutable_data(); auto status = library->ReadArrayI64(session, indicator, array, size); @@ -573,11 +573,11 @@ ::grpc::Status MonikerReadArrayI64(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayI8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + std::vector array(size); auto status = library->ReadArrayI8(session, indicator, array.data(), size); if (status >= 0) { @@ -600,11 +600,11 @@ ::grpc::Status MonikerReadArrayI8(void* data, google::protobuf::Arena& arena, go ::grpc::Status MonikerReadArraySgl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArraySglData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + function_data->data.mutable_value()->Resize(size, 0); auto array = function_data->data.mutable_value()->mutable_data(); auto status = library->ReadArraySgl(session, indicator, array, size); @@ -621,11 +621,11 @@ ::grpc::Status MonikerReadArraySgl(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayU16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + std::vector array(size); auto status = library->ReadArrayU16(session, indicator, array.data(), size); if (status >= 0) { @@ -648,11 +648,11 @@ ::grpc::Status MonikerReadArrayU16(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayU32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + function_data->data.mutable_value()->Resize(size, 0); auto array = function_data->data.mutable_value()->mutable_data(); auto status = library->ReadArrayU32(session, indicator, array, size); @@ -669,11 +669,11 @@ ::grpc::Status MonikerReadArrayU32(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayU64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + function_data->data.mutable_value()->Resize(size, 0); auto array = function_data->data.mutable_value()->mutable_data(); auto status = library->ReadArrayU64(session, indicator, array, size); @@ -690,11 +690,11 @@ ::grpc::Status MonikerReadArrayU64(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerReadArrayU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadArrayU8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; auto size = function_data->size; - + std::vector array(size); auto status = library->ReadArrayU8(session, indicator, array.data(), size); if (status >= 0) { @@ -717,10 +717,10 @@ ::grpc::Status MonikerReadArrayU8(void* data, google::protobuf::Arena& arena, go ::grpc::Status MonikerReadBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadBoolData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + NiFpga_Bool value {}; auto status = library->ReadBool(session, indicator, &value); function_data->data.set_value(value); @@ -737,10 +737,10 @@ ::grpc::Status MonikerReadBool(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerReadDbl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadDblData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + double value {}; auto status = library->ReadDbl(session, indicator, &value); function_data->data.set_value(value); @@ -757,10 +757,10 @@ ::grpc::Status MonikerReadDbl(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadI16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + int16_t value {}; auto status = library->ReadI16(session, indicator, &value); function_data->data.set_value(value); @@ -777,10 +777,10 @@ ::grpc::Status MonikerReadI16(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadI32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + int32_t value {}; auto status = library->ReadI32(session, indicator, &value); function_data->data.set_value(value); @@ -797,10 +797,10 @@ ::grpc::Status MonikerReadI32(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadI64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + int64_t value {}; auto status = library->ReadI64(session, indicator, &value); function_data->data.set_value(value); @@ -817,10 +817,10 @@ ::grpc::Status MonikerReadI64(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadI8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + int8_t value {}; auto status = library->ReadI8(session, indicator, &value); function_data->data.set_value(value); @@ -837,10 +837,10 @@ ::grpc::Status MonikerReadI8(void* data, google::protobuf::Arena& arena, google: ::grpc::Status MonikerReadSgl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadSglData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + float value {}; auto status = library->ReadSgl(session, indicator, &value); function_data->data.set_value(value); @@ -857,10 +857,10 @@ ::grpc::Status MonikerReadSgl(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadU16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + uint16_t value {}; auto status = library->ReadU16(session, indicator, &value); function_data->data.set_value(value); @@ -877,10 +877,10 @@ ::grpc::Status MonikerReadU16(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadU32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + uint32_t value {}; auto status = library->ReadU32(session, indicator, &value); function_data->data.set_value(value); @@ -897,10 +897,10 @@ ::grpc::Status MonikerReadU32(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadU64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + uint64_t value {}; auto status = library->ReadU64(session, indicator, &value); function_data->data.set_value(value); @@ -917,10 +917,10 @@ ::grpc::Status MonikerReadU64(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerReadU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerReadU8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto indicator = function_data->indicator; - + uint8_t value {}; auto status = library->ReadU8(session, indicator, &value); function_data->data.set_value(value); @@ -937,10 +937,10 @@ ::grpc::Status MonikerReadU8(void* data, google::protobuf::Arena& arena, google: ::grpc::Status MonikerWriteArrayBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayBoolData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayBoolData arraybooldata_message; packedData.UnpackTo(&arraybooldata_message); @@ -958,10 +958,10 @@ ::grpc::Status MonikerWriteArrayBool(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayDbl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayDblData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayDoubleData arraydoubledata_message; packedData.UnpackTo(&arraydoubledata_message); @@ -979,10 +979,10 @@ ::grpc::Status MonikerWriteArrayDbl(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayI16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayI32Data arrayi32data_message; packedData.UnpackTo(&arrayi32data_message); @@ -1012,10 +1012,10 @@ ::grpc::Status MonikerWriteArrayI16(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayI32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayI32Data arrayi32data_message; packedData.UnpackTo(&arrayi32data_message); @@ -1033,10 +1033,10 @@ ::grpc::Status MonikerWriteArrayI32(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayI64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayI64Data arrayi64data_message; packedData.UnpackTo(&arrayi64data_message); @@ -1054,10 +1054,10 @@ ::grpc::Status MonikerWriteArrayI64(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayI8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayI32Data arrayi32data_message; packedData.UnpackTo(&arrayi32data_message); @@ -1087,10 +1087,10 @@ ::grpc::Status MonikerWriteArrayI8(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerWriteArraySgl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArraySglData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayFloatData arrayfloatdata_message; packedData.UnpackTo(&arrayfloatdata_message); @@ -1108,10 +1108,10 @@ ::grpc::Status MonikerWriteArraySgl(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayU16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayU32Data arrayu32data_message; packedData.UnpackTo(&arrayu32data_message); @@ -1141,10 +1141,10 @@ ::grpc::Status MonikerWriteArrayU16(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayU32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayU32Data arrayu32data_message; packedData.UnpackTo(&arrayu32data_message); @@ -1162,10 +1162,10 @@ ::grpc::Status MonikerWriteArrayU32(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayU64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayU64Data arrayu64data_message; packedData.UnpackTo(&arrayu64data_message); @@ -1183,10 +1183,10 @@ ::grpc::Status MonikerWriteArrayU64(void* data, google::protobuf::Arena& arena, ::grpc::Status MonikerWriteArrayU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteArrayU8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + ArrayU32Data arrayu32data_message; packedData.UnpackTo(&arrayu32data_message); @@ -1216,10 +1216,10 @@ ::grpc::Status MonikerWriteArrayU8(void* data, google::protobuf::Arena& arena, g ::grpc::Status MonikerWriteBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteBoolData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + BoolData booldata_message; packedData.UnpackTo(&booldata_message); auto value = booldata_message.value(); @@ -1234,10 +1234,10 @@ ::grpc::Status MonikerWriteBool(void* data, google::protobuf::Arena& arena, goog ::grpc::Status MonikerWriteDbl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteDblData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + DoubleData doubledata_message; packedData.UnpackTo(&doubledata_message); auto value = doubledata_message.value(); @@ -1252,10 +1252,10 @@ ::grpc::Status MonikerWriteDbl(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteI16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + I32Data i32data_message; packedData.UnpackTo(&i32data_message); auto value = i32data_message.value(); @@ -1274,10 +1274,10 @@ ::grpc::Status MonikerWriteI16(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteI32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + I32Data i32data_message; packedData.UnpackTo(&i32data_message); auto value = i32data_message.value(); @@ -1292,10 +1292,10 @@ ::grpc::Status MonikerWriteI32(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteI64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + I64Data i64data_message; packedData.UnpackTo(&i64data_message); auto value = i64data_message.value(); @@ -1310,10 +1310,10 @@ ::grpc::Status MonikerWriteI64(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteI8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + I32Data i32data_message; packedData.UnpackTo(&i32data_message); auto value = i32data_message.value(); @@ -1332,10 +1332,10 @@ ::grpc::Status MonikerWriteI8(void* data, google::protobuf::Arena& arena, google ::grpc::Status MonikerWriteSgl(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteSglData* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + FloatData floatdata_message; packedData.UnpackTo(&floatdata_message); auto value = floatdata_message.value(); @@ -1350,10 +1350,10 @@ ::grpc::Status MonikerWriteSgl(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteU16Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + U32Data u32data_message; packedData.UnpackTo(&u32data_message); auto value = u32data_message.value(); @@ -1372,10 +1372,10 @@ ::grpc::Status MonikerWriteU16(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteU32Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + U32Data u32data_message; packedData.UnpackTo(&u32data_message); auto value = u32data_message.value(); @@ -1390,10 +1390,10 @@ ::grpc::Status MonikerWriteU32(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteU64Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + U64Data u64data_message; packedData.UnpackTo(&u64data_message); auto value = u64data_message.value(); @@ -1408,10 +1408,10 @@ ::grpc::Status MonikerWriteU64(void* data, google::protobuf::Arena& arena, googl ::grpc::Status MonikerWriteU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { MonikerWriteU8Data* function_data = static_cast(data); - auto library = function_data->library; + auto library = function_data->library; auto session = function_data->session; auto control = function_data->control; - + U32Data u32data_message; packedData.UnpackTo(&u32data_message); auto value = u32data_message.value(); diff --git a/source/codegen/common_helpers.py b/source/codegen/common_helpers.py index 99a77e77b..8c5957a89 100644 --- a/source/codegen/common_helpers.py +++ b/source/codegen/common_helpers.py @@ -33,7 +33,7 @@ def is_input_parameter(parameter): return "in" in parameter["direction"] -def get_streaming_parameter(parameters: List[Dict]) -> Optional[Dict]: +def get_first_streaming_parameter(parameters: List[Dict]) -> Optional[Dict]: """Get the streaming parameter from the list of parameters.""" for param in parameters: if param.get("is_streaming_type", False): @@ -402,7 +402,7 @@ def _is_actually_pascal(camel_or_pascal_string: str) -> bool: return "A" <= camel_or_pascal_string[0] <= "Z" -def _camel_to_snake(camel_string: str) -> str: +def camel_to_snake(camel_string: str) -> str: """Return a snake_string for a given camelString. External callers should use/create a wrapper instead (i.e. get_grpc_field_name). @@ -472,7 +472,7 @@ def ensure_pascal_case(pascal_or_camel_string): def pascal_to_snake(pascal_string): """Return a snake_string for a given PascalString.""" camel_string = _pascal_to_camel(pascal_string) - snake_string = _camel_to_snake(camel_string) + snake_string = camel_to_snake(camel_string) return "".join(snake_string) @@ -1128,7 +1128,7 @@ def get_grpc_field_name(param: dict) -> str: definition itself, as well as in C++ code that accesses the field from a Request/Response message. """ - return param.get("grpc_name", _camel_to_snake(param["name"])) + return param.get("grpc_name", camel_to_snake(param["name"])) def get_grpc_client_field_name(param: dict) -> str: @@ -1136,14 +1136,14 @@ def get_grpc_client_field_name(param: dict) -> str: This will be a snake_case_string, that can be used in the client generated files. """ - return param.get("grpc_name", _camel_to_snake(param["cppName"])) + return param.get("grpc_name", camel_to_snake(param["cppName"])) def get_grpc_field_name_from_str(field_name: str) -> str: """Get the default grpc_name for the given parameter name.""" # NOTE: Does not account for "grpc_name" overrides, but can be used to get a proto name from a # camelCase field name when no overrides are present. - return _camel_to_snake(field_name) + return camel_to_snake(field_name) def get_cpp_local_name(param: dict) -> str: @@ -1154,7 +1154,7 @@ def get_cpp_local_name(param: dict) -> str: cases where "name" is not a reserved keyword. If "grpc_name" is a reserved keyword, this may be an issue (but don't use reserved grpc_name!). """ - return param.get("cpp_local_name", param.get("grpc_name", _camel_to_snake(param["cppName"]))) + return param.get("cpp_local_name", param.get("grpc_name", camel_to_snake(param["cppName"]))) def get_grpc_field_names_for_param_names(params: List[dict], names: List[str]) -> List[str]: @@ -1245,12 +1245,11 @@ def get_input_streaming_params(parameters): params = [] for param in parameters: - if is_input_parameter(param): - if not param.get("is_streaming_type", False): - if _is_streaming_param_input_array(streaming_param): - size_param_name = streaming_param["size"]["value"] - if param["name"] != size_param_name: - params.append(param) - else: + if is_input_parameter(param) and not param.get("is_streaming_type", False): + if _is_streaming_param_input_array(streaming_param): + size_param_name = get_size_param(streaming_param) + if size_param_name != param["name"]: params.append(param) + else: + params.append(param) return params diff --git a/source/codegen/metadata/nidaqmx/config.py b/source/codegen/metadata/nidaqmx/config.py index d2eb00c4c..3a2e9a624 100644 --- a/source/codegen/metadata/nidaqmx/config.py +++ b/source/codegen/metadata/nidaqmx/config.py @@ -121,6 +121,8 @@ 'DAQmxSignalEventCallbackPtr': 'void', 'CVIAbsoluteTime': 'google.protobuf.Timestamp' }, + 'has_moniker_streaming_apis': True, + 'additional_protos': ['data_moniker.proto'], 'split_attributes_by_type': True, 'supports_raw_attributes': True, 'code_readiness': 'Release', diff --git a/source/codegen/metadata/nidaqmx/custom_proto.mako b/source/codegen/metadata/nidaqmx/custom_proto.mako new file mode 100644 index 000000000..b15758d35 --- /dev/null +++ b/source/codegen/metadata/nidaqmx/custom_proto.mako @@ -0,0 +1,35 @@ +message DoubleData { + double value = 1; +} + +message I32Data { + int32 value = 1; +} + +message BoolData { + bool value = 1; +} + +message U32Data { + uint32 value = 1; +} + +message ArrayDoubleData { + repeated double value = 1; +} + +message ArrayI16Data { + repeated int32 value = 1; +} + +message ArrayI32Data { + repeated int32 value = 1; +} + +message ArrayU16Data { + repeated uint32 value = 1; +} + +message ArrayU32Data { + repeated uint32 value = 1; +} \ No newline at end of file diff --git a/source/codegen/metadata/nidaqmx/functions.py b/source/codegen/metadata/nidaqmx/functions.py index d969cc238..13867797c 100644 --- a/source/codegen/metadata/nidaqmx/functions.py +++ b/source/codegen/metadata/nidaqmx/functions.py @@ -17588,9 +17588,11 @@ { 'ctypes_data_type': 'numpy.float64', 'direction': 'out', + 'grpc_streaming_type': 'ArrayDoubleData', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'float', 'python_description': '', @@ -17612,6 +17614,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -17634,6 +17637,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadAnalogScalarF64': { @@ -17662,7 +17666,9 @@ { 'ctypes_data_type': 'ctypes.c_double', 'direction': 'out', + 'grpc_streaming_type': 'DoubleData', 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'value', 'python_data_type': 'float', 'python_description': '', @@ -17684,7 +17690,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'ReadBinaryI16': { 'calling_convention': 'StdCall', @@ -17734,9 +17741,11 @@ 'coerced': True, 'ctypes_data_type': 'numpy.int16', 'direction': 'out', + 'grpc_streaming_type': 'ArrayI16Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -17758,6 +17767,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -17780,6 +17790,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadBinaryI32': { @@ -17829,9 +17840,11 @@ { 'ctypes_data_type': 'numpy.int32', 'direction': 'out', + 'grpc_streaming_type': 'ArrayI32Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -17853,6 +17866,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -17875,6 +17889,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadBinaryU16': { @@ -17925,9 +17940,11 @@ 'coerced': True, 'ctypes_data_type': 'numpy.uint16', 'direction': 'out', + 'grpc_streaming_type': 'ArrayU16Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -17949,6 +17966,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -17971,6 +17989,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadBinaryU32': { @@ -18020,9 +18039,11 @@ { 'ctypes_data_type': 'numpy.uint32', 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -18044,6 +18065,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -18066,6 +18088,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadCounterF64': { @@ -18104,9 +18127,11 @@ { 'ctypes_data_type': 'numpy.float64', 'direction': 'out', + 'grpc_streaming_type': 'ArrayDoubleData', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'float', 'python_description': '', @@ -18128,6 +18153,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -18150,6 +18176,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadCounterF64Ex': { @@ -18199,9 +18226,11 @@ { 'ctypes_data_type': 'numpy.float64', 'direction': 'out', + 'grpc_streaming_type': 'ArrayDoubleData', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'float', 'python_description': '', @@ -18223,6 +18252,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -18245,6 +18275,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadCounterScalarF64': { @@ -18273,7 +18304,9 @@ { 'ctypes_data_type': 'ctypes.c_double', 'direction': 'out', + 'grpc_streaming_type': 'DoubleData', 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'value', 'python_data_type': 'float', 'python_description': '', @@ -18295,7 +18328,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'ReadCounterScalarU32': { 'calling_convention': 'StdCall', @@ -18323,7 +18357,9 @@ { 'ctypes_data_type': 'ctypes.c_uint', 'direction': 'out', + 'grpc_streaming_type': 'U32Data', 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'value', 'python_data_type': 'int', 'python_description': '', @@ -18345,7 +18381,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'ReadCounterU32': { 'calling_convention': 'StdCall', @@ -18383,9 +18420,11 @@ { 'ctypes_data_type': 'numpy.uint32', 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -18407,6 +18446,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -18429,6 +18469,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadCounterU32Ex': { @@ -18478,9 +18519,11 @@ { 'ctypes_data_type': 'numpy.uint32', 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -18502,6 +18545,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -18524,6 +18568,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadCtrFreq': { @@ -19148,7 +19193,9 @@ { 'ctypes_data_type': 'ctypes.c_uint', 'direction': 'out', + 'grpc_streaming_type': 'U32Data', 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'value', 'python_data_type': 'int', 'python_description': '', @@ -19170,7 +19217,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'ReadDigitalU16': { 'calling_convention': 'StdCall', @@ -19220,9 +19268,11 @@ 'coerced': True, 'ctypes_data_type': 'numpy.uint16', 'direction': 'out', + 'grpc_streaming_type': 'ArrayU16Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -19244,6 +19294,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -19266,6 +19317,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadDigitalU32': { @@ -19315,9 +19367,11 @@ { 'ctypes_data_type': 'numpy.uint32', 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', 'has_explicit_buffer_size': True, 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'readArray', 'python_data_type': 'int', 'python_description': '', @@ -19339,6 +19393,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanRead', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -19361,6 +19416,7 @@ ], 'python_codegen_method': 'CustomCode', 'returns': 'int32', + 'supports_streaming': True, 'timeout_error': 'DAQmxErrorSamplesNotYetAvailable' }, 'ReadDigitalU8': { @@ -23920,13 +23976,16 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'BoolData', + 'is_streaming_type': True, 'name': 'isLate', 'type': 'bool32' } ], 'python_codegen_method': 'no', 'python_description': 'Waits until the next pulse of the Sample Clock occurs. If an extra Sample Clock pulse occurs between calls to this VI, the second call returns an error or warning and waits for the next Sample Clock pulse. Use the Convert Late Errors to Warnings DAQmx Real-Time property to specify whether this function returns errors or warnings. If that property is True, any warnings this function returns do not include the **source** string. Use this function to ensure I/O cycles complete within Sample Clock periods. National Instruments recommends you use this function for certain applications only.', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WaitForValidTimestamp': { 'calling_convention': 'StdCall', @@ -24074,8 +24133,10 @@ { 'ctypes_data_type': 'numpy.float64', 'direction': 'in', + 'grpc_streaming_type': 'ArrayDoubleData', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'float', 'python_description': '', @@ -24087,6 +24148,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -24108,7 +24170,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteAnalogScalarF64': { 'calling_convention': 'StdCall', @@ -24146,7 +24209,9 @@ { 'ctypes_data_type': 'ctypes.c_double', 'direction': 'in', + 'grpc_streaming_type': 'DoubleData', 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'value', 'python_data_type': 'float', 'python_description': '', @@ -24168,7 +24233,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteBinaryI16': { 'calling_convention': 'StdCall', @@ -24228,8 +24294,10 @@ 'coerced': True, 'ctypes_data_type': 'numpy.int16', 'direction': 'in', + 'grpc_streaming_type': 'ArrayI16Data', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'int', 'python_description': '', @@ -24241,6 +24309,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -24262,7 +24331,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteBinaryI32': { 'calling_convention': 'StdCall', @@ -24321,8 +24391,10 @@ { 'ctypes_data_type': 'numpy.int32', 'direction': 'in', + 'grpc_streaming_type': 'ArrayI32Data', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'int', 'python_description': '', @@ -24334,6 +24406,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -24355,7 +24428,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteBinaryU16': { 'calling_convention': 'StdCall', @@ -24415,8 +24489,10 @@ 'coerced': True, 'ctypes_data_type': 'numpy.uint16', 'direction': 'in', + 'grpc_streaming_type': 'ArrayU16Data', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'int', 'python_description': '', @@ -24428,6 +24504,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -24449,7 +24526,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteBinaryU32': { 'calling_convention': 'StdCall', @@ -24508,8 +24586,10 @@ { 'ctypes_data_type': 'numpy.uint32', 'direction': 'in', + 'grpc_streaming_type': 'ArrayU32Data', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'int', 'python_description': '', @@ -24521,6 +24601,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -24542,7 +24623,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteCtrFreq': { 'calling_convention': 'StdCall', @@ -25179,7 +25261,9 @@ { 'ctypes_data_type': 'ctypes.c_uint', 'direction': 'in', + 'grpc_streaming_type': 'U32Data', 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'value', 'python_data_type': 'int', 'python_description': '', @@ -25201,7 +25285,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteDigitalU16': { 'calling_convention': 'StdCall', @@ -25261,8 +25346,10 @@ 'coerced': True, 'ctypes_data_type': 'numpy.uint16', 'direction': 'in', + 'grpc_streaming_type': 'ArrayU16Data', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'int', 'python_description': '', @@ -25274,6 +25361,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -25295,7 +25383,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteDigitalU32': { 'calling_convention': 'StdCall', @@ -25354,8 +25443,10 @@ { 'ctypes_data_type': 'numpy.uint32', 'direction': 'in', + 'grpc_streaming_type': 'ArrayU32Data', 'is_list': True, 'is_optional_in_python': False, + 'is_streaming_type': True, 'name': 'writeArray', 'python_data_type': 'int', 'python_description': '', @@ -25367,6 +25458,7 @@ 'direction': 'out', 'is_optional_in_python': False, 'name': 'sampsPerChanWritten', + 'is_streaming_type': True, 'python_data_type': 'int', 'python_description': '', 'python_type_annotation': 'int', @@ -25388,7 +25480,8 @@ } ], 'python_codegen_method': 'CustomCode', - 'returns': 'int32' + 'returns': 'int32', + 'supports_streaming': True }, 'WriteDigitalU8': { 'calling_convention': 'StdCall', diff --git a/source/codegen/service_helpers.py b/source/codegen/service_helpers.py index e4b62dc62..71dcbeb8c 100644 --- a/source/codegen/service_helpers.py +++ b/source/codegen/service_helpers.py @@ -718,9 +718,12 @@ def get_streaming_type(parameters) -> str: def get_size_param_name(streaming_param) -> str: - """Get the size parameter name for the given streaming parameter.""" - if common_helpers.is_array(streaming_param["type"]): - return streaming_param["size"]["value"] + """Get the size parameter name for the given streaming parameter. + + The size is only present for read arrays, which have an "out" direction. + """ + if common_helpers.is_array(streaming_param["type"]) and streaming_param["direction"] == "out": + return common_helpers.camel_to_snake(streaming_param["size"]["value"]) else: return None @@ -731,3 +734,14 @@ def get_c_api_name(function_name) -> str: base_name = function_name[len("Begin") :] return f"{base_name}" return f"{function_name}" + + +def is_secondary_streaming_param(param, first_streaming_param) -> bool: + """Check if a parameter is a secondry streaming type parameter.""" + return param.get("is_streaming_type", False) and param["name"] != first_streaming_param["name"] + + +def get_output_streaming_params_to_define(parameters, first_streaming_param) -> List[dict]: + """Get the list of output streaming parameters that need to be defined.""" + output_params = [p for p in parameters if common_helpers.is_output_parameter(p)] + return [p for p in output_params if is_secondary_streaming_param(p, first_streaming_param)] diff --git a/source/codegen/templates/service_helpers.mako b/source/codegen/templates/service_helpers.mako index c4358a0d6..22149771e 100644 --- a/source/codegen/templates/service_helpers.mako +++ b/source/codegen/templates/service_helpers.mako @@ -281,7 +281,7 @@ ${populate_response(function_data=function_data, parameters=parameters)}\ <%def name="define_moniker_streaming_struct(function_name, parameters)">\ <% config = data['config'] - streaming_param = common_helpers.get_streaming_parameter(parameters) + streaming_param = common_helpers.get_first_streaming_parameter(parameters) service_class_prefix = config["service_class_prefix"] grpc_streaming_type = streaming_param['grpc_streaming_type'] struct_name = common_helpers.get_data_moniker_struct_name(function_name) @@ -293,7 +293,11 @@ ${populate_response(function_data=function_data, parameters=parameters)}\ <% parameter_name = common_helpers.get_cpp_local_name(parameter) %>\ +% if parameter.get('pointer', False): + ${parameter['type']}* ${parameter_name}; +% else: ${parameter['type']} ${parameter_name}; +% endif % endfor ${service_class_prefix.lower()}_grpc::${grpc_streaming_type} data; std::shared_ptr<${service_class_prefix}LibraryInterface> library; @@ -305,7 +309,7 @@ ${populate_response(function_data=function_data, parameters=parameters)}\ config = data['config'] struct_name = common_helpers.get_data_moniker_struct_name(function_name) moniker_function_name = common_helpers.get_data_moniker_function_name(function_name) - streaming_param = common_helpers.get_streaming_parameter(function_data['parameters']) + streaming_param = common_helpers.get_first_streaming_parameter(function_data['parameters']) streaming_type = streaming_param['type'] grpc_streaming_type = streaming_param['grpc_streaming_type'] arg_string = service_helpers.create_args(function_data['parameters']) @@ -313,17 +317,19 @@ ${populate_response(function_data=function_data, parameters=parameters)}\ data_type = streaming_type.replace("[]", "") c_api_name = service_helpers.get_c_api_name(function_name) streaming_params_to_include = common_helpers.get_input_streaming_params(function_data['parameters']) + output_params_to_define = service_helpers.get_output_streaming_params_to_define(function_data['parameters'], streaming_param) %>\ ::grpc::Status ${moniker_function_name}(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) { ${struct_name}* function_data = static_cast<${struct_name}*>(data); auto library = function_data->library;\ - ${initialize_moniker_streaming_parameters(streaming_params_to_include)}\ - % if streaming_param and streaming_param['direction'] == 'out': - ${streaming_handle_out_direction(c_api_name, arg_string, data_type, streaming_type, streaming_param)}\ - % elif streaming_param and streaming_param['direction'] == 'in': - ${streaming_handle_in_direction(c_api_name, arg_string, data_type, grpc_streaming_type, streaming_type, streaming_param)}\ - % endif +${initialize_moniker_input_parameters(streaming_params_to_include)}\ +${initialize_moniker_output_parameters(output_params_to_define)}\ + % if streaming_param and streaming_param['direction'] == 'out': +${streaming_handle_out_direction(c_api_name, arg_string, data_type, streaming_type, streaming_param)}\ + % elif streaming_param and streaming_param['direction'] == 'in': +${streaming_handle_in_direction(c_api_name, arg_string, data_type, grpc_streaming_type, streaming_type, streaming_param)}\ + % endif if (status < 0) { std::cout << "${moniker_function_name} error: " << status << std::endl; } @@ -340,14 +346,14 @@ ${populate_response(function_data=function_data, parameters=parameters)}\ response_param = service_helpers.get_response_param(function_name) struct_name = common_helpers.get_data_moniker_struct_name(function_name) moniker_function_name = common_helpers.get_data_moniker_function_name(function_name) - streaming_param = common_helpers.get_streaming_parameter(parameters) + streaming_param = common_helpers.get_first_streaming_parameter(parameters) streaming_params_to_include = common_helpers.get_input_streaming_params(parameters) %>\ ${initialize_streaming_input_param(function_name, streaming_params_to_include, parameters, streaming_param)} auto data = std::make_unique<${struct_name}>();\ ${initialize_begin_input_params(streaming_params_to_include, streaming_param)}\ data->library = std::shared_ptr<${service_class_prefix}LibraryInterface>(library_); - ${initialize_service_output_params(output_params)}\ + ${initialize_service_output_params(output_params, streaming_param)}\ auto moniker = std::make_unique(); ni::data_monikers::DataMonikerService::RegisterMonikerInstance("${moniker_function_name}", data.release(), *moniker); response->set_allocated_moniker(moniker.release()); @@ -362,29 +368,34 @@ ${initialize_streaming_input_param(function_name, streaming_params_to_include, p % if is_array: ${streaming_handle_out_direction_array(c_api_name, arg_string, data_type, streaming_param)} % else: - ${streaming_handle_out_direction_scaler(c_api_name, arg_string, streaming_type)} + ${streaming_handle_out_direction_scaler(c_api_name, arg_string, streaming_param)} % endif <%def name="streaming_handle_out_direction_array(c_api_name, arg_string, data_type, streaming_param)">\ <% is_coerced = service_helpers.is_output_array_that_needs_coercion(streaming_param) - size = service_helpers.get_size_param_name(streaming_param) + size_param_name = service_helpers.get_size_param_name(streaming_param) + streaming_param_name = common_helpers.camel_to_snake(streaming_param['name']) + underlying_param_type = common_helpers.get_underlying_type_name(streaming_param["type"]) %>\ % if common_helpers.supports_standard_copy_conversion_routines(streaming_param): -std::vector<${data_type}> array(${size}, ${data_type}()); +std::vector<${data_type}> ${streaming_param_name}(${size_param_name}, ${data_type}()); % elif is_coerced: -std::vector<${data_type}> array(${size}); +std::vector<${data_type}> ${streaming_param_name}(${size_param_name}); +% elif common_helpers.is_driver_typedef_with_same_size_but_different_qualifiers(underlying_param_type): +function_data->data.mutable_value()->Resize(${size_param_name}, 0); + auto ${streaming_param_name} = reinterpret_cast<${underlying_param_type}*>(function_data->data.mutable_value()->mutable_data()); % else: -function_data->data.mutable_value()->Resize(${size}, 0); - auto array = function_data->data.mutable_value()->mutable_data(); +function_data->data.mutable_value()->Resize(${size_param_name}, 0); + auto ${streaming_param_name} = function_data->data.mutable_value()->mutable_data(); % endif auto status = library->${c_api_name}(${arg_string}); if (status >= 0) { % if is_coerced or common_helpers.supports_standard_copy_conversion_routines(streaming_param): std::transform( - array.begin(), - array.begin() + ${size}, + ${streaming_param_name}.begin(), + ${streaming_param_name}.begin() + ${size_param_name}, function_data->data.mutable_value()->begin(), [&](auto x) { return x; @@ -394,10 +405,14 @@ function_data->data.mutable_value()->Resize(${size}, 0); } -<%def name="streaming_handle_out_direction_scaler(c_api_name, arg_string, streaming_type)">\ -${streaming_type} value {}; +<%def name="streaming_handle_out_direction_scaler(c_api_name, arg_string, streaming_param)">\ +<% + parameter_name = common_helpers.get_cpp_local_name(streaming_param) +%>\ +${streaming_param['type']} ${parameter_name} {};\ + auto status = library->${c_api_name}(${arg_string}); - function_data->data.set_value(value); + function_data->data.set_value(${parameter_name}); if (status >= 0) { packedData.PackFrom(function_data->data); } @@ -434,30 +449,38 @@ auto value = ${grpc_streaming_type.lower()}_message.value(); <%def name="streaming_handle_in_direction_array(data_type, grpc_streaming_type, streaming_param)"> <% is_coerced = service_helpers.is_input_array_that_needs_coercion(streaming_param) + c_element_type_that_needs_coercion = service_helpers.get_c_element_type_for_array_that_needs_coercion(streaming_param) + streaming_param_name = common_helpers.camel_to_snake(streaming_param['name']) + underlying_param_type = common_helpers.get_underlying_type_name(streaming_param["type"]).replace("const ", "") + %>\ % if common_helpers.supports_standard_copy_conversion_routines(streaming_param): auto data_array = ${grpc_streaming_type.lower()}_message.value(); - std::vector<${data_type}> array(data_array.begin(), data_array.end()); + std::vector<${data_type}> ${streaming_param_name}(data_array.begin(), data_array.end()); auto size = data_array.size(); % elif is_coerced: auto data_array = ${grpc_streaming_type.lower()}_message.value(); - auto array = std::vector<${data_type}>(); + auto ${streaming_param_name} = std::vector<${c_element_type_that_needs_coercion}>(); auto size = data_array.size(); - array.reserve(size); + ${streaming_param_name}.reserve(size); std::transform( data_array.begin(), data_array.end(), - std::back_inserter(array), + std::back_inserter(${streaming_param_name}), [](auto x) { - if (x < std::numeric_limits<${data_type}>::min() || x > std::numeric_limits<${data_type}>::max()) { - std::string message("value " + std::to_string(x) + " doesn't fit in datatype ${data_type}"); + if (x < std::numeric_limits<${c_element_type_that_needs_coercion}>::min() || x > std::numeric_limits<${c_element_type_that_needs_coercion}>::max()) { + std::string message("value " + std::to_string(x) + " doesn't fit in datatype ${c_element_type_that_needs_coercion}"); throw nidevice_grpc::ValueOutOfRangeException(message); } - return static_cast<${data_type}>(x); + return static_cast<${c_element_type_that_needs_coercion}>(x); }); % else: auto data_array = ${grpc_streaming_type.lower()}_message.value(); - auto array = const_cast<${data_type}*>(${grpc_streaming_type.lower()}_message.value().data()); +% if common_helpers.is_driver_typedef_with_same_size_but_different_qualifiers(underlying_param_type): + auto ${streaming_param_name} = reinterpret_cast<${data_type}*>(${grpc_streaming_type.lower()}_message.value().data()); +% else: + auto ${streaming_param_name} = const_cast<${data_type}*>(${grpc_streaming_type.lower()}_message.value().data()); +% endif auto size = data_array.size(); % endif @@ -479,7 +502,7 @@ ${initialize_input_param(function_name, param, parameters)}\ % endfor -<%def name="initialize_moniker_streaming_parameters(streaming_params_to_include)"> +<%def name="initialize_moniker_input_parameters(streaming_params_to_include)"> % for parameter in streaming_params_to_include: <% parameter_name = common_helpers.get_cpp_local_name(parameter) @@ -488,11 +511,23 @@ ${initialize_input_param(function_name, param, parameters)}\ % endfor -<%def name="initialize_service_output_params(output_params)"> +<%def name="initialize_moniker_output_parameters(output_params_to_define)">\ +% for parameter in output_params_to_define: +<% + parameter_name = common_helpers.get_cpp_local_name(parameter) +%> + ${parameter['type']} ${parameter_name} = {};\ +% endfor + + +<%def name="initialize_service_output_params(output_params, streaming_param)">\ +<% + size_param_name = service_helpers.get_size_param_name(streaming_param) +%> % for param in output_params: % if common_helpers.is_array(param['type']): - data->data.mutable_value()->Reserve(request->size()); - data->data.mutable_value()->Resize(request->size(), 0); + data->data.mutable_value()->Reserve(request->${size_param_name}()); + data->data.mutable_value()->Resize(request->${size_param_name}(), 0); % endif % endfor