Skip to content

Commit

Permalink
remove eof
Browse files Browse the repository at this point in the history
  • Loading branch information
cheukt committed Jan 16, 2025
1 parent 3ffb161 commit 81e5667
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 140 deletions.
28 changes: 10 additions & 18 deletions gen/js/robot/v1/robot_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ export class TunnelRequest extends jspb.Message {
getDestinationPort(): number;
setDestinationPort(value: number): void;

getDataIn(): Uint8Array | string;
getDataIn_asU8(): Uint8Array;
getDataIn_asB64(): string;
setDataIn(value: Uint8Array | string): void;

getEof(): boolean;
setEof(value: boolean): void;
getData(): Uint8Array | string;
getData_asU8(): Uint8Array;
getData_asB64(): string;
setData(value: Uint8Array | string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): TunnelRequest.AsObject;
Expand All @@ -33,19 +30,15 @@ export class TunnelRequest extends jspb.Message {
export namespace TunnelRequest {
export type AsObject = {
destinationPort: number,
dataIn: Uint8Array | string,
eof: boolean,
data: Uint8Array | string,
}
}

export class TunnelResponse extends jspb.Message {
getDataOut(): Uint8Array | string;
getDataOut_asU8(): Uint8Array;
getDataOut_asB64(): string;
setDataOut(value: Uint8Array | string): void;

getEof(): boolean;
setEof(value: boolean): void;
getData(): Uint8Array | string;
getData_asU8(): Uint8Array;
getData_asB64(): string;
setData(value: Uint8Array | string): void;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): TunnelResponse.AsObject;
Expand All @@ -59,8 +52,7 @@ export class TunnelResponse extends jspb.Message {

export namespace TunnelResponse {
export type AsObject = {
dataOut: Uint8Array | string,
eof: boolean,
data: Uint8Array | string,
}
}

Expand Down
116 changes: 28 additions & 88 deletions gen/js/robot/v1/robot_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,7 @@ proto.viam.robot.v1.TunnelRequest.prototype.toObject = function(opt_includeInsta
proto.viam.robot.v1.TunnelRequest.toObject = function(includeInstance, msg) {
var f, obj = {
destinationPort: jspb.Message.getFieldWithDefault(msg, 1, 0),
dataIn: msg.getDataIn_asB64(),
eof: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
data: msg.getData_asB64()
};

if (includeInstance) {
Expand Down Expand Up @@ -1382,11 +1381,7 @@ proto.viam.robot.v1.TunnelRequest.deserializeBinaryFromReader = function(msg, re
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setDataIn(value);
break;
case 3:
var value = /** @type {boolean} */ (reader.readBool());
msg.setEof(value);
msg.setData(value);
break;
default:
reader.skipField();
Expand Down Expand Up @@ -1424,20 +1419,13 @@ proto.viam.robot.v1.TunnelRequest.serializeBinaryToWriter = function(message, wr
f
);
}
f = message.getDataIn_asU8();
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
f = message.getEof();
if (f) {
writer.writeBool(
3,
f
);
}
};


Expand All @@ -1460,65 +1448,47 @@ proto.viam.robot.v1.TunnelRequest.prototype.setDestinationPort = function(value)


/**
* optional bytes data_in = 2;
* optional bytes data = 2;
* @return {string}
*/
proto.viam.robot.v1.TunnelRequest.prototype.getDataIn = function() {
proto.viam.robot.v1.TunnelRequest.prototype.getData = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
* optional bytes data_in = 2;
* This is a type-conversion wrapper around `getDataIn()`
* optional bytes data = 2;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.viam.robot.v1.TunnelRequest.prototype.getDataIn_asB64 = function() {
proto.viam.robot.v1.TunnelRequest.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getDataIn()));
this.getData()));
};


/**
* optional bytes data_in = 2;
* optional bytes data = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getDataIn()`
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.viam.robot.v1.TunnelRequest.prototype.getDataIn_asU8 = function() {
proto.viam.robot.v1.TunnelRequest.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getDataIn()));
this.getData()));
};


/**
* @param {!(string|Uint8Array)} value
* @return {!proto.viam.robot.v1.TunnelRequest} returns this
*/
proto.viam.robot.v1.TunnelRequest.prototype.setDataIn = function(value) {
proto.viam.robot.v1.TunnelRequest.prototype.setData = function(value) {
return jspb.Message.setProto3BytesField(this, 2, value);
};


/**
* optional bool eof = 3;
* @return {boolean}
*/
proto.viam.robot.v1.TunnelRequest.prototype.getEof = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
};


/**
* @param {boolean} value
* @return {!proto.viam.robot.v1.TunnelRequest} returns this
*/
proto.viam.robot.v1.TunnelRequest.prototype.setEof = function(value) {
return jspb.Message.setProto3BooleanField(this, 3, value);
};





Expand Down Expand Up @@ -1551,8 +1521,7 @@ proto.viam.robot.v1.TunnelResponse.prototype.toObject = function(opt_includeInst
*/
proto.viam.robot.v1.TunnelResponse.toObject = function(includeInstance, msg) {
var f, obj = {
dataOut: msg.getDataOut_asB64(),
eof: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
data: msg.getData_asB64()
};

if (includeInstance) {
Expand Down Expand Up @@ -1591,11 +1560,7 @@ proto.viam.robot.v1.TunnelResponse.deserializeBinaryFromReader = function(msg, r
switch (field) {
case 1:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setDataOut(value);
break;
case 2:
var value = /** @type {boolean} */ (reader.readBool());
msg.setEof(value);
msg.setData(value);
break;
default:
reader.skipField();
Expand Down Expand Up @@ -1626,83 +1591,58 @@ proto.viam.robot.v1.TunnelResponse.prototype.serializeBinary = function() {
*/
proto.viam.robot.v1.TunnelResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getDataOut_asU8();
f = message.getData_asU8();
if (f.length > 0) {
writer.writeBytes(
1,
f
);
}
f = message.getEof();
if (f) {
writer.writeBool(
2,
f
);
}
};


/**
* optional bytes data_out = 1;
* optional bytes data = 1;
* @return {string}
*/
proto.viam.robot.v1.TunnelResponse.prototype.getDataOut = function() {
proto.viam.robot.v1.TunnelResponse.prototype.getData = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
* optional bytes data_out = 1;
* This is a type-conversion wrapper around `getDataOut()`
* optional bytes data = 1;
* This is a type-conversion wrapper around `getData()`
* @return {string}
*/
proto.viam.robot.v1.TunnelResponse.prototype.getDataOut_asB64 = function() {
proto.viam.robot.v1.TunnelResponse.prototype.getData_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getDataOut()));
this.getData()));
};


/**
* optional bytes data_out = 1;
* optional bytes data = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getDataOut()`
* This is a type-conversion wrapper around `getData()`
* @return {!Uint8Array}
*/
proto.viam.robot.v1.TunnelResponse.prototype.getDataOut_asU8 = function() {
proto.viam.robot.v1.TunnelResponse.prototype.getData_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getDataOut()));
this.getData()));
};


/**
* @param {!(string|Uint8Array)} value
* @return {!proto.viam.robot.v1.TunnelResponse} returns this
*/
proto.viam.robot.v1.TunnelResponse.prototype.setDataOut = function(value) {
proto.viam.robot.v1.TunnelResponse.prototype.setData = function(value) {
return jspb.Message.setProto3BytesField(this, 1, value);
};


/**
* optional bool eof = 2;
* @return {boolean}
*/
proto.viam.robot.v1.TunnelResponse.prototype.getEof = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
};


/**
* @param {boolean} value
* @return {!proto.viam.robot.v1.TunnelResponse} returns this
*/
proto.viam.robot.v1.TunnelResponse.prototype.setEof = function(value) {
return jspb.Message.setProto3BooleanField(this, 2, value);
};





Expand Down
6 changes: 2 additions & 4 deletions proto/viam/robot/v1/robot.proto
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,11 @@ service RobotService {

message TunnelRequest {
uint32 destination_port = 1;
bytes data_in = 2;
bool eof = 3;
bytes data = 2;
}

message TunnelResponse {
bytes data_out = 1;
bool eof = 2;
bytes data = 1;
}

message FrameSystemConfig {
Expand Down
41 changes: 11 additions & 30 deletions robot/v1/robot.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 81e5667

Please sign in to comment.