Skip to content

Commit

Permalink
Add PXI failure trigger index to trailing metadata (#1015)
Browse files Browse the repository at this point in the history
* Add PXI failing trigger index to trailing metadata
* Update to use 'return_on_error_key' instead of custom code
  • Loading branch information
dmondrik authored Oct 17, 2023
1 parent 1e69024 commit aa188e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion generated/visa/visa.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,6 @@ message PxiReserveTriggersRequest {

message PxiReserveTriggersResponse {
int32 status = 1;
sint32 failure_index = 2;
}

message ReadRequest {
Expand Down
2 changes: 1 addition & 1 deletion generated/visa/visa_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1632,11 +1632,11 @@ namespace visa_grpc {
[](auto x) { return (ViInt16)x; });
ViInt16 failure_index {};
auto status = library_->PxiReserveTriggers(vi, cnt, trig_buses.data(), trig_lines.data(), &failure_index);
context->AddTrailingMetadata("ni-failure-index", std::to_string(failure_index));
if (!status_ok(status)) {
return ConvertApiErrorStatusForViSession(context, status, vi);
}
response->set_status(status);
response->set_failure_index(failure_index);
return ::grpc::Status::OK;
}
catch (nidevice_grpc::NonDriverException& ex) {
Expand Down
2 changes: 2 additions & 0 deletions source/codegen/metadata/visa/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,9 @@
},
{
'direction': 'out',
'include_in_proto': False,
'name': 'failureIndex',
'return_on_error_key': 'ni-failure-index',
'type': 'ViInt16'
}
],
Expand Down

0 comments on commit aa188e3

Please sign in to comment.