diff --git a/generated/nifpga/nifpga.proto b/generated/nifpga/nifpga.proto index efeeba644..e7cb4f824 100644 --- a/generated/nifpga/nifpga.proto +++ b/generated/nifpga/nifpga.proto @@ -6,6 +6,7 @@ //--------------------------------------------------------------------- syntax = "proto3"; +option cc_enable_arenas = true; option java_multiple_files = true; option java_package = "com.ni.grpc.nifpga"; option java_outer_classname = "NiFpga"; @@ -14,6 +15,7 @@ option csharp_namespace = "NationalInstruments.Grpc.NiFpga"; package nifpga_grpc; import "session.proto"; +import "data_moniker.proto"; service NiFpga { rpc Abort(AbortRequest) returns (AbortResponse); @@ -33,17 +35,27 @@ service NiFpga { rpc GetFpgaViState(GetFpgaViStateRequest) returns (GetFpgaViStateResponse); rpc Open(OpenRequest) returns (OpenResponse); rpc ReadArrayBool(ReadArrayBoolRequest) returns (ReadArrayBoolResponse); + rpc BeginReadArrayBool(BeginReadArrayBoolRequest) returns (BeginReadArrayBoolResponse); rpc ReadArrayDbl(ReadArrayDblRequest) returns (ReadArrayDblResponse); rpc ReadArrayI16(ReadArrayI16Request) returns (ReadArrayI16Response); + rpc BeginReadArrayI16(BeginReadArrayI16Request) returns (BeginReadArrayI16Response); rpc ReadArrayI32(ReadArrayI32Request) returns (ReadArrayI32Response); + rpc BeginReadArrayI32(BeginReadArrayI32Request) returns (BeginReadArrayI32Response); rpc ReadArrayI64(ReadArrayI64Request) returns (ReadArrayI64Response); + rpc BeginReadArrayI64(BeginReadArrayI64Request) returns (BeginReadArrayI64Response); rpc ReadArrayI8(ReadArrayI8Request) returns (ReadArrayI8Response); + rpc BeginReadArrayI8(BeginReadArrayI8Request) returns (BeginReadArrayI8Response); rpc ReadArraySgl(ReadArraySglRequest) returns (ReadArraySglResponse); rpc ReadArrayU16(ReadArrayU16Request) returns (ReadArrayU16Response); + rpc BeginReadArrayU16(BeginReadArrayU16Request) returns (BeginReadArrayU16Response); rpc ReadArrayU32(ReadArrayU32Request) returns (ReadArrayU32Response); + rpc BeginReadArrayU32(BeginReadArrayU32Request) returns (BeginReadArrayU32Response); rpc ReadArrayU64(ReadArrayU64Request) returns (ReadArrayU64Response); + rpc BeginReadArrayU64(BeginReadArrayU64Request) returns (BeginReadArrayU64Response); rpc ReadArrayU8(ReadArrayU8Request) returns (ReadArrayU8Response); + rpc BeginReadArrayU8(BeginReadArrayU8Request) returns (BeginReadArrayU8Response); rpc ReadBool(ReadBoolRequest) returns (ReadBoolResponse); + rpc BeginReadBool(BeginReadBoolRequest) returns (BeginReadBoolResponse); rpc ReadDbl(ReadDblRequest) returns (ReadDblResponse); rpc ReadFifoBool(ReadFifoBoolRequest) returns (ReadFifoBoolResponse); rpc ReadFifoDbl(ReadFifoDblRequest) returns (ReadFifoDblResponse); @@ -57,14 +69,22 @@ service NiFpga { rpc ReadFifoU64(ReadFifoU64Request) returns (ReadFifoU64Response); rpc ReadFifoU8(ReadFifoU8Request) returns (ReadFifoU8Response); rpc ReadI16(ReadI16Request) returns (ReadI16Response); + rpc BeginReadI16(BeginReadI16Request) returns (BeginReadI16Response); rpc ReadI32(ReadI32Request) returns (ReadI32Response); + rpc BeginReadI32(BeginReadI32Request) returns (BeginReadI32Response); rpc ReadI64(ReadI64Request) returns (ReadI64Response); + rpc BeginReadI64(BeginReadI64Request) returns (BeginReadI64Response); rpc ReadI8(ReadI8Request) returns (ReadI8Response); + rpc BeginReadI8(BeginReadI8Request) returns (BeginReadI8Response); rpc ReadSgl(ReadSglRequest) returns (ReadSglResponse); rpc ReadU16(ReadU16Request) returns (ReadU16Response); + rpc BeginReadU16(BeginReadU16Request) returns (BeginReadU16Response); rpc ReadU32(ReadU32Request) returns (ReadU32Response); + rpc BeginReadU32(BeginReadU32Request) returns (BeginReadU32Response); rpc ReadU64(ReadU64Request) returns (ReadU64Response); + rpc BeginReadU64(BeginReadU64Request) returns (BeginReadU64Response); rpc ReadU8(ReadU8Request) returns (ReadU8Response); + rpc BeginReadU8(BeginReadU8Request) returns (BeginReadU8Response); rpc ReleaseFifoElements(ReleaseFifoElementsRequest) returns (ReleaseFifoElementsResponse); rpc Reset(ResetRequest) returns (ResetResponse); rpc Run(RunRequest) returns (RunResponse); @@ -77,17 +97,27 @@ service NiFpga { rpc UnreserveFifo(UnreserveFifoRequest) returns (UnreserveFifoResponse); rpc WaitOnIrqs(WaitOnIrqsRequest) returns (WaitOnIrqsResponse); rpc WriteArrayBool(WriteArrayBoolRequest) returns (WriteArrayBoolResponse); + rpc BeginWriteArrayBool(BeginWriteArrayBoolRequest) returns (BeginWriteArrayBoolResponse); rpc WriteArrayDbl(WriteArrayDblRequest) returns (WriteArrayDblResponse); rpc WriteArrayI16(WriteArrayI16Request) returns (WriteArrayI16Response); + rpc BeginWriteArrayI16(BeginWriteArrayI16Request) returns (BeginWriteArrayI16Response); rpc WriteArrayI32(WriteArrayI32Request) returns (WriteArrayI32Response); + rpc BeginWriteArrayI32(BeginWriteArrayI32Request) returns (BeginWriteArrayI32Response); rpc WriteArrayI64(WriteArrayI64Request) returns (WriteArrayI64Response); + rpc BeginWriteArrayI64(BeginWriteArrayI64Request) returns (BeginWriteArrayI64Response); rpc WriteArrayI8(WriteArrayI8Request) returns (WriteArrayI8Response); + rpc BeginWriteArrayI8(BeginWriteArrayI8Request) returns (BeginWriteArrayI8Response); rpc WriteArraySgl(WriteArraySglRequest) returns (WriteArraySglResponse); rpc WriteArrayU16(WriteArrayU16Request) returns (WriteArrayU16Response); + rpc BeginWriteArrayU16(BeginWriteArrayU16Request) returns (BeginWriteArrayU16Response); rpc WriteArrayU32(WriteArrayU32Request) returns (WriteArrayU32Response); + rpc BeginWriteArrayU32(BeginWriteArrayU32Request) returns (BeginWriteArrayU32Response); rpc WriteArrayU64(WriteArrayU64Request) returns (WriteArrayU64Response); + rpc BeginWriteArrayU64(BeginWriteArrayU64Request) returns (BeginWriteArrayU64Response); rpc WriteArrayU8(WriteArrayU8Request) returns (WriteArrayU8Response); + rpc BeginWriteArrayU8(BeginWriteArrayU8Request) returns (BeginWriteArrayU8Response); rpc WriteBool(WriteBoolRequest) returns (WriteBoolResponse); + rpc BeginWriteBool(BeginWriteBoolRequest) returns (BeginWriteBoolResponse); rpc WriteDbl(WriteDblRequest) returns (WriteDblResponse); rpc WriteFifoBool(WriteFifoBoolRequest) returns (WriteFifoBoolResponse); rpc WriteFifoDbl(WriteFifoDblRequest) returns (WriteFifoDblResponse); @@ -101,14 +131,22 @@ service NiFpga { rpc WriteFifoU64(WriteFifoU64Request) returns (WriteFifoU64Response); rpc WriteFifoU8(WriteFifoU8Request) returns (WriteFifoU8Response); rpc WriteI16(WriteI16Request) returns (WriteI16Response); + rpc BeginWriteI16(BeginWriteI16Request) returns (BeginWriteI16Response); rpc WriteI32(WriteI32Request) returns (WriteI32Response); + rpc BeginWriteI32(BeginWriteI32Request) returns (BeginWriteI32Response); rpc WriteI64(WriteI64Request) returns (WriteI64Response); + rpc BeginWriteI64(BeginWriteI64Request) returns (BeginWriteI64Response); rpc WriteI8(WriteI8Request) returns (WriteI8Response); + rpc BeginWriteI8(BeginWriteI8Request) returns (BeginWriteI8Response); rpc WriteSgl(WriteSglRequest) returns (WriteSglResponse); rpc WriteU16(WriteU16Request) returns (WriteU16Response); + rpc BeginWriteU16(BeginWriteU16Request) returns (BeginWriteU16Response); rpc WriteU32(WriteU32Request) returns (WriteU32Response); + rpc BeginWriteU32(BeginWriteU32Request) returns (BeginWriteU32Response); rpc WriteU64(WriteU64Request) returns (WriteU64Response); + rpc BeginWriteU64(BeginWriteU64Request) returns (BeginWriteU64Response); rpc WriteU8(WriteU8Request) returns (WriteU8Response); + rpc BeginWriteU8(BeginWriteU8Request) returns (BeginWriteU8Response); } enum CloseAttribute { @@ -198,6 +236,45 @@ enum RunAttribute { RUN_ATTRIBUTE_WAIT_UNTIL_DONE = 1; } +message I32Data { + int32 value = 1; +} + +message U32Data { + uint32 value = 1; +} + +message I64Data { + int64 value = 1; +} + +message U64Data { + uint64 value = 1; +} + +message BoolData { + bool value = 1; +} + +message ArrayI32Data { + repeated int32 value = 1; +} + +message ArrayU32Data { + repeated uint32 value = 1; +} + +message ArrayI64Data { + repeated int64 value = 1; +} + +message ArrayU64Data { + repeated uint64 value = 1; +} + +message ArrayBoolData { + repeated bool value = 1; +} message AbortRequest { nidevice_grpc.Session session = 1; } @@ -390,6 +467,17 @@ message ReadArrayBoolResponse { repeated bool array = 2; } +message BeginReadArrayBoolRequest { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayBoolResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayDblRequest { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -412,6 +500,17 @@ message ReadArrayI16Response { repeated int32 array = 2; } +message BeginReadArrayI16Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayI16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayI32Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -423,6 +522,17 @@ message ReadArrayI32Response { repeated int32 array = 2; } +message BeginReadArrayI32Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayI32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayI64Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -434,6 +544,17 @@ message ReadArrayI64Response { repeated int64 array = 2; } +message BeginReadArrayI64Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayI64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayI8Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -445,6 +566,17 @@ message ReadArrayI8Response { repeated int32 array = 2; } +message BeginReadArrayI8Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayI8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArraySglRequest { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -467,6 +599,17 @@ message ReadArrayU16Response { repeated uint32 array = 2; } +message BeginReadArrayU16Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayU32Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -478,6 +621,17 @@ message ReadArrayU32Response { repeated uint32 array = 2; } +message BeginReadArrayU32Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayU64Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -489,6 +643,17 @@ message ReadArrayU64Response { repeated uint64 array = 2; } +message BeginReadArrayU64Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayU64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadArrayU8Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -500,6 +665,17 @@ message ReadArrayU8Response { repeated uint32 array = 2; } +message BeginReadArrayU8Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; + uint32 size = 3; +} + +message BeginReadArrayU8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadBoolRequest { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -510,6 +686,16 @@ message ReadBoolResponse { bool value = 2; } +message BeginReadBoolRequest { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadBoolResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadDblRequest { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -673,6 +859,16 @@ message ReadI16Response { int32 value = 2; } +message BeginReadI16Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadI16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadI32Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -683,6 +879,16 @@ message ReadI32Response { int32 value = 2; } +message BeginReadI32Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadI32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadI64Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -693,6 +899,16 @@ message ReadI64Response { int64 value = 2; } +message BeginReadI64Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadI64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadI8Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -703,6 +919,16 @@ message ReadI8Response { int32 value = 2; } +message BeginReadI8Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadI8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadSglRequest { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -723,6 +949,16 @@ message ReadU16Response { uint32 value = 2; } +message BeginReadU16Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadU32Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -733,6 +969,16 @@ message ReadU32Response { uint32 value = 2; } +message BeginReadU32Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadU64Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -743,6 +989,16 @@ message ReadU64Response { uint64 value = 2; } +message BeginReadU64Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadU64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReadU8Request { nidevice_grpc.Session session = 1; uint32 indicator = 2; @@ -753,6 +1009,16 @@ message ReadU8Response { uint32 value = 2; } +message BeginReadU8Request { + nidevice_grpc.Session session = 1; + uint32 indicator = 2; +} + +message BeginReadU8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message ReleaseFifoElementsRequest { nidevice_grpc.Session session = 1; uint32 fifo = 2; @@ -888,6 +1154,16 @@ message WriteArrayBoolResponse { int32 status = 1; } +message BeginWriteArrayBoolRequest { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayBoolResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayDblRequest { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -908,6 +1184,16 @@ message WriteArrayI16Response { int32 status = 1; } +message BeginWriteArrayI16Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayI16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayI32Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -918,6 +1204,16 @@ message WriteArrayI32Response { int32 status = 1; } +message BeginWriteArrayI32Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayI32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayI64Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -928,6 +1224,16 @@ message WriteArrayI64Response { int32 status = 1; } +message BeginWriteArrayI64Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayI64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayI8Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -938,6 +1244,16 @@ message WriteArrayI8Response { int32 status = 1; } +message BeginWriteArrayI8Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayI8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArraySglRequest { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -958,6 +1274,16 @@ message WriteArrayU16Response { int32 status = 1; } +message BeginWriteArrayU16Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayU32Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -968,6 +1294,16 @@ message WriteArrayU32Response { int32 status = 1; } +message BeginWriteArrayU32Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayU64Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -978,6 +1314,16 @@ message WriteArrayU64Response { int32 status = 1; } +message BeginWriteArrayU64Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayU64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteArrayU8Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -988,6 +1334,16 @@ message WriteArrayU8Response { int32 status = 1; } +message BeginWriteArrayU8Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteArrayU8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteBoolRequest { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -998,6 +1354,16 @@ message WriteBoolResponse { int32 status = 1; } +message BeginWriteBoolRequest { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteBoolResponse { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteDblRequest { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1150,6 +1516,16 @@ message WriteI16Response { int32 status = 1; } +message BeginWriteI16Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteI16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteI32Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1160,6 +1536,16 @@ message WriteI32Response { int32 status = 1; } +message BeginWriteI32Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteI32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteI64Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1170,6 +1556,16 @@ message WriteI64Response { int32 status = 1; } +message BeginWriteI64Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteI64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteI8Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1180,6 +1576,16 @@ message WriteI8Response { int32 status = 1; } +message BeginWriteI8Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteI8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteSglRequest { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1200,6 +1606,16 @@ message WriteU16Response { int32 status = 1; } +message BeginWriteU16Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteU16Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteU32Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1210,6 +1626,16 @@ message WriteU32Response { int32 status = 1; } +message BeginWriteU32Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteU32Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteU64Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1220,6 +1646,16 @@ message WriteU64Response { int32 status = 1; } +message BeginWriteU64Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteU64Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + message WriteU8Request { nidevice_grpc.Session session = 1; uint32 control = 2; @@ -1230,3 +1666,13 @@ message WriteU8Response { int32 status = 1; } +message BeginWriteU8Request { + nidevice_grpc.Session session = 1; + uint32 control = 2; +} + +message BeginWriteU8Response { + int32 status = 1; + ni.data_monikers.Moniker moniker = 2; +} + diff --git a/generated/nifpga/nifpga_client.cpp b/generated/nifpga/nifpga_client.cpp index 0aebb58ad..ac2871b6f 100644 --- a/generated/nifpga/nifpga_client.cpp +++ b/generated/nifpga/nifpga_client.cpp @@ -371,6 +371,25 @@ read_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginReadArrayBoolResponse +begin_read_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayBoolRequest{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayBoolResponse{}; + + raise_if_error( + stub->BeginReadArrayBool(&context, request, &response), + context); + + return response; +} + ReadArrayDblResponse read_array_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -409,6 +428,25 @@ read_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayI16Response +begin_read_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayI16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayI16Response{}; + + raise_if_error( + stub->BeginReadArrayI16(&context, request, &response), + context); + + return response; +} + ReadArrayI32Response read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -428,6 +466,25 @@ read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayI32Response +begin_read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayI32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayI32Response{}; + + raise_if_error( + stub->BeginReadArrayI32(&context, request, &response), + context); + + return response; +} + ReadArrayI64Response read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -447,6 +504,25 @@ read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayI64Response +begin_read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayI64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayI64Response{}; + + raise_if_error( + stub->BeginReadArrayI64(&context, request, &response), + context); + + return response; +} + ReadArrayI8Response read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -466,6 +542,25 @@ read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayI8Response +begin_read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayI8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayI8Response{}; + + raise_if_error( + stub->BeginReadArrayI8(&context, request, &response), + context); + + return response; +} + ReadArraySglResponse read_array_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -504,6 +599,25 @@ read_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayU16Response +begin_read_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayU16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayU16Response{}; + + raise_if_error( + stub->BeginReadArrayU16(&context, request, &response), + context); + + return response; +} + ReadArrayU32Response read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -523,6 +637,25 @@ read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayU32Response +begin_read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayU32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayU32Response{}; + + raise_if_error( + stub->BeginReadArrayU32(&context, request, &response), + context); + + return response; +} + ReadArrayU64Response read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -542,6 +675,25 @@ read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayU64Response +begin_read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayU64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayU64Response{}; + + raise_if_error( + stub->BeginReadArrayU64(&context, request, &response), + context); + + return response; +} + ReadArrayU8Response read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) { @@ -561,6 +713,25 @@ read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginReadArrayU8Response +begin_read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size) +{ + ::grpc::ClientContext context; + + auto request = BeginReadArrayU8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + request.set_size(size); + + auto response = BeginReadArrayU8Response{}; + + raise_if_error( + stub->BeginReadArrayU8(&context, request, &response), + context); + + return response; +} + ReadBoolResponse read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -579,6 +750,24 @@ read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginReadBoolResponse +begin_read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadBoolRequest{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadBoolResponse{}; + + raise_if_error( + stub->BeginReadBool(&context, request, &response), + context); + + return response; +} + ReadDblResponse read_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -835,6 +1024,24 @@ read_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginReadI16Response +begin_read_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadI16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadI16Response{}; + + raise_if_error( + stub->BeginReadI16(&context, request, &response), + context); + + return response; +} + ReadI32Response read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -853,6 +1060,24 @@ read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginReadI32Response +begin_read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadI32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadI32Response{}; + + raise_if_error( + stub->BeginReadI32(&context, request, &response), + context); + + return response; +} + ReadI64Response read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -871,6 +1096,24 @@ read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginReadI64Response +begin_read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadI64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadI64Response{}; + + raise_if_error( + stub->BeginReadI64(&context, request, &response), + context); + + return response; +} + ReadI8Response read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -889,6 +1132,24 @@ read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::ui return response; } +BeginReadI8Response +begin_read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadI8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadI8Response{}; + + raise_if_error( + stub->BeginReadI8(&context, request, &response), + context); + + return response; +} + ReadSglResponse read_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -925,6 +1186,24 @@ read_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginReadU16Response +begin_read_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadU16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadU16Response{}; + + raise_if_error( + stub->BeginReadU16(&context, request, &response), + context); + + return response; +} + ReadU32Response read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -943,6 +1222,24 @@ read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginReadU32Response +begin_read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadU32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadU32Response{}; + + raise_if_error( + stub->BeginReadU32(&context, request, &response), + context); + + return response; +} + ReadU64Response read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -961,6 +1258,24 @@ read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginReadU64Response +begin_read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadU64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadU64Response{}; + + raise_if_error( + stub->BeginReadU64(&context, request, &response), + context); + + return response; +} + ReadU8Response read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) { @@ -979,6 +1294,24 @@ read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::ui return response; } +BeginReadU8Response +begin_read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator) +{ + ::grpc::ClientContext context; + + auto request = BeginReadU8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_indicator(indicator); + + auto response = BeginReadU8Response{}; + + raise_if_error( + stub->BeginReadU8(&context, request, &response), + context); + + return response; +} + ReleaseFifoElementsResponse release_fifo_elements(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& elements) { @@ -1240,6 +1573,24 @@ write_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, con return response; } +BeginWriteArrayBoolResponse +begin_write_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayBoolRequest{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayBoolResponse{}; + + raise_if_error( + stub->BeginWriteArrayBool(&context, request, &response), + context); + + return response; +} + WriteArrayDblResponse write_array_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1278,6 +1629,24 @@ write_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginWriteArrayI16Response +begin_write_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayI16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayI16Response{}; + + raise_if_error( + stub->BeginWriteArrayI16(&context, request, &response), + context); + + return response; +} + WriteArrayI32Response write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1297,6 +1666,24 @@ write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginWriteArrayI32Response +begin_write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayI32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayI32Response{}; + + raise_if_error( + stub->BeginWriteArrayI32(&context, request, &response), + context); + + return response; +} + WriteArrayI64Response write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1316,6 +1703,24 @@ write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginWriteArrayI64Response +begin_write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayI64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayI64Response{}; + + raise_if_error( + stub->BeginWriteArrayI64(&context, request, &response), + context); + + return response; +} + WriteArrayI8Response write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1335,6 +1740,24 @@ write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginWriteArrayI8Response +begin_write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayI8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayI8Response{}; + + raise_if_error( + stub->BeginWriteArrayI8(&context, request, &response), + context); + + return response; +} + WriteArraySglResponse write_array_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1373,6 +1796,24 @@ write_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginWriteArrayU16Response +begin_write_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayU16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayU16Response{}; + + raise_if_error( + stub->BeginWriteArrayU16(&context, request, &response), + context); + + return response; +} + WriteArrayU32Response write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1392,6 +1833,24 @@ write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginWriteArrayU32Response +begin_write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayU32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayU32Response{}; + + raise_if_error( + stub->BeginWriteArrayU32(&context, request, &response), + context); + + return response; +} + WriteArrayU64Response write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1411,6 +1870,24 @@ write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, cons return response; } +BeginWriteArrayU64Response +begin_write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayU64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayU64Response{}; + + raise_if_error( + stub->BeginWriteArrayU64(&context, request, &response), + context); + + return response; +} + WriteArrayU8Response write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array) { @@ -1430,6 +1907,24 @@ write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const return response; } +BeginWriteArrayU8Response +begin_write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteArrayU8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteArrayU8Response{}; + + raise_if_error( + stub->BeginWriteArrayU8(&context, request, &response), + context); + + return response; +} + WriteBoolResponse write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const bool& value) { @@ -1449,6 +1944,24 @@ write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb: return response; } +BeginWriteBoolResponse +begin_write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteBoolRequest{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteBoolResponse{}; + + raise_if_error( + stub->BeginWriteBool(&context, request, &response), + context); + + return response; +} + WriteDblResponse write_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const double& value) { @@ -1707,6 +2220,24 @@ write_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginWriteI16Response +begin_write_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteI16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteI16Response{}; + + raise_if_error( + stub->BeginWriteI16(&context, request, &response), + context); + + return response; +} + WriteI32Response write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value) { @@ -1726,6 +2257,24 @@ write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginWriteI32Response +begin_write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteI32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteI32Response{}; + + raise_if_error( + stub->BeginWriteI32(&context, request, &response), + context); + + return response; +} + WriteI64Response write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int64& value) { @@ -1745,6 +2294,24 @@ write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginWriteI64Response +begin_write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteI64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteI64Response{}; + + raise_if_error( + stub->BeginWriteI64(&context, request, &response), + context); + + return response; +} + WriteI8Response write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value) { @@ -1764,6 +2331,24 @@ write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginWriteI8Response +begin_write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteI8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteI8Response{}; + + raise_if_error( + stub->BeginWriteI8(&context, request, &response), + context); + + return response; +} + WriteSglResponse write_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const float& value) { @@ -1802,6 +2387,24 @@ write_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginWriteU16Response +begin_write_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteU16Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteU16Response{}; + + raise_if_error( + stub->BeginWriteU16(&context, request, &response), + context); + + return response; +} + WriteU32Response write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value) { @@ -1821,6 +2424,24 @@ write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginWriteU32Response +begin_write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteU32Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteU32Response{}; + + raise_if_error( + stub->BeginWriteU32(&context, request, &response), + context); + + return response; +} + WriteU64Response write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint64& value) { @@ -1840,6 +2461,24 @@ write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb:: return response; } +BeginWriteU64Response +begin_write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteU64Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteU64Response{}; + + raise_if_error( + stub->BeginWriteU64(&context, request, &response), + context); + + return response; +} + WriteU8Response write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value) { @@ -1859,5 +2498,23 @@ write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::u return response; } +BeginWriteU8Response +begin_write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control) +{ + ::grpc::ClientContext context; + + auto request = BeginWriteU8Request{}; + request.mutable_session()->CopyFrom(session); + request.set_control(control); + + auto response = BeginWriteU8Response{}; + + raise_if_error( + stub->BeginWriteU8(&context, request, &response), + context); + + return response; +} + } // namespace nifpga_grpc::experimental::client diff --git a/generated/nifpga/nifpga_client.h b/generated/nifpga/nifpga_client.h index 76d25aeac..f021b3c59 100644 --- a/generated/nifpga/nifpga_client.h +++ b/generated/nifpga/nifpga_client.h @@ -39,17 +39,27 @@ GetFifoPropertyU64Response get_fifo_property_u64(const StubPtr& stub, const nide GetFpgaViStateResponse get_fpga_vi_state(const StubPtr& stub, const nidevice_grpc::Session& session); OpenResponse open(const StubPtr& stub, const std::string& bitfile, const std::string& signature, const std::string& resource, const simple_variant& attribute, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED); ReadArrayBoolResponse read_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayBoolResponse begin_read_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayDblResponse read_array_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayI16Response read_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayI16Response begin_read_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayI32Response read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayI32Response begin_read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayI64Response read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayI64Response begin_read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayI8Response read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayI8Response begin_read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArraySglResponse read_array_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayU16Response read_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayU16Response begin_read_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayU32Response read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayU32Response begin_read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayU64Response read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayU64Response begin_read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadArrayU8Response read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); +BeginReadArrayU8Response begin_read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size); ReadBoolResponse read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadBoolResponse begin_read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadDblResponse read_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadFifoBoolResponse read_fifo_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout); ReadFifoDblResponse read_fifo_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout); @@ -63,14 +73,22 @@ ReadFifoU32Response read_fifo_u32(const StubPtr& stub, const nidevice_grpc::Sess ReadFifoU64Response read_fifo_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout); ReadFifoU8Response read_fifo_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout); ReadI16Response read_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadI16Response begin_read_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadI32Response read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadI32Response begin_read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadI64Response read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadI64Response begin_read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadI8Response read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadI8Response begin_read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadSglResponse read_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadU16Response read_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadU16Response begin_read_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadU32Response read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadU32Response begin_read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadU64Response read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadU64Response begin_read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReadU8Response read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); +BeginReadU8Response begin_read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator); ReleaseFifoElementsResponse release_fifo_elements(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& elements); ResetResponse reset(const StubPtr& stub, const nidevice_grpc::Session& session); RunResponse run(const StubPtr& stub, const nidevice_grpc::Session& session, const simple_variant& attribute); @@ -83,17 +101,27 @@ StopFifoResponse stop_fifo(const StubPtr& stub, const nidevice_grpc::Session& se UnreserveFifoResponse unreserve_fifo(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo); WaitOnIrqsResponse wait_on_irqs(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& irqs, const pb::uint32& timeout); WriteArrayBoolResponse write_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayBoolResponse begin_write_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayDblResponse write_array_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); WriteArrayI16Response write_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayI16Response begin_write_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayI32Response write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayI32Response begin_write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayI64Response write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayI64Response begin_write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayI8Response write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayI8Response begin_write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArraySglResponse write_array_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); WriteArrayU16Response write_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayU16Response begin_write_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayU32Response write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayU32Response begin_write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayU64Response write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayU64Response begin_write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteArrayU8Response write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector& array); +BeginWriteArrayU8Response begin_write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteBoolResponse write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const bool& value); +BeginWriteBoolResponse begin_write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteDblResponse write_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const double& value); WriteFifoBoolResponse write_fifo_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector& data, const pb::uint32& timeout); WriteFifoDblResponse write_fifo_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector& data, const pb::uint32& timeout); @@ -107,14 +135,22 @@ WriteFifoU32Response write_fifo_u32(const StubPtr& stub, const nidevice_grpc::Se WriteFifoU64Response write_fifo_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector& data, const pb::uint32& timeout); WriteFifoU8Response write_fifo_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector& data, const pb::uint32& timeout); WriteI16Response write_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value); +BeginWriteI16Response begin_write_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteI32Response write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value); +BeginWriteI32Response begin_write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteI64Response write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int64& value); +BeginWriteI64Response begin_write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteI8Response write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value); +BeginWriteI8Response begin_write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteSglResponse write_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const float& value); WriteU16Response write_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value); +BeginWriteU16Response begin_write_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteU32Response write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value); +BeginWriteU32Response begin_write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteU64Response write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint64& value); +BeginWriteU64Response begin_write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); WriteU8Response write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value); +BeginWriteU8Response begin_write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control); } // namespace nifpga_grpc::experimental::client diff --git a/generated/nifpga/nifpga_service.cpp b/generated/nifpga/nifpga_service.cpp index 383305eae..1a2a63e9c 100644 --- a/generated/nifpga/nifpga_service.cpp +++ b/generated/nifpga/nifpga_service.cpp @@ -12,6 +12,7 @@ #include #include #include +#include namespace nifpga_grpc { @@ -21,6 +22,303 @@ namespace nifpga_grpc { using nidevice_grpc::converters::convert_to_grpc; using nidevice_grpc::converters::MatchState; + struct MonikerReadArrayBoolData + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayBoolData data; + std::shared_ptr library; + }; + + struct MonikerReadArrayI16Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayI32Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayI64Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayI64Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayI8Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayU16Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayU32Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayU64Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayU64Data data; + std::shared_ptr library; + }; + + struct MonikerReadArrayU8Data + { + NiFpga_Session session; + uint32_t indicator; + size_t size; + nifpga_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerReadBoolData + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::BoolData data; + std::shared_ptr library; + }; + + struct MonikerReadI16Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::I32Data data; + std::shared_ptr library; + }; + + struct MonikerReadI32Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::I32Data data; + std::shared_ptr library; + }; + + struct MonikerReadI64Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::I64Data data; + std::shared_ptr library; + }; + + struct MonikerReadI8Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::I32Data data; + std::shared_ptr library; + }; + + struct MonikerReadU16Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerReadU32Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerReadU64Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::U64Data data; + std::shared_ptr library; + }; + + struct MonikerReadU8Data + { + NiFpga_Session session; + uint32_t indicator; + nifpga_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayBoolData + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayBoolData data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayI16Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayI32Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayI64Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayI64Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayI8Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayI32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayU16Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayU32Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayU64Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayU64Data data; + std::shared_ptr library; + }; + + struct MonikerWriteArrayU8Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::ArrayU32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteBoolData + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::BoolData data; + std::shared_ptr library; + }; + + struct MonikerWriteI16Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::I32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteI32Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::I32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteI64Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::I64Data data; + std::shared_ptr library; + }; + + struct MonikerWriteI8Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::I32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteU16Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteU32Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::U32Data data; + std::shared_ptr library; + }; + + struct MonikerWriteU64Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::U64Data data; + std::shared_ptr library; + }; + + struct MonikerWriteU8Data + { + NiFpga_Session session; + uint32_t control; + nifpga_grpc::U32Data data; + std::shared_ptr library; + }; + NiFpgaService::NiFpgaService( LibrarySharedPtr library, ResourceRepositorySharedPtr resource_repository, @@ -41,6 +339,887 @@ namespace nifpga_grpc { return status >= 0; } + void RegisterMonikerEndpoints() + { + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayBool", MonikerReadArrayBool); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayI16", MonikerReadArrayI16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayI32", MonikerReadArrayI32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayI64", MonikerReadArrayI64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayI8", MonikerReadArrayI8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayU16", MonikerReadArrayU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayU32", MonikerReadArrayU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayU64", MonikerReadArrayU64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadArrayU8", MonikerReadArrayU8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadBool", MonikerReadBool); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadI16", MonikerReadI16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadI32", MonikerReadI32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadI64", MonikerReadI64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadI8", MonikerReadI8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadU16", MonikerReadU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadU32", MonikerReadU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadU64", MonikerReadU64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerReadU8", MonikerReadU8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayBool", MonikerWriteArrayBool); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayI16", MonikerWriteArrayI16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayI32", MonikerWriteArrayI32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayI64", MonikerWriteArrayI64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayI8", MonikerWriteArrayI8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayU16", MonikerWriteArrayU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayU32", MonikerWriteArrayU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayU64", MonikerWriteArrayU64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteArrayU8", MonikerWriteArrayU8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteBool", MonikerWriteBool); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteI16", MonikerWriteI16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteI32", MonikerWriteI32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteI64", MonikerWriteI64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteI8", MonikerWriteI8); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteU16", MonikerWriteU16); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteU32", MonikerWriteU32); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteU64", MonikerWriteU64); + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("MonikerWriteU8", MonikerWriteU8); + } + +::grpc::Status MonikerReadArrayBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayBoolData* function_data = (MonikerReadArrayBoolData*)data; + 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) { + std::transform( + array.begin(), + array.begin() + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayBool error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayI16Data* function_data = (MonikerReadArrayI16Data*)data; + 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) { + std::transform( + array.begin(), + array.begin() + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayI16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayI32Data* function_data = (MonikerReadArrayI32Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + auto size = function_data->size; + + auto array_storage = std::vector(); + auto array = array_storage.data(); + auto status = library->ReadArrayI32(session, indicator, array, size); + if (status >= 0) { + std::transform( + array, + array + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayI32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayI64Data* function_data = (MonikerReadArrayI64Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + auto size = function_data->size; + + auto array_storage = std::vector(); + auto array = array_storage.data(); + auto status = library->ReadArrayI64(session, indicator, array, size); + if (status >= 0) { + std::transform( + array, + array + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayI64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayI8Data* function_data = (MonikerReadArrayI8Data*)data; + 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) { + std::transform( + array.begin(), + array.begin() + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayI8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayU16Data* function_data = (MonikerReadArrayU16Data*)data; + 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) { + std::transform( + array.begin(), + array.begin() + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayU32Data* function_data = (MonikerReadArrayU32Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + auto size = function_data->size; + + auto array_storage = std::vector(); + auto array = array_storage.data(); + auto status = library->ReadArrayU32(session, indicator, array, size); + if (status >= 0) { + std::transform( + array, + array + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayU64Data* function_data = (MonikerReadArrayU64Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + auto size = function_data->size; + + auto array_storage = std::vector(); + auto array = array_storage.data(); + auto status = library->ReadArrayU64(session, indicator, array, size); + if (status >= 0) { + std::transform( + array, + array + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayU64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadArrayU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadArrayU8Data* function_data = (MonikerReadArrayU8Data*)data; + 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) { + std::transform( + array.begin(), + array.begin() + size, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadArrayU8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadBoolData* function_data = (MonikerReadBoolData*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + NiFpga_Bool value = 0; + auto status = library->ReadBool(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadBool error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadI16Data* function_data = (MonikerReadI16Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + int16_t value = 0; + auto status = library->ReadI16(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadI16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadI32Data* function_data = (MonikerReadI32Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + int32_t value = 0; + auto status = library->ReadI32(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadI32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadI64Data* function_data = (MonikerReadI64Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + int64_t value = 0; + auto status = library->ReadI64(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadI64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadI8Data* function_data = (MonikerReadI8Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + int8_t value = 0; + auto status = library->ReadI8(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadI8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadU16Data* function_data = (MonikerReadU16Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + uint16_t value = 0; + auto status = library->ReadU16(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadU32Data* function_data = (MonikerReadU32Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + uint32_t value = 0; + auto status = library->ReadU32(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadU64Data* function_data = (MonikerReadU64Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + uint64_t value = 0; + auto status = library->ReadU64(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadU64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerReadU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerReadU8Data* function_data = (MonikerReadU8Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto indicator = function_data->indicator; + + uint8_t value = 0; + auto status = library->ReadU8(session, indicator, &value); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + if (status < 0) { + std::cout << "MonikerReadU8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayBoolData* function_data = (MonikerWriteArrayBoolData*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayBoolData arraybooldata_message; + packedData.UnpackTo(&arraybooldata_message); + + auto data_array = arraybooldata_message.value(); + std::vector array(data_array.begin(), data_array.end()); + auto size = data_array.size(); + + auto status = library->WriteArrayBool(session, control, array.data(), size); + if (status < 0) { + std::cout << "MonikerWriteArrayBool error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayI16Data* function_data = (MonikerWriteArrayI16Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayI32Data arrayi32data_message; + packedData.UnpackTo(&arrayi32data_message); + + auto data_array = arrayi32data_message.value(); + auto array = std::vector(); + auto size = data_array.size(); + array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(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_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteArrayI16(session, control, array.data(), size); + if (status < 0) { + std::cout << "MonikerWriteArrayI16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayI32Data* function_data = (MonikerWriteArrayI32Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayI32Data arrayi32data_message; + packedData.UnpackTo(&arrayi32data_message); + + auto data_array = arrayi32data_message.value(); + auto array = const_cast(arrayi32data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteArrayI32(session, control, array, size); + if (status < 0) { + std::cout << "MonikerWriteArrayI32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayI64Data* function_data = (MonikerWriteArrayI64Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayI64Data arrayi64data_message; + packedData.UnpackTo(&arrayi64data_message); + + auto data_array = arrayi64data_message.value(); + auto array = const_cast(arrayi64data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteArrayI64(session, control, array, size); + if (status < 0) { + std::cout << "MonikerWriteArrayI64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayI8Data* function_data = (MonikerWriteArrayI8Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayI32Data arrayi32data_message; + packedData.UnpackTo(&arrayi32data_message); + + auto data_array = arrayi32data_message.value(); + auto array = std::vector(); + auto size = data_array.size(); + array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(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 int8_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteArrayI8(session, control, array.data(), size); + if (status < 0) { + std::cout << "MonikerWriteArrayI8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayU16Data* function_data = (MonikerWriteArrayU16Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayU32Data arrayu32data_message; + packedData.UnpackTo(&arrayu32data_message); + + auto data_array = arrayu32data_message.value(); + auto array = std::vector(); + auto size = data_array.size(); + array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(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_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteArrayU16(session, control, array.data(), size); + if (status < 0) { + std::cout << "MonikerWriteArrayU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayU32Data* function_data = (MonikerWriteArrayU32Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayU32Data arrayu32data_message; + packedData.UnpackTo(&arrayu32data_message); + + auto data_array = arrayu32data_message.value(); + auto array = const_cast(arrayu32data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteArrayU32(session, control, array, size); + if (status < 0) { + std::cout << "MonikerWriteArrayU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayU64Data* function_data = (MonikerWriteArrayU64Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayU64Data arrayu64data_message; + packedData.UnpackTo(&arrayu64data_message); + + auto data_array = arrayu64data_message.value(); + auto array = const_cast(arrayu64data_message.value().data()); + auto size = data_array.size(); + + auto status = library->WriteArrayU64(session, control, array, size); + if (status < 0) { + std::cout << "MonikerWriteArrayU64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteArrayU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteArrayU8Data* function_data = (MonikerWriteArrayU8Data*)data; + auto library = function_data->library; + auto session = function_data->session; + auto control = function_data->control; + + ArrayU32Data arrayu32data_message; + packedData.UnpackTo(&arrayu32data_message); + + auto data_array = arrayu32data_message.value(); + auto array = std::vector(); + auto size = data_array.size(); + array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(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 uint8_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast(x); + }); + + auto status = library->WriteArrayU8(session, control, array.data(), size); + if (status < 0) { + std::cout << "MonikerWriteArrayU8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteBoolData* function_data = (MonikerWriteBoolData*)data; + 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(); + + auto status = library->WriteBool(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteBool error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteI16Data* function_data = (MonikerWriteI16Data*)data; + 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(); + if (value < std::numeric_limits::min() || value > std::numeric_limits::max()) { + std::string message("value " + std::to_string(value) + " doesn't fit in datatype int16_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + + auto status = library->WriteI16(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteI16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteI32Data* function_data = (MonikerWriteI32Data*)data; + 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(); + + auto status = library->WriteI32(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteI32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteI64Data* function_data = (MonikerWriteI64Data*)data; + 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(); + + auto status = library->WriteI64(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteI64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteI8Data* function_data = (MonikerWriteI8Data*)data; + 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(); + if (value < std::numeric_limits::min() || value > std::numeric_limits::max()) { + std::string message("value " + std::to_string(value) + " doesn't fit in datatype int8_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + + auto status = library->WriteI8(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteI8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteU16Data* function_data = (MonikerWriteU16Data*)data; + 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(); + if (value < std::numeric_limits::min() || value > std::numeric_limits::max()) { + std::string message("value " + std::to_string(value) + " doesn't fit in datatype uint16_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + + auto status = library->WriteU16(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteU16 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteU32Data* function_data = (MonikerWriteU32Data*)data; + 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(); + + auto status = library->WriteU32(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteU32 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteU64Data* function_data = (MonikerWriteU64Data*)data; + 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(); + + auto status = library->WriteU64(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteU64 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + +::grpc::Status MonikerWriteU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + MonikerWriteU8Data* function_data = (MonikerWriteU8Data*)data; + 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(); + if (value < std::numeric_limits::min() || value > std::numeric_limits::max()) { + std::string message("value " + std::to_string(value) + " doesn't fit in datatype uint8_t"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + + auto status = library->WriteU8(session, control, value); + if (status < 0) { + std::cout << "MonikerWriteU8 error: " << status << std::endl; + } + return ::grpc::Status::OK; +} //--------------------------------------------------------------------- //--------------------------------------------------------------------- ::grpc::Status NiFpgaService::Abort(::grpc::ServerContext* context, const AbortRequest* request, AbortResponse* response) @@ -573,6 +1752,38 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayBool(::grpc::ServerContext* context, const BeginReadArrayBoolRequest* request, BeginReadArrayBoolResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayBool", data.get(), *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 NiFpgaService::ReadArrayDbl(::grpc::ServerContext* context, const ReadArrayDblRequest* request, ReadArrayDblResponse* response) @@ -633,6 +1844,38 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayI16(::grpc::ServerContext* context, const BeginReadArrayI16Request* request, BeginReadArrayI16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayI16", data.get(), *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 NiFpgaService::ReadArrayI32(::grpc::ServerContext* context, const ReadArrayI32Request* request, ReadArrayI32Response* response) @@ -659,6 +1902,38 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayI32(::grpc::ServerContext* context, const BeginReadArrayI32Request* request, BeginReadArrayI32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayI32", data.get(), *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 NiFpgaService::ReadArrayI64(::grpc::ServerContext* context, const ReadArrayI64Request* request, ReadArrayI64Response* response) @@ -685,6 +1960,38 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayI64(::grpc::ServerContext* context, const BeginReadArrayI64Request* request, BeginReadArrayI64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayI64", data.get(), *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 NiFpgaService::ReadArrayI8(::grpc::ServerContext* context, const ReadArrayI8Request* request, ReadArrayI8Response* response) @@ -719,6 +2026,38 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayI8(::grpc::ServerContext* context, const BeginReadArrayI8Request* request, BeginReadArrayI8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayI8", data.get(), *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 NiFpgaService::ReadArraySgl(::grpc::ServerContext* context, const ReadArraySglRequest* request, ReadArraySglResponse* response) @@ -779,6 +2118,38 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayU16(::grpc::ServerContext* context, const BeginReadArrayU16Request* request, BeginReadArrayU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayU16", data.get(), *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 NiFpgaService::ReadArrayU32(::grpc::ServerContext* context, const ReadArrayU32Request* request, ReadArrayU32Response* response) @@ -807,7 +2178,131 @@ namespace nifpga_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiFpgaService::ReadArrayU64(::grpc::ServerContext* context, const ReadArrayU64Request* request, ReadArrayU64Response* response) + ::grpc::Status NiFpgaService::BeginReadArrayU32(::grpc::ServerContext* context, const BeginReadArrayU32Request* request, BeginReadArrayU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayU32", data.get(), *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 NiFpgaService::ReadArrayU64(::grpc::ServerContext* context, const ReadArrayU64Request* request, ReadArrayU64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + response->mutable_array()->Resize(size, 0); + uint64_t* array = response->mutable_array()->mutable_data(); + auto status = library_->ReadArrayU64(session, indicator, array, size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiFpga_Session(context, status, session); + } + response->set_status(status); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayU64(::grpc::ServerContext* context, const BeginReadArrayU64Request* request, BeginReadArrayU64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayU64", data.get(), *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 NiFpgaService::ReadArrayU8(::grpc::ServerContext* context, const ReadArrayU8Request* request, ReadArrayU8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + size_t size = request->size(); + std::vector array(size); + auto status = library_->ReadArrayU8(session, indicator, array.data(), size); + if (!status_ok(status)) { + return ConvertApiErrorStatusForNiFpga_Session(context, status, session); + } + response->set_status(status); + response->mutable_array()->Clear(); + response->mutable_array()->Reserve(size); + std::transform( + array.begin(), + array.begin() + size, + google::protobuf::RepeatedFieldBackInserter(response->mutable_array()), + [&](auto x) { + return x; + }); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadArrayU8(::grpc::ServerContext* context, const BeginReadArrayU8Request* request, BeginReadArrayU8Response* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -817,13 +2312,19 @@ namespace nifpga_grpc { NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); uint32_t indicator = request->indicator(); size_t size = request->size(); - response->mutable_array()->Resize(size, 0); - uint64_t* array = response->mutable_array()->mutable_data(); - auto status = library_->ReadArrayU64(session, indicator, array, size); - if (!status_ok(status)) { - return ConvertApiErrorStatusForNiFpga_Session(context, status, session); - } - response->set_status(status); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->size = size; + data->library = std::shared_ptr(library_); + + data->data.mutable_value()->Reserve(request->size()); + data->data.mutable_value()->Resize(request->size(), 0); + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadArrayU8", data.get(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -833,7 +2334,7 @@ namespace nifpga_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiFpgaService::ReadArrayU8(::grpc::ServerContext* context, const ReadArrayU8Request* request, ReadArrayU8Response* response) + ::grpc::Status NiFpgaService::ReadBool(::grpc::ServerContext* context, const ReadBoolRequest* request, ReadBoolResponse* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -842,22 +2343,13 @@ namespace nifpga_grpc { auto session_grpc_session = request->session(); NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); uint32_t indicator = request->indicator(); - size_t size = request->size(); - std::vector array(size); - auto status = library_->ReadArrayU8(session, indicator, array.data(), size); + NiFpga_Bool value {}; + auto status = library_->ReadBool(session, indicator, &value); if (!status_ok(status)) { return ConvertApiErrorStatusForNiFpga_Session(context, status, session); } response->set_status(status); - response->mutable_array()->Clear(); - response->mutable_array()->Reserve(size); - std::transform( - array.begin(), - array.begin() + size, - google::protobuf::RepeatedFieldBackInserter(response->mutable_array()), - [&](auto x) { - return x; - }); + response->set_value(value); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -867,7 +2359,7 @@ namespace nifpga_grpc { //--------------------------------------------------------------------- //--------------------------------------------------------------------- - ::grpc::Status NiFpgaService::ReadBool(::grpc::ServerContext* context, const ReadBoolRequest* request, ReadBoolResponse* response) + ::grpc::Status NiFpgaService::BeginReadBool(::grpc::ServerContext* context, const BeginReadBoolRequest* request, BeginReadBoolResponse* response) { if (context->IsCancelled()) { return ::grpc::Status::CANCELLED; @@ -876,13 +2368,16 @@ namespace nifpga_grpc { auto session_grpc_session = request->session(); NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); uint32_t indicator = request->indicator(); - NiFpga_Bool value {}; - auto status = library_->ReadBool(session, indicator, &value); - if (!status_ok(status)) { - return ConvertApiErrorStatusForNiFpga_Session(context, status, session); - } - response->set_status(status); - response->set_value(value); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadBool", data.get(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); return ::grpc::Status::OK; } catch (nidevice_grpc::NonDriverException& ex) { @@ -1291,6 +2786,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadI16(::grpc::ServerContext* context, const BeginReadI16Request* request, BeginReadI16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadI16", data.get(), *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 NiFpgaService::ReadI32(::grpc::ServerContext* context, const ReadI32Request* request, ReadI32Response* response) @@ -1316,6 +2839,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadI32(::grpc::ServerContext* context, const BeginReadI32Request* request, BeginReadI32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadI32", data.get(), *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 NiFpgaService::ReadI64(::grpc::ServerContext* context, const ReadI64Request* request, ReadI64Response* response) @@ -1341,6 +2892,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadI64(::grpc::ServerContext* context, const BeginReadI64Request* request, BeginReadI64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadI64", data.get(), *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 NiFpgaService::ReadI8(::grpc::ServerContext* context, const ReadI8Request* request, ReadI8Response* response) @@ -1366,6 +2945,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadI8(::grpc::ServerContext* context, const BeginReadI8Request* request, BeginReadI8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadI8", data.get(), *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 NiFpgaService::ReadSgl(::grpc::ServerContext* context, const ReadSglRequest* request, ReadSglResponse* response) @@ -1416,6 +3023,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadU16(::grpc::ServerContext* context, const BeginReadU16Request* request, BeginReadU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadU16", data.get(), *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 NiFpgaService::ReadU32(::grpc::ServerContext* context, const ReadU32Request* request, ReadU32Response* response) @@ -1441,6 +3076,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadU32(::grpc::ServerContext* context, const BeginReadU32Request* request, BeginReadU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadU32", data.get(), *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 NiFpgaService::ReadU64(::grpc::ServerContext* context, const ReadU64Request* request, ReadU64Response* response) @@ -1466,6 +3129,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadU64(::grpc::ServerContext* context, const BeginReadU64Request* request, BeginReadU64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadU64", data.get(), *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 NiFpgaService::ReadU8(::grpc::ServerContext* context, const ReadU8Request* request, ReadU8Response* response) @@ -1491,6 +3182,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginReadU8(::grpc::ServerContext* context, const BeginReadU8Request* request, BeginReadU8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t indicator = request->indicator(); + + auto data = std::make_unique(); + data->session = session; + data->indicator = indicator; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerReadU8", data.get(), *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 NiFpgaService::ReleaseFifoElements(::grpc::ServerContext* context, const ReleaseFifoElementsRequest* request, ReleaseFifoElementsResponse* response) @@ -1858,6 +3577,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayBool(::grpc::ServerContext* context, const BeginWriteArrayBoolRequest* request, BeginWriteArrayBoolResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayBool", data.get(), *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 NiFpgaService::WriteArrayDbl(::grpc::ServerContext* context, const WriteArrayDblRequest* request, WriteArrayDblResponse* response) @@ -1925,6 +3672,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayI16(::grpc::ServerContext* context, const BeginWriteArrayI16Request* request, BeginWriteArrayI16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayI16", data.get(), *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 NiFpgaService::WriteArrayI32(::grpc::ServerContext* context, const WriteArrayI32Request* request, WriteArrayI32Response* response) @@ -1950,6 +3725,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayI32(::grpc::ServerContext* context, const BeginWriteArrayI32Request* request, BeginWriteArrayI32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayI32", data.get(), *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 NiFpgaService::WriteArrayI64(::grpc::ServerContext* context, const WriteArrayI64Request* request, WriteArrayI64Response* response) @@ -1975,6 +3778,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayI64(::grpc::ServerContext* context, const BeginWriteArrayI64Request* request, BeginWriteArrayI64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayI64", data.get(), *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 NiFpgaService::WriteArrayI8(::grpc::ServerContext* context, const WriteArrayI8Request* request, WriteArrayI8Response* response) @@ -2017,6 +3848,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayI8(::grpc::ServerContext* context, const BeginWriteArrayI8Request* request, BeginWriteArrayI8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayI8", data.get(), *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 NiFpgaService::WriteArraySgl(::grpc::ServerContext* context, const WriteArraySglRequest* request, WriteArraySglResponse* response) @@ -2084,6 +3943,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayU16(::grpc::ServerContext* context, const BeginWriteArrayU16Request* request, BeginWriteArrayU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayU16", data.get(), *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 NiFpgaService::WriteArrayU32(::grpc::ServerContext* context, const WriteArrayU32Request* request, WriteArrayU32Response* response) @@ -2109,6 +3996,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayU32(::grpc::ServerContext* context, const BeginWriteArrayU32Request* request, BeginWriteArrayU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayU32", data.get(), *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 NiFpgaService::WriteArrayU64(::grpc::ServerContext* context, const WriteArrayU64Request* request, WriteArrayU64Response* response) @@ -2134,6 +4049,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayU64(::grpc::ServerContext* context, const BeginWriteArrayU64Request* request, BeginWriteArrayU64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayU64", data.get(), *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 NiFpgaService::WriteArrayU8(::grpc::ServerContext* context, const WriteArrayU8Request* request, WriteArrayU8Response* response) @@ -2176,6 +4119,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteArrayU8(::grpc::ServerContext* context, const BeginWriteArrayU8Request* request, BeginWriteArrayU8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteArrayU8", data.get(), *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 NiFpgaService::WriteBool(::grpc::ServerContext* context, const WriteBoolRequest* request, WriteBoolResponse* response) @@ -2200,6 +4171,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteBool(::grpc::ServerContext* context, const BeginWriteBoolRequest* request, BeginWriteBoolResponse* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteBool", data.get(), *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 NiFpgaService::WriteDbl(::grpc::ServerContext* context, const WriteDblRequest* request, WriteDblResponse* response) @@ -2633,6 +4632,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteI16(::grpc::ServerContext* context, const BeginWriteI16Request* request, BeginWriteI16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteI16", data.get(), *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 NiFpgaService::WriteI32(::grpc::ServerContext* context, const WriteI32Request* request, WriteI32Response* response) @@ -2657,6 +4684,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteI32(::grpc::ServerContext* context, const BeginWriteI32Request* request, BeginWriteI32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteI32", data.get(), *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 NiFpgaService::WriteI64(::grpc::ServerContext* context, const WriteI64Request* request, WriteI64Response* response) @@ -2681,6 +4736,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteI64(::grpc::ServerContext* context, const BeginWriteI64Request* request, BeginWriteI64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteI64", data.get(), *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 NiFpgaService::WriteI8(::grpc::ServerContext* context, const WriteI8Request* request, WriteI8Response* response) @@ -2714,6 +4797,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteI8(::grpc::ServerContext* context, const BeginWriteI8Request* request, BeginWriteI8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteI8", data.get(), *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 NiFpgaService::WriteSgl(::grpc::ServerContext* context, const WriteSglRequest* request, WriteSglResponse* response) @@ -2771,6 +4882,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteU16(::grpc::ServerContext* context, const BeginWriteU16Request* request, BeginWriteU16Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteU16", data.get(), *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 NiFpgaService::WriteU32(::grpc::ServerContext* context, const WriteU32Request* request, WriteU32Response* response) @@ -2795,6 +4934,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteU32(::grpc::ServerContext* context, const BeginWriteU32Request* request, BeginWriteU32Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteU32", data.get(), *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 NiFpgaService::WriteU64(::grpc::ServerContext* context, const WriteU64Request* request, WriteU64Response* response) @@ -2819,6 +4986,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteU64(::grpc::ServerContext* context, const BeginWriteU64Request* request, BeginWriteU64Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteU64", data.get(), *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 NiFpgaService::WriteU8(::grpc::ServerContext* context, const WriteU8Request* request, WriteU8Response* response) @@ -2852,6 +5047,34 @@ namespace nifpga_grpc { } } + //--------------------------------------------------------------------- + //--------------------------------------------------------------------- + ::grpc::Status NiFpgaService::BeginWriteU8(::grpc::ServerContext* context, const BeginWriteU8Request* request, BeginWriteU8Response* response) + { + if (context->IsCancelled()) { + return ::grpc::Status::CANCELLED; + } + try { + auto session_grpc_session = request->session(); + NiFpga_Session session = session_repository_->access_session(session_grpc_session.name()); + uint32_t control = request->control(); + + auto data = std::make_unique(); + data->session = session; + data->control = control; + data->library = std::shared_ptr(library_); + + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("MonikerWriteU8", data.get(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK; + } + catch (nidevice_grpc::NonDriverException& ex) { + return ex.GetStatus(); + } + } + NiFpgaFeatureToggles::NiFpgaFeatureToggles( const nidevice_grpc::FeatureToggles& feature_toggles) diff --git a/generated/nifpga/nifpga_service.h b/generated/nifpga/nifpga_service.h index 965d41a7e..4a920bba1 100644 --- a/generated/nifpga/nifpga_service.h +++ b/generated/nifpga/nifpga_service.h @@ -31,6 +31,45 @@ struct NiFpgaFeatureToggles bool is_enabled; }; +void RegisterMonikerEndpoints(); + +::grpc::Status MonikerReadArrayBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadArrayU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerReadU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteArrayU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteBool(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteI16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteI32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteI64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteI8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteU16(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteU32(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteU64(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +::grpc::Status MonikerWriteU8(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); + class NiFpgaService final : public NiFpga::Service { public: using LibrarySharedPtr = std::shared_ptr; @@ -59,17 +98,27 @@ class NiFpgaService final : public NiFpga::Service { ::grpc::Status GetFpgaViState(::grpc::ServerContext* context, const GetFpgaViStateRequest* request, GetFpgaViStateResponse* response) override; ::grpc::Status Open(::grpc::ServerContext* context, const OpenRequest* request, OpenResponse* response) override; ::grpc::Status ReadArrayBool(::grpc::ServerContext* context, const ReadArrayBoolRequest* request, ReadArrayBoolResponse* response) override; + ::grpc::Status BeginReadArrayBool(::grpc::ServerContext* context, const BeginReadArrayBoolRequest* request, BeginReadArrayBoolResponse* response) override; ::grpc::Status ReadArrayDbl(::grpc::ServerContext* context, const ReadArrayDblRequest* request, ReadArrayDblResponse* response) override; ::grpc::Status ReadArrayI16(::grpc::ServerContext* context, const ReadArrayI16Request* request, ReadArrayI16Response* response) override; + ::grpc::Status BeginReadArrayI16(::grpc::ServerContext* context, const BeginReadArrayI16Request* request, BeginReadArrayI16Response* response) override; ::grpc::Status ReadArrayI32(::grpc::ServerContext* context, const ReadArrayI32Request* request, ReadArrayI32Response* response) override; + ::grpc::Status BeginReadArrayI32(::grpc::ServerContext* context, const BeginReadArrayI32Request* request, BeginReadArrayI32Response* response) override; ::grpc::Status ReadArrayI64(::grpc::ServerContext* context, const ReadArrayI64Request* request, ReadArrayI64Response* response) override; + ::grpc::Status BeginReadArrayI64(::grpc::ServerContext* context, const BeginReadArrayI64Request* request, BeginReadArrayI64Response* response) override; ::grpc::Status ReadArrayI8(::grpc::ServerContext* context, const ReadArrayI8Request* request, ReadArrayI8Response* response) override; + ::grpc::Status BeginReadArrayI8(::grpc::ServerContext* context, const BeginReadArrayI8Request* request, BeginReadArrayI8Response* response) override; ::grpc::Status ReadArraySgl(::grpc::ServerContext* context, const ReadArraySglRequest* request, ReadArraySglResponse* response) override; ::grpc::Status ReadArrayU16(::grpc::ServerContext* context, const ReadArrayU16Request* request, ReadArrayU16Response* response) override; + ::grpc::Status BeginReadArrayU16(::grpc::ServerContext* context, const BeginReadArrayU16Request* request, BeginReadArrayU16Response* response) override; ::grpc::Status ReadArrayU32(::grpc::ServerContext* context, const ReadArrayU32Request* request, ReadArrayU32Response* response) override; + ::grpc::Status BeginReadArrayU32(::grpc::ServerContext* context, const BeginReadArrayU32Request* request, BeginReadArrayU32Response* response) override; ::grpc::Status ReadArrayU64(::grpc::ServerContext* context, const ReadArrayU64Request* request, ReadArrayU64Response* response) override; + ::grpc::Status BeginReadArrayU64(::grpc::ServerContext* context, const BeginReadArrayU64Request* request, BeginReadArrayU64Response* response) override; ::grpc::Status ReadArrayU8(::grpc::ServerContext* context, const ReadArrayU8Request* request, ReadArrayU8Response* response) override; + ::grpc::Status BeginReadArrayU8(::grpc::ServerContext* context, const BeginReadArrayU8Request* request, BeginReadArrayU8Response* response) override; ::grpc::Status ReadBool(::grpc::ServerContext* context, const ReadBoolRequest* request, ReadBoolResponse* response) override; + ::grpc::Status BeginReadBool(::grpc::ServerContext* context, const BeginReadBoolRequest* request, BeginReadBoolResponse* response) override; ::grpc::Status ReadDbl(::grpc::ServerContext* context, const ReadDblRequest* request, ReadDblResponse* response) override; ::grpc::Status ReadFifoBool(::grpc::ServerContext* context, const ReadFifoBoolRequest* request, ReadFifoBoolResponse* response) override; ::grpc::Status ReadFifoDbl(::grpc::ServerContext* context, const ReadFifoDblRequest* request, ReadFifoDblResponse* response) override; @@ -83,14 +132,22 @@ class NiFpgaService final : public NiFpga::Service { ::grpc::Status ReadFifoU64(::grpc::ServerContext* context, const ReadFifoU64Request* request, ReadFifoU64Response* response) override; ::grpc::Status ReadFifoU8(::grpc::ServerContext* context, const ReadFifoU8Request* request, ReadFifoU8Response* response) override; ::grpc::Status ReadI16(::grpc::ServerContext* context, const ReadI16Request* request, ReadI16Response* response) override; + ::grpc::Status BeginReadI16(::grpc::ServerContext* context, const BeginReadI16Request* request, BeginReadI16Response* response) override; ::grpc::Status ReadI32(::grpc::ServerContext* context, const ReadI32Request* request, ReadI32Response* response) override; + ::grpc::Status BeginReadI32(::grpc::ServerContext* context, const BeginReadI32Request* request, BeginReadI32Response* response) override; ::grpc::Status ReadI64(::grpc::ServerContext* context, const ReadI64Request* request, ReadI64Response* response) override; + ::grpc::Status BeginReadI64(::grpc::ServerContext* context, const BeginReadI64Request* request, BeginReadI64Response* response) override; ::grpc::Status ReadI8(::grpc::ServerContext* context, const ReadI8Request* request, ReadI8Response* response) override; + ::grpc::Status BeginReadI8(::grpc::ServerContext* context, const BeginReadI8Request* request, BeginReadI8Response* response) override; ::grpc::Status ReadSgl(::grpc::ServerContext* context, const ReadSglRequest* request, ReadSglResponse* response) override; ::grpc::Status ReadU16(::grpc::ServerContext* context, const ReadU16Request* request, ReadU16Response* response) override; + ::grpc::Status BeginReadU16(::grpc::ServerContext* context, const BeginReadU16Request* request, BeginReadU16Response* response) override; ::grpc::Status ReadU32(::grpc::ServerContext* context, const ReadU32Request* request, ReadU32Response* response) override; + ::grpc::Status BeginReadU32(::grpc::ServerContext* context, const BeginReadU32Request* request, BeginReadU32Response* response) override; ::grpc::Status ReadU64(::grpc::ServerContext* context, const ReadU64Request* request, ReadU64Response* response) override; + ::grpc::Status BeginReadU64(::grpc::ServerContext* context, const BeginReadU64Request* request, BeginReadU64Response* response) override; ::grpc::Status ReadU8(::grpc::ServerContext* context, const ReadU8Request* request, ReadU8Response* response) override; + ::grpc::Status BeginReadU8(::grpc::ServerContext* context, const BeginReadU8Request* request, BeginReadU8Response* response) override; ::grpc::Status ReleaseFifoElements(::grpc::ServerContext* context, const ReleaseFifoElementsRequest* request, ReleaseFifoElementsResponse* response) override; ::grpc::Status Reset(::grpc::ServerContext* context, const ResetRequest* request, ResetResponse* response) override; ::grpc::Status Run(::grpc::ServerContext* context, const RunRequest* request, RunResponse* response) override; @@ -103,17 +160,27 @@ class NiFpgaService final : public NiFpga::Service { ::grpc::Status UnreserveFifo(::grpc::ServerContext* context, const UnreserveFifoRequest* request, UnreserveFifoResponse* response) override; ::grpc::Status WaitOnIrqs(::grpc::ServerContext* context, const WaitOnIrqsRequest* request, WaitOnIrqsResponse* response) override; ::grpc::Status WriteArrayBool(::grpc::ServerContext* context, const WriteArrayBoolRequest* request, WriteArrayBoolResponse* response) override; + ::grpc::Status BeginWriteArrayBool(::grpc::ServerContext* context, const BeginWriteArrayBoolRequest* request, BeginWriteArrayBoolResponse* response) override; ::grpc::Status WriteArrayDbl(::grpc::ServerContext* context, const WriteArrayDblRequest* request, WriteArrayDblResponse* response) override; ::grpc::Status WriteArrayI16(::grpc::ServerContext* context, const WriteArrayI16Request* request, WriteArrayI16Response* response) override; + ::grpc::Status BeginWriteArrayI16(::grpc::ServerContext* context, const BeginWriteArrayI16Request* request, BeginWriteArrayI16Response* response) override; ::grpc::Status WriteArrayI32(::grpc::ServerContext* context, const WriteArrayI32Request* request, WriteArrayI32Response* response) override; + ::grpc::Status BeginWriteArrayI32(::grpc::ServerContext* context, const BeginWriteArrayI32Request* request, BeginWriteArrayI32Response* response) override; ::grpc::Status WriteArrayI64(::grpc::ServerContext* context, const WriteArrayI64Request* request, WriteArrayI64Response* response) override; + ::grpc::Status BeginWriteArrayI64(::grpc::ServerContext* context, const BeginWriteArrayI64Request* request, BeginWriteArrayI64Response* response) override; ::grpc::Status WriteArrayI8(::grpc::ServerContext* context, const WriteArrayI8Request* request, WriteArrayI8Response* response) override; + ::grpc::Status BeginWriteArrayI8(::grpc::ServerContext* context, const BeginWriteArrayI8Request* request, BeginWriteArrayI8Response* response) override; ::grpc::Status WriteArraySgl(::grpc::ServerContext* context, const WriteArraySglRequest* request, WriteArraySglResponse* response) override; ::grpc::Status WriteArrayU16(::grpc::ServerContext* context, const WriteArrayU16Request* request, WriteArrayU16Response* response) override; + ::grpc::Status BeginWriteArrayU16(::grpc::ServerContext* context, const BeginWriteArrayU16Request* request, BeginWriteArrayU16Response* response) override; ::grpc::Status WriteArrayU32(::grpc::ServerContext* context, const WriteArrayU32Request* request, WriteArrayU32Response* response) override; + ::grpc::Status BeginWriteArrayU32(::grpc::ServerContext* context, const BeginWriteArrayU32Request* request, BeginWriteArrayU32Response* response) override; ::grpc::Status WriteArrayU64(::grpc::ServerContext* context, const WriteArrayU64Request* request, WriteArrayU64Response* response) override; + ::grpc::Status BeginWriteArrayU64(::grpc::ServerContext* context, const BeginWriteArrayU64Request* request, BeginWriteArrayU64Response* response) override; ::grpc::Status WriteArrayU8(::grpc::ServerContext* context, const WriteArrayU8Request* request, WriteArrayU8Response* response) override; + ::grpc::Status BeginWriteArrayU8(::grpc::ServerContext* context, const BeginWriteArrayU8Request* request, BeginWriteArrayU8Response* response) override; ::grpc::Status WriteBool(::grpc::ServerContext* context, const WriteBoolRequest* request, WriteBoolResponse* response) override; + ::grpc::Status BeginWriteBool(::grpc::ServerContext* context, const BeginWriteBoolRequest* request, BeginWriteBoolResponse* response) override; ::grpc::Status WriteDbl(::grpc::ServerContext* context, const WriteDblRequest* request, WriteDblResponse* response) override; ::grpc::Status WriteFifoBool(::grpc::ServerContext* context, const WriteFifoBoolRequest* request, WriteFifoBoolResponse* response) override; ::grpc::Status WriteFifoDbl(::grpc::ServerContext* context, const WriteFifoDblRequest* request, WriteFifoDblResponse* response) override; @@ -127,14 +194,22 @@ class NiFpgaService final : public NiFpga::Service { ::grpc::Status WriteFifoU64(::grpc::ServerContext* context, const WriteFifoU64Request* request, WriteFifoU64Response* response) override; ::grpc::Status WriteFifoU8(::grpc::ServerContext* context, const WriteFifoU8Request* request, WriteFifoU8Response* response) override; ::grpc::Status WriteI16(::grpc::ServerContext* context, const WriteI16Request* request, WriteI16Response* response) override; + ::grpc::Status BeginWriteI16(::grpc::ServerContext* context, const BeginWriteI16Request* request, BeginWriteI16Response* response) override; ::grpc::Status WriteI32(::grpc::ServerContext* context, const WriteI32Request* request, WriteI32Response* response) override; + ::grpc::Status BeginWriteI32(::grpc::ServerContext* context, const BeginWriteI32Request* request, BeginWriteI32Response* response) override; ::grpc::Status WriteI64(::grpc::ServerContext* context, const WriteI64Request* request, WriteI64Response* response) override; + ::grpc::Status BeginWriteI64(::grpc::ServerContext* context, const BeginWriteI64Request* request, BeginWriteI64Response* response) override; ::grpc::Status WriteI8(::grpc::ServerContext* context, const WriteI8Request* request, WriteI8Response* response) override; + ::grpc::Status BeginWriteI8(::grpc::ServerContext* context, const BeginWriteI8Request* request, BeginWriteI8Response* response) override; ::grpc::Status WriteSgl(::grpc::ServerContext* context, const WriteSglRequest* request, WriteSglResponse* response) override; ::grpc::Status WriteU16(::grpc::ServerContext* context, const WriteU16Request* request, WriteU16Response* response) override; + ::grpc::Status BeginWriteU16(::grpc::ServerContext* context, const BeginWriteU16Request* request, BeginWriteU16Response* response) override; ::grpc::Status WriteU32(::grpc::ServerContext* context, const WriteU32Request* request, WriteU32Response* response) override; + ::grpc::Status BeginWriteU32(::grpc::ServerContext* context, const BeginWriteU32Request* request, BeginWriteU32Response* response) override; ::grpc::Status WriteU64(::grpc::ServerContext* context, const WriteU64Request* request, WriteU64Response* response) override; + ::grpc::Status BeginWriteU64(::grpc::ServerContext* context, const BeginWriteU64Request* request, BeginWriteU64Response* response) override; ::grpc::Status WriteU8(::grpc::ServerContext* context, const WriteU8Request* request, WriteU8Response* response) override; + ::grpc::Status BeginWriteU8(::grpc::ServerContext* context, const BeginWriteU8Request* request, BeginWriteU8Response* response) override; private: LibrarySharedPtr library_; ResourceRepositorySharedPtr session_repository_; diff --git a/generated/nifpga/nifpga_service_registrar.cpp b/generated/nifpga/nifpga_service_registrar.cpp index 5cc12cd1d..199b41b6b 100644 --- a/generated/nifpga/nifpga_service_registrar.cpp +++ b/generated/nifpga/nifpga_service_registrar.cpp @@ -10,6 +10,7 @@ #include "nifpga_service.h" #include "nifpga_service_registrar.h" +#include namespace nifpga_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)) { + nifpga_grpc::RegisterMonikerEndpoints(); + } + return service; } diff --git a/source/codegen/common_helpers.py b/source/codegen/common_helpers.py index c283d4449..90363453d 100644 --- a/source/codegen/common_helpers.py +++ b/source/codegen/common_helpers.py @@ -33,6 +33,14 @@ def is_input_parameter(parameter): return "in" in parameter["direction"] +def get_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): + return param + return None + + def levels_of_pointer_indirection(parameter: dict) -> int: """Levels of pointer indirection for pointer. I.e. number of '*'s.""" return [is_output_parameter(parameter), parameter.get("pointer", False)].count(True) @@ -1194,3 +1202,55 @@ def get_params_needing_initialization(parameters: List[dict]) -> List[dict]: * Outputs that are calculated/populated after the API call. """ return [p for p in parameters if not (is_return_value(p) or is_get_last_error_output_param(p))] + + +def filter_moniker_streaming_functions(functions, functions_to_generate): + """Return streaming functions that need to be generated.""" + return [ + name for name in functions_to_generate if functions[name].get("is_streaming_api", False) + ] + + +def get_data_moniker_function_name(function_name): + """Return the corresponding moniker function name for the given C API function.""" + return function_name.replace("Begin", "Moniker") + + +def get_data_moniker_struct_name(function_name): + """Return the corresponding moniker function name for the given C API function.""" + return f"{function_name.replace('Begin', 'Moniker')}Data" + + +def is_function_in_streaming_functions(function_name, streaming_functions_to_generate): + """Check if a function name is in the streaming functions to generate.""" + return function_name in streaming_functions_to_generate + + +def _is_streaming_param_input_array(streaming_param): + """Check if the streaming parameter is an input array.""" + return ( + streaming_param + and streaming_param["direction"] == "in" + and is_array(streaming_param["type"]) + ) + + +def get_input_streaming_param(parameters): + """Determine if a parameter should be included based on streaming conditions.""" + streaming_param = None + for param in parameters: + if param.get("is_streaming_type", False): + streaming_param = param + break + + 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: + params.append(param) + return params diff --git a/source/codegen/metadata/nifpga/config.py b/source/codegen/metadata/nifpga/config.py index 26fcd4a22..d7629d109 100644 --- a/source/codegen/metadata/nifpga/config.py +++ b/source/codegen/metadata/nifpga/config.py @@ -13,6 +13,7 @@ 'code_readiness': 'Release', 'driver_name': 'NI-FPGA', 'status_ok': 'status >= 0', + 'additional_protos': ['data_moniker.proto'], 'resource_handle_type': ['NiFpga_Session'], 'type_to_grpc_type': { 'NiFpga_Session': 'nidevice_grpc.Session', @@ -30,6 +31,7 @@ 'NiFpga_Bool': 'bool', 'NiFpga_FifoProperty': 'uint32', }, + 'has_moniker_streaming_apis': True, 'custom_types': [], 'library_info': { 'Linux': { @@ -54,4 +56,4 @@ 'module_name': 'nifpga', 'session_class_description': 'An NI-FPGA session.', 'session_handle_parameter_name': 'session' -} +} \ No newline at end of file diff --git a/source/codegen/metadata/nifpga/custom_proto.mako b/source/codegen/metadata/nifpga/custom_proto.mako new file mode 100644 index 000000000..0c31f3fca --- /dev/null +++ b/source/codegen/metadata/nifpga/custom_proto.mako @@ -0,0 +1,39 @@ +message I32Data { + int32 value = 1; +} + +message U32Data { + uint32 value = 1; +} + +message I64Data { + int64 value = 1; +} + +message U64Data { + uint64 value = 1; +} + +message BoolData { + bool value = 1; +} + +message ArrayI32Data { + repeated int32 value = 1; +} + +message ArrayU32Data { + repeated uint32 value = 1; +} + +message ArrayI64Data { + repeated int64 value = 1; +} + +message ArrayU64Data { + repeated uint64 value = 1; +} + +message ArrayBoolData { + repeated bool value = 1; +} \ No newline at end of file diff --git a/source/codegen/metadata/nifpga/functions.py b/source/codegen/metadata/nifpga/functions.py index 046f9e857..fd7e55009 100644 --- a/source/codegen/metadata/nifpga/functions.py +++ b/source/codegen/metadata/nifpga/functions.py @@ -1670,6 +1670,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayBoolData', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1683,7 +1685,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayDbl': { 'parameters': [ @@ -1728,6 +1731,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayI32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1741,7 +1746,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayI32': { 'parameters': [ @@ -1757,6 +1763,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayI32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1770,7 +1778,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayI64': { 'parameters': [ @@ -1786,6 +1795,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayI64Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1799,7 +1810,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayI8': { 'parameters': [ @@ -1815,6 +1827,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayI32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1828,7 +1842,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArraySgl': { 'parameters': [ @@ -1873,6 +1888,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1886,7 +1903,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayU32': { 'parameters': [ @@ -1902,6 +1920,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1915,7 +1935,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayU64': { 'parameters': [ @@ -1931,6 +1952,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayU64Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1944,7 +1967,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadArrayU8': { 'parameters': [ @@ -1960,6 +1984,8 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'ArrayU32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'passed-in', @@ -1973,7 +1999,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadBool': { 'parameters': [ @@ -1989,11 +2016,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'BoolData', + 'is_streaming_type': True, 'name': 'value', 'type': 'NiFpga_Bool' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadDbl': { 'parameters': [ @@ -2529,11 +2559,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'I32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int16_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadI32': { 'parameters': [ @@ -2549,11 +2582,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'I32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int32_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadI64': { 'parameters': [ @@ -2569,11 +2605,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'I64Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int64_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadI8': { 'parameters': [ @@ -2589,11 +2628,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'I32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int8_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadSgl': { 'parameters': [ @@ -2629,11 +2671,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'U32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint16_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadU32': { 'parameters': [ @@ -2649,11 +2694,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'U32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint32_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadU64': { 'parameters': [ @@ -2669,11 +2717,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'U64Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint64_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReadU8': { 'parameters': [ @@ -2689,11 +2740,14 @@ }, { 'direction': 'out', + 'grpc_streaming_type': 'U32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint8_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'ReleaseFifoElements': { 'parameters': [ @@ -3037,6 +3091,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayBoolData', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3050,7 +3106,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayDbl': { 'parameters': [ @@ -3095,6 +3152,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayI32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3108,7 +3167,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayI32': { 'parameters': [ @@ -3124,6 +3184,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayI32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3137,7 +3199,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayI64': { 'parameters': [ @@ -3153,6 +3216,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayI64Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3166,7 +3231,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayI8': { 'parameters': [ @@ -3182,6 +3248,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayI32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3195,7 +3263,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArraySgl': { 'parameters': [ @@ -3240,6 +3309,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayU32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3253,7 +3324,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayU32': { 'parameters': [ @@ -3269,6 +3341,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayU32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3282,7 +3356,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayU64': { 'parameters': [ @@ -3298,6 +3373,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayU64Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3311,7 +3388,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteArrayU8': { 'parameters': [ @@ -3327,6 +3405,8 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'ArrayU32Data', + 'is_streaming_type': True, 'name': 'array', 'size': { 'mechanism': 'len', @@ -3340,7 +3420,8 @@ 'type': 'size_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteBool': { 'parameters': [ @@ -3356,11 +3437,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'BoolData', + 'is_streaming_type': True, 'name': 'value', 'type': 'NiFpga_Bool' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteDbl': { 'parameters': [ @@ -3892,11 +3976,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'I32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int16_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteI32': { 'parameters': [ @@ -3912,11 +3999,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'I32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int32_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteI64': { 'parameters': [ @@ -3932,11 +4022,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'I64Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int64_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteI8': { 'parameters': [ @@ -3952,11 +4045,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'I32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'int8_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteSgl': { 'parameters': [ @@ -3992,11 +4088,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'U32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint16_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteU32': { 'parameters': [ @@ -4012,11 +4111,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'U32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint32_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteU64': { 'parameters': [ @@ -4032,11 +4134,14 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'U64Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint64_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True }, 'WriteU8': { 'parameters': [ @@ -4052,10 +4157,13 @@ }, { 'direction': 'in', + 'grpc_streaming_type': 'U32Data', + 'is_streaming_type': True, 'name': 'value', 'type': 'uint8_t' } ], - 'returns': 'NiFpga_Status' + 'returns': 'NiFpga_Status', + 'supports_streaming': True } -} +} \ No newline at end of file diff --git a/source/codegen/metadata_mutation.py b/source/codegen/metadata_mutation.py index 26fba6ac1..44fa6dbfa 100644 --- a/source/codegen/metadata_mutation.py +++ b/source/codegen/metadata_mutation.py @@ -1,5 +1,6 @@ """Metadata mutation.""" +import copy from collections import namedtuple from typing import Any, Dict, Optional @@ -117,6 +118,18 @@ def mutate(metadata: dict): if config["driver_name"] in _ALREADY_MUTATED: return + # Generate new streaming APIs for functions that support it. + all_functions = {} + + for function_name, function in metadata["functions"].items(): + all_functions[function_name] = function + + if function.get("supports_streaming") is True: + new_function_name = f"Begin{function_name}" + all_functions[new_function_name] = generate_streaming_metadata(function) + + metadata["functions"] = all_functions + move_zero_enums_to_front(metadata["enums"]) for custom_type in config["custom_types"]: @@ -124,8 +137,7 @@ def mutate(metadata: dict): set_grpc_type_for_custom_type_fields(fields, config) attribute_expander = AttributeAccessorExpander(metadata) - for function_name in metadata["functions"]: - function = metadata["functions"][function_name] + for function_name, function in metadata["functions"].items(): parameters = function["parameters"] add_get_last_error_params_if_needed(function, config) sanitize_names(parameters) @@ -139,6 +151,36 @@ def mutate(metadata: dict): attribute_expander.patch_attribute_enum_type(function_name, function) +def generate_streaming_metadata(function: dict) -> dict: + """Generate the streaming API metadata for a given function.""" + streaming_parameters = [] + + for param in function["parameters"]: + new_param = copy.deepcopy(param) + if new_param.get("is_streaming_type", False) is True: + new_param["include_in_proto"] = False + streaming_parameters.append(new_param) + + # Add the additional out parameter at the end + streaming_parameters.append( + { + "direction": "out", + "grpc_type": "ni.data_monikers.Moniker", + "name": "moniker", + "type": "ni::data_monikers::Moniker", + } + ) + + # Construct the streaming API metadata + streaming_metadata = { + "is_streaming_api": True, + "parameters": streaming_parameters, + "returns": function["returns"], + } + + return streaming_metadata + + def sanitize_names(parameters): """Sanitize name fields on a list of parameter objects. diff --git a/source/codegen/metadata_validation.py b/source/codegen/metadata_validation.py index 471f8ea11..ced095e94 100644 --- a/source/codegen/metadata_validation.py +++ b/source/codegen/metadata_validation.py @@ -1,4 +1,5 @@ """Metadata validation.""" + from typing import Any, Dict, List, Set import common_helpers @@ -124,6 +125,8 @@ class RULES: Optional("python_default_value"): Or(str, bool, int, float, None), Optional("is_grpc_enum"): bool, Optional("return_on_error_key"): str, + Optional("is_streaming_type"): bool, + Optional("grpc_streaming_type"): str, } ) @@ -173,6 +176,8 @@ class RULES: Optional("is_python_factory"): bool, Optional("python_description"): str, Optional("timeout_error"): str, + Optional("supports_streaming"): bool, + Optional("moniker_streaming_type"): str, } ) diff --git a/source/codegen/service_helpers.py b/source/codegen/service_helpers.py index f806e7636..e4b62dc62 100644 --- a/source/codegen/service_helpers.py +++ b/source/codegen/service_helpers.py @@ -318,7 +318,7 @@ def filter_api_functions(functions, only_mockable_functions=True): """Filter function metadata to only include those to be generated into the API library.""" def filter_function(function): - if function.get("codegen_method", "") == "no": + if function.get("codegen_method", "") == "no" or function.get("is_streaming_api", False): return False if only_mockable_functions and not common_helpers.can_mock_function(function["parameters"]): return False @@ -707,3 +707,27 @@ def get_protobuf_cpplib_type(grpc_type: str) -> str: return "std::string" return grpc_type + + +def get_streaming_type(parameters) -> str: + """Get the streaming type from the function data.""" + for param in parameters: + if param.get("is_streaming_type", False): + return param["type"] + return None + + +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"] + else: + return None + + +def get_c_api_name(function_name) -> str: + """Get the C API name for the given function name.""" + if function_name.startswith("Begin"): + base_name = function_name[len("Begin") :] + return f"{base_name}" + return f"{function_name}" diff --git a/source/codegen/templates/proto.mako b/source/codegen/templates/proto.mako index 0e1e5a126..ba9f1b448 100644 --- a/source/codegen/templates/proto.mako +++ b/source/codegen/templates/proto.mako @@ -9,6 +9,8 @@ functions = data["functions"] service_class_prefix = config["service_class_prefix"] function_enums = common_helpers.get_function_enums(functions, enums) external_proto_deps = common_helpers.list_external_proto_dependencies(functions) +additional_protos = config.get("additional_protos", []) +additional_protos.extend(external_proto_deps) %>\ <%namespace name="mako_helper" file="/proto_helpers.mako"/>\ @@ -19,6 +21,9 @@ external_proto_deps = common_helpers.list_external_proto_dependencies(functions) //--------------------------------------------------------------------- syntax = "proto3"; +% if config.get("has_moniker_streaming_apis", False): +option cc_enable_arenas = true; +% endif option java_multiple_files = true; option java_package = "${config["java_package"]}"; option java_outer_classname = "${service_class_prefix}"; @@ -30,7 +35,7 @@ package ${config["namespace_component"]}_grpc; import "nidevice.proto"; % endif import "session.proto"; -% for proto in external_proto_deps: +% for proto in additional_protos: import "${proto}"; % endfor @@ -63,4 +68,4 @@ ${mako_helper.define_request_message(function, input_parameters)}\ ${mako_helper.define_response_message(function, output_parameters)}\ -% endfor +% endfor \ No newline at end of file diff --git a/source/codegen/templates/service.cpp.mako b/source/codegen/templates/service.cpp.mako index f353ed736..ba25d7cde 100644 --- a/source/codegen/templates/service.cpp.mako +++ b/source/codegen/templates/service.cpp.mako @@ -12,14 +12,15 @@ custom_types = common_helpers.get_custom_types(config) (input_custom_types, output_custom_types) = common_helpers.get_input_and_output_custom_types(config, functions) has_async_functions = any(service_helpers.get_async_functions(functions)) has_two_dimension_functions = any(service_helpers.get_functions_with_two_dimension_param(functions)) -function_names = service_helpers.filter_proto_rpc_functions_to_generate(functions) +functions_to_generate = service_helpers.filter_proto_rpc_functions_to_generate(functions) +streaming_functions_to_generate = common_helpers.filter_moniker_streaming_functions (functions, functions_to_generate) # If there are any non-mockable functions, we need to call the library directly, which # means we need another include file -any_non_mockable_functions = any(not common_helpers.can_mock_function(functions[name]['parameters']) for name in function_names) +any_non_mockable_functions = any(not common_helpers.can_mock_function(functions[name]['parameters']) for name in functions_to_generate) # Define the constant for buffer too small if we have any of these functions. any_ivi_dance_functions = any( common_helpers.has_ivi_dance_with_a_twist_param(functions[name]['parameters']) or - common_helpers.has_ivi_dance_param(functions[name]['parameters']) for name in function_names) + common_helpers.has_ivi_dance_param(functions[name]['parameters']) for name in functions_to_generate) resource_repository_deps = service_helpers.get_driver_shared_resource_repository_ptr_deps(config, functions) %>\ @@ -51,6 +52,9 @@ resource_repository_deps = service_helpers.get_driver_shared_resource_repository % if any_non_mockable_functions: #include "${module_name}_library.h" % endif +% if streaming_functions_to_generate: +#include +% endif namespace ${config["namespace_component"]}_grpc { @@ -59,6 +63,13 @@ namespace ${config["namespace_component"]}_grpc { using nidevice_grpc::converters::convert_from_grpc; using nidevice_grpc::converters::convert_to_grpc; using nidevice_grpc::converters::MatchState; +% for function_name in streaming_functions_to_generate: +<% +function_data = functions[function_name] +parameters = function_data['parameters'] +%> +${mako_helper.define_moniker_streaming_struct(function_name=function_name, parameters=parameters)}\ +% endfor % if any_ivi_dance_functions: const auto kErrorReadBufferTooSmall = -200229; @@ -100,6 +111,20 @@ namespace ${config["namespace_component"]}_grpc { } % endif +% if streaming_functions_to_generate: + void RegisterMonikerEndpoints() + { +% for function_name in streaming_functions_to_generate: + ${mako_helper.register_moniker_functions(function_name)}\ +% endfor + } +% endif +% for function_name in streaming_functions_to_generate: +<% +function_data = functions[function_name] +%> +${mako_helper.define_moniker_function_body(function_name=function_name, function_data=function_data)}\ +% endfor % for function_name in service_helpers.filter_proto_rpc_functions_to_generate(functions): <% function_data = functions[function_name] @@ -137,6 +162,8 @@ ${mako_helper.define_ivi_dance_method_body(function_name=function_name, function ${mako_helper.define_ivi_dance_with_a_twist_method_body(function_name=function_name, function_data=function_data, parameters=parameters)} % elif common_helpers.has_repeated_varargs_parameter(parameters): ${mako_helper.define_repeated_varargs_method_body(function_name=function_name, function_data=function_data, parameters=parameters)} +% elif common_helpers.is_function_in_streaming_functions(function_name, streaming_functions_to_generate): +${mako_helper.define_streaming_api_body(function_name=function_name, function_data=function_data, parameters=parameters)} % else: ${mako_helper.define_simple_method_body(function_name=function_name, function_data=function_data, parameters=parameters)} % endif diff --git a/source/codegen/templates/service.h.mako b/source/codegen/templates/service.h.mako index 09c9e6cc0..9c09f6b13 100644 --- a/source/codegen/templates/service.h.mako +++ b/source/codegen/templates/service.h.mako @@ -17,6 +17,8 @@ custom_types = common_helpers.get_custom_types(config) (input_custom_types, output_custom_types) = common_helpers.get_input_and_output_custom_types(config, functions) resource_repository_deps = service_helpers.get_driver_shared_resource_repository_ptr_deps(config, functions) resource_handle_types = service_helpers.get_resource_handle_types(config) +functions_to_generate = common_helpers.filter_proto_rpc_functions(functions) +data_moniker_functions = common_helpers.filter_moniker_streaming_functions(functions, functions_to_generate) async_functions = service_helpers.get_async_functions(functions) has_async_functions = any(async_functions) @@ -59,6 +61,17 @@ struct ${service_class_prefix}FeatureToggles bool ${service_helpers.get_toggle_member_name(toggle)}; % endfor }; +% if data_moniker_functions: + +void RegisterMonikerEndpoints(); + +% for function in data_moniker_functions: +<% + method_name = common_helpers.get_data_moniker_function_name(function) +%>\ +::grpc::Status ${method_name}(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData); +% endfor +% endif % if type_from_enum != "": enum TypeIdentifier { ${type_from_enum} }; @@ -79,7 +92,7 @@ public: const ${service_class_prefix}FeatureToggles& feature_toggles = {}); virtual ~${service_class_prefix}Service(); -% for function in common_helpers.filter_proto_rpc_functions(functions): +% for function in functions_to_generate: <% f = functions[function] method_name = common_helpers.snake_to_pascal(function) diff --git a/source/codegen/templates/service_helpers.mako b/source/codegen/templates/service_helpers.mako index aee41c31f..7d022f26f 100644 --- a/source/codegen/templates/service_helpers.mako +++ b/source/codegen/templates/service_helpers.mako @@ -271,6 +271,234 @@ ${populate_response(function_data=function_data, parameters=parameters)}\ return ::grpc::Status::OK;\ +<%def name="register_moniker_functions(function_name)">\ +<% + moniker_function_name = common_helpers.get_data_moniker_function_name(function_name) +%>\ + ni::data_monikers::DataMonikerService::RegisterMonikerEndpoint("${moniker_function_name}", ${moniker_function_name}); + + +<%def name="define_moniker_streaming_struct(function_name, parameters)">\ +<% + config = data['config'] + streaming_param = common_helpers.get_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) + streaming_param_to_include = common_helpers.get_input_streaming_param(parameters) +%>\ + struct ${struct_name} + { + % for param in streaming_param_to_include: + ${param['type']} ${param['name']}; + % endfor + ${service_class_prefix.lower()}_grpc::${grpc_streaming_type} data; + std::shared_ptr<${service_class_prefix}LibraryInterface> library; + }; + + +<%def name="define_moniker_function_body(function_name, function_data)">\ +<% + 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_type = streaming_param['type'] + grpc_streaming_type = streaming_param['grpc_streaming_type'] + arg_string = service_helpers.create_args(function_data['parameters']) + arg_string = arg_string.replace(", &moniker", "").strip() + data_type = streaming_type.replace("[]", "") + c_api_name = service_helpers.get_c_api_name(function_name) + streaming_param_to_include = common_helpers.get_input_streaming_param(function_data['parameters']) +%>\ +::grpc::Status ${moniker_function_name}(void* data, google::protobuf::Arena& arena, google::protobuf::Any& packedData) +{ + ${struct_name}* function_data = (${struct_name}*)data; + auto library = function_data->library;\ + ${initialize_moniker_streaming_parameters(streaming_param_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 + if (status < 0) { + std::cout << "${moniker_function_name} error: " << status << std::endl; + } + return ::grpc::Status::OK; +} + + +<%def name="define_streaming_api_body(function_name, function_data, parameters)">\ +<% + config = data['config'] + output_params = [p for p in parameters if common_helpers.is_output_parameter(p)] + service_class_prefix = config["service_class_prefix"] + request_param = service_helpers.get_request_param(function_name) + 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_to_include = common_helpers.get_input_streaming_param(parameters) +%>\ +${initialize_streaming_input_param(function_name, streaming_param_to_include, parameters, streaming_param)} + auto data = std::make_unique<${struct_name}>();\ + ${initialize_begin_input_param(streaming_param_to_include, streaming_param)}\ + data->library = std::shared_ptr<${service_class_prefix}LibraryInterface>(library_); + ${initialize_service_output_params(output_params)}\ + auto moniker = std::make_unique(); + ni::data_monikers::DataMonikerService::RegisterMonikerInstance("${moniker_function_name}", data.get(), *moniker); + response->set_allocated_moniker(moniker.release()); + response->set_status(0); + return ::grpc::Status::OK;\ + + +<%def name="streaming_handle_out_direction(c_api_name, arg_string, data_type, streaming_type, streaming_param)"> +<% + is_array = common_helpers.is_array(streaming_type) +%>\ +% 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)} +% 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) +%>\ +% if common_helpers.supports_standard_copy_conversion_routines(streaming_param): +std::vector<${data_type}> array(${size}, ${data_type}()); +% elif is_coerced: +std::vector<${data_type}> array(${size}); +% else: +auto array_storage = std::vector<${data_type}>(); + auto array = array_storage.data(); +% endif + auto status = library->${c_api_name}(${arg_string}); +% if is_coerced or common_helpers.supports_standard_copy_conversion_routines(streaming_param): + if (status >= 0) { + std::transform( + array.begin(), + array.begin() + ${size}, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } +% else: + if (status >= 0) { + std::transform( + array, + array + ${size}, + function_data->data.mutable_value()->begin(), + [&](auto x) { + return x; + }); + packedData.PackFrom(function_data->data); + } +% endif + + +<%def name="streaming_handle_out_direction_scaler(c_api_name, arg_string, streaming_type)">\ +${streaming_type} value = 0; + auto status = library->${c_api_name}(${arg_string}); + function_data->data.set_value(value); + if (status >= 0) { + packedData.PackFrom(function_data->data); + } + + +<%def name="streaming_handle_in_direction(c_api_name, arg_string, data_type, grpc_streaming_type, streaming_type, streaming_param)"> +<% + is_array = common_helpers.is_array(streaming_type) +%>\ + ${grpc_streaming_type} ${grpc_streaming_type.lower()}_message; + packedData.UnpackTo(&${grpc_streaming_type.lower()}_message); +% if is_array: + ${streaming_handle_in_direction_array(data_type, grpc_streaming_type, streaming_param)}\ +% else: + ${streaming_handle_in_direction_scaler(grpc_streaming_type, streaming_type, streaming_param)}\ +% endif + + auto status = library->${c_api_name}(${arg_string}); + + +<%def name="streaming_handle_in_direction_scaler(grpc_streaming_type, streaming_type, streaming_param)">\ +<% + is_coerced = service_helpers.is_scalar_input_that_needs_coercion(streaming_param) +%>\ +auto value = ${grpc_streaming_type.lower()}_message.value(); +% if is_coerced: + if (value < std::numeric_limits<${streaming_type}>::min() || value > std::numeric_limits<${streaming_type}>::max()) { + std::string message("value " + std::to_string(value) + " doesn't fit in datatype ${streaming_type}"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } +% endif + + +<%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) +%>\ +% 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()); + auto size = data_array.size(); +% elif is_coerced: + auto data_array = ${grpc_streaming_type.lower()}_message.value(); + auto array = std::vector<${data_type}>(); + auto size = data_array.size(); + array.reserve(size); + std::transform( + data_array.begin(), + data_array.end(), + std::back_inserter(array), + [](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}"); + throw nidevice_grpc::ValueOutOfRangeException(message); + } + return static_cast<${data_type}>(x); + }); +% else: + auto data_array = ${grpc_streaming_type.lower()}_message.value(); + auto array = const_cast<${data_type}*>(${grpc_streaming_type.lower()}_message.value().data()); + auto size = data_array.size(); +% endif + + +## Initialize an bgin input parameter for an API call. +<%def name="initialize_begin_input_param(streaming_param_to_include, streaming_param)"> +% for param in streaming_param_to_include: + data->${param['name']} = ${param['name']}; +% endfor + + +## Initialize an bgin input parameter for an API call. +<%def name="initialize_streaming_input_param(function_name, streaming_param_to_include, parameters, streaming_param)">\ +% for param in streaming_param_to_include: +${initialize_input_param(function_name, param, parameters)}\ +% endfor + + +<%def name="initialize_moniker_streaming_parameters(streaming_param_to_include)"> +% for param in streaming_param_to_include: + auto ${param['name']} = function_data->${param['name']}; +% endfor + + +<%def name="initialize_service_output_params(output_params)"> +% 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); +% endif +% endfor + + ## Initialize the input parameters to the API call. <%def name="initialize_input_params(function_name, parameters)">\ <% @@ -977,4 +1205,4 @@ ${copy_to_response_with_transform(source_buffer=parameter_name, parameter_name=p ${auto_decl}status = ${service_helpers.get_status_expression(function_data)}; % endif \ - + \ No newline at end of file diff --git a/source/codegen/templates/service_registrar.cpp.mako b/source/codegen/templates/service_registrar.cpp.mako index f35f4dfd7..2dcfdf22a 100644 --- a/source/codegen/templates/service_registrar.cpp.mako +++ b/source/codegen/templates/service_registrar.cpp.mako @@ -21,6 +21,9 @@ service_class_prefix = config["service_class_prefix"] #include "${module_name}_service.h" #include "${module_name}_service_registrar.h" +% if config.get("has_moniker_streaming_apis", False): +#include +% endif namespace ${namespace} { @@ -43,6 +46,18 @@ std::shared_ptr register_service( % endfor toggles); builder.RegisterService(service.get()); +% if config.get("has_moniker_streaming_apis", False): + + if (ni::data_monikers::is_sideband_streaming_enabled(feature_toggles)) { +<% + namespace = f"{config['namespace_component']}_grpc" +%>\ +<%block filter="common_helpers.os_conditional_compile_block(config)">\ + ${namespace}::RegisterMonikerEndpoints(); +\ + } + +% endif return service; }