Skip to content

Commit

Permalink
[New Feature] Add ViWriteFromFile rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
fanoping committed Jul 2, 2024
1 parent c87dd19 commit b1d8719
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 20 deletions.
39 changes: 32 additions & 7 deletions proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,29 @@ Send commands to the application with the parameter *command*. Return AQVI_NO_ER

See also [ViWriteRequest](#ViWriteRequest) and [ViWriteResponse](#ViWriteResponse) messages.

### ViWriteFromFile

This RPC is used for send configuration file instead of sending commands to the application. The configuration file is in JSON format. It is loaded and the payload can be transferred over gRPC.

See also [ViWriteFromFileRequest](#ViWriteFromFileRequest) and [ViWriteFromFileResponse](#ViWriteFromFileResponse) messages.

## Messages

### ViReadRequest

* Parameter

- bytes ***jobid*** [deprecated]: NOT IN USE.
- int64 ***count***: Represents the size of the data buffer to receive data from the application.

### ViReadResponse

* Parameter

- [AQVI_STATUS](#AQVI_STATUS) ***status_code***: Return status.
- bytes ***command_response***: Queried response from the previous [ViWrite](#ViWrite) command.
- int64 ***ret_count***: Represents the length of the responses

### ViWriteRequest

* Parameter
Expand All @@ -39,20 +60,24 @@ See also [ViWriteRequest](#ViWriteRequest) and [ViWriteResponse](#ViWriteRespons
- bytes ***jobid***: Represents the unique identification of the ViWrite call.
- [AQVI_STATUS](#AQVI_STATUS) ***status_code***: Return status.

### ViReadRequest
### ViWriteFromFileRequest

* Parameter

- bytes ***jobid*** [deprecated]: NOT IN USE.
- int64 ***count***: Represents the size of the data buffer to receive data from the application.
- bytes ***payload***: A byte array payload loaded from JSON configuration file.
Currently supported schema is as follows

### ViReadResponse

* Parameter
| Schema Name | Schema |
| ----------- | ----- |
| Electrical Validation | TBD |

### ViWriteFromFileResponse

* Parameter

- bytes ***jobid***: Represents the unique identification of the [ViWriteFromFile](#ViWriteFromFile) call.
- [AQVI_STATUS](#AQVI_STATUS) ***status_code***: Return status.
- bytes ***command_response***: Queried response from the previous ViWrite command.
- int64 ***ret_count***: Represents the length of the responses

## Status Code

Expand Down
39 changes: 26 additions & 13 deletions proto/aqvisa.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ option java_multiple_files = true;
option objc_class_prefix = "Acute";

service AqVISA {
rpc ViWrite (ViWriteRequest) returns (ViWriteResponse) {}
rpc ViRead (ViReadRequest) returns (ViReadResponse) {}
rpc ViWrite (ViWriteRequest) returns (ViWriteResponse) {}
rpc ViWriteFromFile (ViWriteFromFileRequest) returns (ViWriteFromFileResponse) {}
rpc ViGetCommandResult (ViGetCommandResultRequest) returns (ViGetCommandResultResponse) {
option deprecated = true;
}
Expand Down Expand Up @@ -56,7 +57,7 @@ enum AQVI_STATUS {
// Error: Input command requires exist Logic Analyzer SubWindow
AQVI_LASUBWND_INVALID = 1005;

// Command Error: Input command requires exist Protocol Analyzer SubWindow
// Error: Input command requires exist Protocol Analyzer SubWindow
AQVI_PASUBWND_INVALID = 1006;

// Error: Input command requires existing Decode Report
Expand Down Expand Up @@ -119,6 +120,9 @@ enum AQVI_STATUS {
// Error: Software doesn't have any valid EV analysis result
AQVI_NO_EV_ANALYSIS_RESULT = 1026;

// Error: Selected Device S/N not presented in device list
AQVI_SELECT_DEV_NOT_EXIST = 1027;

// Error: Unsupported feature
AQVI_UNSUPPORT_FEATURE = 9995;

Expand All @@ -132,6 +136,17 @@ enum AQVI_STATUS {
AQVI_UNKNOWN_ERROR = 9998;
}

message ViReadRequest {
bytes job_id = 1 [deprecated = true];
int64 count = 2;
}

message ViReadResponse {
AQVI_STATUS status_code = 1;
optional bytes command_response = 2;
optional int64 ret_count = 3;
}

message ViWriteRequest {
bytes command = 1;
}
Expand All @@ -141,6 +156,15 @@ message ViWriteResponse {
AQVI_STATUS status_code = 2;
}

message ViWriteFromFileRequest {
bytes payload = 1;
}

message ViWriteFromFileResponse {
optional bytes job_id = 1;
AQVI_STATUS status_code = 2;
}

message ViGetCommandResultRequest {
option deprecated = true;
bytes job_id = 1;
Expand All @@ -150,14 +174,3 @@ message ViGetCommandResultResponse {
option deprecated = true;
AQVI_STATUS status_code = 1;
}

message ViReadRequest {
bytes job_id = 1 [deprecated = true];
int64 count = 2;
}

message ViReadResponse {
AQVI_STATUS status_code = 1;
optional bytes command_response = 2;
optional int64 ret_count = 3;
}

0 comments on commit b1d8719

Please sign in to comment.