aboutsummaryrefslogtreecommitdiff
path: root/src/sp/protocol/bus0
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-01 12:44:02 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-01 12:44:02 -0800
commit0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13 (patch)
tree2dc9ded3dfc724df42a360a9f2de359f406e537f /src/sp/protocol/bus0
parentf8a2abaf931557030fd6e6683617c6a7877eebf7 (diff)
downloadnng-0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13.tar.gz
nng-0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13.tar.bz2
nng-0d23af92531b7c0dd6d7b74c73c1a8c4811c7d13.zip
protocols: move content from the protocols to nng.h
This should simplify things for developers. Just one header to include in most cases now.
Diffstat (limited to 'src/sp/protocol/bus0')
-rw-r--r--src/sp/protocol/bus0/bus.c3
-rw-r--r--src/sp/protocol/bus0/bus_test.c15
2 files changed, 11 insertions, 7 deletions
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. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -12,7 +12,6 @@
#include <stdlib.h>
#include "core/nng_impl.h"
-#include "nng/protocol/bus0/bus.h"
#include <stdio.h>
// 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. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
//
// 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);
}