Skip to content

Commit

Permalink
Fix incorrect Enum->int functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles-Schleich committed Dec 10, 2024
1 parent bd64a24 commit 20c3c8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion zenoh-ts/examples/src/z_querier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function main() {
);

for(let i =0; i<1000; i++) {
sleep(1000)
await sleep(1000)
let payload = "["+i+"] Querier Get from Zenoh-ts!";
let receiver = querier.get({payload:payload}) as Receiver;

Expand Down
20 changes: 10 additions & 10 deletions zenoh-ts/src/querier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ export enum QueryTarget {
export function query_target_to_int(query_target?: QueryTarget): number {
switch (query_target) {
case QueryTarget.BestMatching:
return 1;
return 0;
case QueryTarget.All:
return 2;
return 1;
case QueryTarget.AllComplete:
return 3;
return 2;
default:
// Default is QueryTarget.BestMatching
return 1;
Expand All @@ -65,14 +65,14 @@ export enum Locality {
export function locality_to_int(query_target?: Locality): number {
switch (query_target) {
case Locality.SessionLocal:
return 1;
return 0;
case Locality.Remote:
return 2;
return 1;
case Locality.Any:
return 3;
return 2;
default:
// Default is Locality.Any
return 3;
return 2;
}
}

Expand All @@ -90,12 +90,12 @@ export enum ReplyKeyExpr {
export function reply_key_expr_to_int(query_target?: ReplyKeyExpr): number {
switch (query_target) {
case ReplyKeyExpr.Any:
return 1;
return 0;
case ReplyKeyExpr.MatchingQuery:
return 2;
return 1;
default:
// Default is ReplyKeyExpr.MatchingQuery
return 2;
return 1;
}
}

Expand Down

0 comments on commit 20c3c8a

Please sign in to comment.