Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kenta-shimizu/secs4java8

This library is SEMI-SECS-communicate implementation on Java8.
https://github.com/kenta-shimizu/secs4java8

gem hsms hsms-gs hsms-ss java java8 secs secs-i secs-ii semi sml

Last synced: about 11 hours ago
JSON representation

This library is SEMI-SECS-communicate implementation on Java8.

Awesome Lists containing this project

README

        

# secs4java8 HSMS-GS

## Create HSMS-GS-Communicator instance and open

- For use HSMS-GS-Passive example

```java
/* HSMS-GS-Passive open example */
HsmsGsCommunicatorConfig config = new HsmsGsCommunicatorConfig();
config.addSessionId(100);
config.addSessionId(200);
config.addSessionId(300);
config.socketAddress(new InetSocketAddress("127.0.0.1", 5000));
config.isEquip(true);
config.connectionMode(HsmsConnectionMode.PASSIVE);
config.rebindIfPassive(5.0F);
config.notTrySelectRequest();
config.timeout().t3(45.0F);
config.timeout().t6( 5.0F);
config.timeout().t8( 5.0F);
config.gem().mdln("MDLN-A");
config.gem().softrev("000001");
config.gem().clockType(ClockType.A16);

HsmsGsCommunicator passive = HsmsGsCommunicator.newInstance(config);
passive.open();
```

- For use HSMS-GS-Active example

```java
/* HSMS-GS-Active open example */
HsmsGsCommunicatorConfig config = new HsmsGsCommunicatorConfig();
config.addSessionId(100);
config.addSessionId(200);
config.addSessionId(300);
config.socketAddress(new InetSocketAddress("127.0.0.1", 5000));
config.isEquip(false);
config.connectionMode(HsmsConnectionMode.ACTIVE);
config.retrySelectRequestTimeout(5.0F);
config.timeout().t3(45.0F);
config.timeout().t5(10.0F);
config.timeout().t6( 5.0F);
config.timeout().t8( 5.0F);
config.linktest(180.0F);
config.gem().clockType(ClockType.A16);

HsmsGsCommunicator active = HsmsGsCommunicator.newInstance(config);
active.open();
```

Notice: `HsmsGsCommunicator` is **NOT** instance of `SecsCommunicator`.

## Get Session instance from HsmsGsCommunicator

`HsmsSession` is instance of `SecsCommunicator`. `SecsCommunicator` methods are available.

```java
/* from Session-ID */
HsmsSession session100 = passive.getHsmsSession(100);

/* Session Set */
Set sessions = passive.getHsmsSessions();
```

See also ["/src/examples/example6"](/src/examples/example6)