From 0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 1 Jan 2025 12:44:02 -0800 Subject: protocols: move content from the protocols to nng.h This should simplify things for developers. Just one header to include in most cases now. --- src/sp/protocol/bus0/bus.c | 3 +-- src/sp/protocol/bus0/bus_test.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src/sp/protocol/bus0') diff --git a/src/sp/protocol/bus0/bus.c b/src/sp/protocol/bus0/bus.c index 4822ffd6..99c3a9bf 100644 --- a/src/sp/protocol/bus0/bus.c +++ b/src/sp/protocol/bus0/bus.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. +// Copyright 2025 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -12,7 +12,6 @@ #include #include "core/nng_impl.h" -#include "nng/protocol/bus0/bus.h" #include // Bus protocol. The BUS protocol, each peer sends a message to its peers. diff --git a/src/sp/protocol/bus0/bus_test.c b/src/sp/protocol/bus0/bus_test.c index fd0116e7..55231770 100644 --- a/src/sp/protocol/bus0/bus_test.c +++ b/src/sp/protocol/bus0/bus_test.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. +// Copyright 2025 Staysail Systems, Inc. // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -14,6 +14,11 @@ #define SECOND 1000 +#define BUS0_SELF 0x70 +#define BUS0_PEER 0x70 +#define BUS0_SELF_NAME "bus" +#define BUS0_PEER_NAME "bus" + void test_bus_identity(void) { @@ -23,13 +28,13 @@ test_bus_identity(void) NUTS_PASS(nng_bus0_open(&s)); NUTS_PASS(nng_socket_proto_id(s, &p)); - NUTS_TRUE(p == NNG_BUS0_SELF); + NUTS_TRUE(p == BUS0_SELF); NUTS_PASS(nng_socket_peer_id(s, &p)); - NUTS_TRUE(p == NNG_BUS0_PEER); // 49 + NUTS_TRUE(p == BUS0_PEER); // 49 NUTS_PASS(nng_socket_proto_name(s, &n)); - NUTS_MATCH(n, NNG_BUS0_SELF_NAME); + NUTS_MATCH(n, BUS0_SELF_NAME); NUTS_PASS(nng_socket_peer_name(s, &n)); - NUTS_MATCH(n, NNG_BUS0_PEER_NAME); + NUTS_MATCH(n, BUS0_PEER_NAME); NUTS_CLOSE(s); } -- cgit v1.2.3-70-g09d2