Skip to content

Commit 75d54a4

Browse files
committed
declare cbor encoding, release v0.3.5
1 parent 43d65ed commit 75d54a4

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

build.zig.zon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.{
22
.name = .gatorcat,
3-
.version = "0.3.4",
3+
.version = "0.3.5",
44
.fingerprint = 0xb9356c7c4de9ca59, // Changing this has security and trust implications.
55
.minimum_zig_version = "0.14.0",
66
.dependencies = .{

doc/examples/python_gui/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
environment:
1313
- PYTHONUNBUFFERED=1
1414
gatorcat:
15-
image: ghcr.io/kj4tmp/gatorcat:0.3.3
15+
image: ghcr.io/kj4tmp/gatorcat:0.3.4
1616
command: run --ifname enx00e04c68191a --zenoh-config-default
1717
volumes:
1818
- /dev/shm/:/dev/shm/

doc/examples/python_gui/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def subscribe_in_background():
2020
last_print_time = time.perf_counter_ns()
2121
print(f"last print time: {last_print_time}")
2222
for sample in sub:
23+
if sample.encoding != zenoh.Encoding.APPLICATION_CBOR:
24+
print(f"wrong encoding: {sample.encoding}")
25+
continue
2326
if sample.kind == zenoh.SampleKind.DELETE:
2427
channels.pop(str(sample.key_expr), None)
2528
elif sample.kind == zenoh.SampleKind.PUT:

src/cli/run.zig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,9 @@ pub const ZenohHandler = struct {
875875
fn publishAssumeKey(self: *ZenohHandler, key: [:0]const u8, payload: []const u8) !void {
876876
var options: zenoh.c.z_publisher_put_options_t = undefined;
877877
zenoh.c.z_publisher_put_options_default(&options);
878+
var encoding: zenoh.c.z_owned_encoding_t = undefined;
879+
zenoh.c.z_encoding_clone(&encoding, zenoh.c.z_encoding_application_cbor());
880+
options.encoding = zenoh.move(&encoding);
878881
var bytes: zenoh.c.z_owned_bytes_t = undefined;
879882
const result_copy = zenoh.c.z_bytes_copy_from_buf(&bytes, payload.ptr, payload.len);
880883
try zenoh.err(result_copy);

0 commit comments

Comments
 (0)