Skip to content

Commit

Permalink
[#175] move main nodes -> devicenodes
Browse files Browse the repository at this point in the history
  • Loading branch information
susanw1 committed Jan 15, 2025
1 parent 0a19d06 commit 7032822
Show file tree
Hide file tree
Showing 25 changed files with 33 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import net.zscript.javaclient.commandpaths.ResponseElement;
import net.zscript.javaclient.commandpaths.ZscriptFieldSet;
import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;
import net.zscript.javaclient.sequence.ResponseSequence;
import net.zscript.javareceiver.testing.CollectingConsumer;
import net.zscript.model.components.Zchars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

import net.zscript.javaclient.commandpaths.ResponseElement;
import net.zscript.javaclient.commandpaths.ResponseExecutionPath;
import net.zscript.javaclient.devicenodes.DirectConnection;
import net.zscript.javaclient.devicenodes.ZscriptNode;
import net.zscript.javaclient.devices.ZscriptDevice;
import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.nodes.ZscriptNode;
import net.zscript.javareceiver.testing.CollectingConsumer;
import net.zscript.model.ZscriptModel;
import net.zscript.model.components.Zchars;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;
import net.zscript.javaclient.testing.LocalConnection;
import net.zscript.javareceiver.core.Zscript;
import net.zscript.javareceiver.modules.core.ZscriptCoreModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
* success/failure, so a CommandExecutionPath is essentially "execution-aware".
* <p>
* It's the bare "thing that we want executing", before adding the addressing and sequence-level fields which get it to the right place and in the right state. These might be added
* by a client runtime representing a device node hierarchy, see {@link net.zscript.javaclient.nodes.ZscriptNode#send(CommandExecutionPath, Consumer)}.
* by a client runtime representing a device node hierarchy, see {@link net.zscript.javaclient.devicenodes.ZscriptNode#send(CommandExecutionPath, Consumer)}.
* <p>
* On execution, the corresponding response object is a {@link ResponseExecutionPath}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* by a CommandExecutionPath (see {@link CommandExecutionPath#compareResponses(ResponseExecutionPath)}) to produce a complete comprehension of what happened during execution.
* <p>
* This class represents the result of execution of a {@link CommandExecutionPath} once the addressing and sequence-level fields have been processed, ie by a client runtime
* representing a device node hierarchy, see {@link net.zscript.javaclient.nodes.ZscriptNode#send(CommandExecutionPath, Consumer)}.
* representing a device node hierarchy, see {@link net.zscript.javaclient.devicenodes.ZscriptNode#send(CommandExecutionPath, Consumer)}.
*/
public class ResponseExecutionPath implements Iterable<ResponseElement>, ByteAppendable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import net.zscript.javaclient.connectors.serial.SerialConnector;
import net.zscript.javaclient.connectors.tcp.TcpConnector;
import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;

public class ZscriptConnectors {
public static final TcpConnector TCP = new TcpConnector();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;

public class TcpConnection extends DirectConnection {
private static final Logger LOG = LoggerFactory.getLogger(TcpConnection.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.util.HashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.util.function.Consumer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.util.ArrayDeque;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.io.Closeable;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.util.BitSet;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import net.zscript.javaclient.addressing.AddressedCommand;
import net.zscript.javaclient.commandpaths.CommandExecutionPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.util.ArrayDeque;
import java.util.Queue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.util.Collection;
import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import java.lang.reflect.Proxy;
import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@ParametersAreNonnullByDefault
package net.zscript.javaclient.nodes;
package net.zscript.javaclient.devicenodes;

import javax.annotation.ParametersAreNonnullByDefault;
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.zscript.javaclient.commandpaths.CommandExecutionPath;
import net.zscript.javaclient.commandpaths.ResponseExecutionPath;
import net.zscript.javaclient.commandpaths.ZscriptFieldSet;
import net.zscript.javaclient.nodes.ZscriptNode;
import net.zscript.javaclient.devicenodes.ZscriptNode;
import net.zscript.javaclient.sequence.CommandSequence;
import net.zscript.javaclient.sequence.ResponseSequence;
import net.zscript.javaclient.tokens.ExtendingTokenBuffer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;
import net.zscript.model.components.Zchars;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.zscript.javaclient.commandpaths.CommandExecutionPath;
import net.zscript.javaclient.connectors.ZscriptConnectors;
import net.zscript.javaclient.connectors.serial.SerialConnector;
import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;
import net.zscript.javaclient.sequence.CommandSequence;
import net.zscript.javaclient.tokens.ExtendingTokenBuffer;
import net.zscript.model.modules.base.CoreModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.zscript.javaclient.commandpaths.CommandExecutionPath;
import net.zscript.javaclient.connectors.ZscriptConnectors;
import net.zscript.javaclient.connectors.ZscriptConnectors.ZscriptConnector;
import net.zscript.javaclient.nodes.DirectConnection;
import net.zscript.javaclient.devicenodes.DirectConnection;
import net.zscript.javaclient.sequence.CommandSequence;
import net.zscript.javaclient.tokens.ExtendingTokenBuffer;
import net.zscript.model.modules.base.CoreModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import net.zscript.javaclient.commandbuilderapi.nodes.CommandSequenceNode;
import net.zscript.javaclient.commandbuilderapi.nodes.ResponseCaptor;
import net.zscript.javaclient.connectors.serial.SerialConnection;
import net.zscript.javaclient.devicenodes.ZscriptNode;
import net.zscript.javaclient.devices.ResponseSequenceCallback;
import net.zscript.javaclient.devices.ZscriptDevice;
import net.zscript.javaclient.nodes.ZscriptNode;
import net.zscript.model.ZscriptModel;
import net.zscript.model.modules.base.CoreModule;
import net.zscript.model.modules.base.PinsModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import static net.zscript.model.modules.base.PinsModule.DigitalNotificationSectionContent.Value;

import net.zscript.javaclient.commandbuilderapi.nodes.ResponseCaptor;
import net.zscript.javaclient.devices.ZscriptDevice;
import net.zscript.model.modules.base.OuterCoreModule;
import net.zscript.model.modules.base.PinsModule;
Expand Down Expand Up @@ -41,14 +40,14 @@ public void startReceiving() {
lastTimeNano = System.nanoTime();

// // Older notification registration system, using Captors.
ResponseCaptor<PinsModule.DigitalNotificationSectionContent> captor = ResponseCaptor.create();
device.getNotificationHandle(PinsModule.DigitalNotification.ID)
.getSection(PinsModule.DigitalNotificationSectionContent.class)
.setCaptor(captor);
device.setNotificationListener_Prev(PinsModule.DigitalNotification.ID, notificationSequenceCallback -> {
PinsModule.DigitalNotificationSectionContent content = notificationSequenceCallback.getResponseFor(captor).get();

});
// ResponseCaptor<PinsModule.DigitalNotificationSectionContent> captor = ResponseCaptor.create();
// device.getNotificationHandle(PinsModule.DigitalNotification.ID)
// .getSection(PinsModule.DigitalNotificationSectionContent.class)
// .setCaptor(captor);
// device.setNotificationListener_Prev(PinsModule.DigitalNotification.ID, notificationSequenceCallback -> {
// PinsModule.DigitalNotificationSectionContent content = notificationSequenceCallback.getResponseFor(captor).get();
//
// });

device.setNotificationListener(PinsModule.DigitalNotification.ID, n -> {
PinsModule.DigitalNotificationSectionContent content = n.getDigitalSection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import com.fazecast.jSerialComm.SerialPort;

import net.zscript.javaclient.connectors.serial.SerialConnection;
import net.zscript.javaclient.devicenodes.ZscriptNode;
import net.zscript.javaclient.devices.ZscriptDevice;
import net.zscript.javaclient.nodes.ZscriptNode;
import net.zscript.model.ZscriptModel;
import net.zscript.model.modules.base.CoreModule;

Expand Down

0 comments on commit 7032822

Please sign in to comment.