
Layers
Extend the Functionality of Transport SessionsIO Ninja offers two types of plugins: sessions and layers. The main idea is to distinguish between heavy and lightweight plugins.
Developing a full-fledged session plugin can be quite involved. At a minimum, it requires creating transport IO objects, designing a transport-specific user interface, defining the format and structure of transport-specific log records, and handling both IO and UI events. Sounds daunting, doesn't it?
But what if you just need a simple test application—something that waits for incoming commands over a TCP connection and responds accordingly? We already have a TCP connection plugin, so do we really need to re-implement the entire thing? And what if your test application also needs to run over Serial, not just TCP? Wouldn't it be great if you could simply build on top of the existing connection and add the functionality you need?
That’s where IO Ninja layers come in.
So What Is a Layer?
A layer is a module that attaches on top of an existing session. The session provides the core transport functionality, while the layer extends it. A layer can:
- Add custom UI for layer-specific operations (e.g., XModem send and receive);
- Listen to log records and take action based on them;
- Transmit data by passing it to the underlying session;
- Filter logs by hiding unwanted records using custom logic;
- Transform logs to create a secondary log with decoded messages, enabling the analysis of application-level protocols (e.g., Modbus);
With layers, you can create protocol analyzers, protocol emulators, filters, highlighters, testing tools, and other utilities—all of which work independently of the underlying transport.