Skip to content

Introduction⚓︎

Welcome, and thank you for your interest in the JmpLib or JMP protocol Library. The goal of this documentation is not to teach you on to use a library or how to encorperate libraries in your project but rather just how to use the JMP Library.

What is JMP⚓︎

JMP stands for the JANOS Management Protocol. JMP is a JSON based protocol. The JSON messages are the same messages used by the WebUI. The difference lies in the fact that the WebUI used Websockets as the web protocol for transmission accross the web.

What is JmpLib⚓︎

JmpLib is a library to make interfacing with the JNIOR easier from your application. We have implemented the JMP protocol so that you don't have to. This lets you focus on how to utilize the JNIOR in your business logic.

The JmpLib library is distributed as an shared library. A shared library means that the code is referenced at runtime. This allows multiple applications to use the same code. This also means that you can update the library without needing to recompile your code.

This library is available on multiple platforms including Windows, Linux, and Mac. Linux and Mac platforms will use a .so file while Windows platforms will use a .dll file.

We also have 4 flavors of libraries for you to use:

  • C++ - The C++ is the raw version that can be used in any langurage that load an external library.
  • .NET - The framework from Microsoft has a wrapper to bring object oriented architecture to the library.
  • Java - The java version of the library was compiled with additional JNI code to make it easier to implement in Java. A JAR file is also available to make the library object oriented. There is an additional JAR file that was created that you will need to associate with your project.
  • Python - The Python version of the library was compiled with additional pybind11 code to produce .pyd and .pyi files. These files represent a python package.

How to use the JMP Library⚓︎

This library is intended for PC applications. There are many flavors of this library in hopes of being availble in the language of your choice.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "jmplib.h"

...

// define a connection that will be successful
constexpr ipg::connection_properties connection_props = {
    .ip_address = const_cast<char *>("10.0.0.63"), .port = 9220
};

// instantiate a connection
ipg::create_connection(&connection_props, uuid);

// wait for the connection result.  we will expect this to be successful
const int connection_result = ipg::wait_for_connection(uuid);
auto status_description = new char[32];
ipg::get_connection_status_description(uuid, status_description);
std::cout << std::format("connection_result: ({}) {}",
                            connection_result, status_description) << std::endl;

// clean up
delete[] status_description;

if (ipg::CONNECTED != connection_result) {
    throw new std::runtime_error("Connection result was not SUCCESSFUL");
}

// get the connection state
int connection_status = ipg::get_connection_status(uuid);
if (ipg::CONNECTED == connection_status) success();
else failed();

// make sure to disconnect
ipg::disconnect(uuid);

...
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
using com.integ.jmplib;

...

// define the connection properties and initialize the JmpConnection
var connectionProperties = new ConnectionProperties("10.0.0.96")
    .SetPort(9220).SetCredentials("jnior", "jnior");
var _jmpConnection = new JmpConnection(connectionProperties);

// make a connection and wait for the connection and the authentication to finish
_jmpConnection.WaitForConnection();
_jmpConnection.WaitForAuthentication();

// disconnect when done with the connection
_jmpConnection.Disconnect();

...
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import com.integ.jmplib;

...
// get an instance of the ConnectionProperties for a connection to a jnior
ConnectionProperties cp = new ConnectionProperties("10.0.0.96")
    .setPort(9220).setCredentials("jnior", "jnior");

// make a connection and wait for the connection and the authentication to finish
JmpConnection jmpConnection = new JmpConnection(cp);

jmpConnection.waitForConnection();
jmpConnection.waitForAuthentication();

// disconnect when done with the connection
jmpConnection.disconnect();

...

Python is probably the easiest option to use. You only need to put the .pyd and .pyi files in the root of your project and then add the import jmplib line to get access to all of the goodies the JMP Lib has to offer.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
import jmplib

...

# get an instance of the ConnectionProperties for a connection to a jnior
connection_properties = jmplib_py.ConnectionProperties("10.0.0.96")
   .set_port(9220).set_credentials("jnior", "jnior")

# make a connection and wait for the connection and the authentication to finish
jmp_connection = jmplib_py.JmpConnection(connection_properties)

jmp_connection.wait_for_connection()
jmp_connection.wait_for_authentication()

# disconnect when done with the connection
jmp_connection.disconnect()
...
dsgf