vn7n24fzkq / CPower-Controller

A lib for CPower LED display

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CPower Controller

License: MIT release

Because there are many problems by using CP5200.dll for me, so I write this lib to control CPower LED display by implement the protocol.

However, it is found that the TCP/IP instant messaging protocol is different from the document, and when you implement other parts of the protocol, you should be noted that there may be the same problem.

Only implement instant message function.

因為 CP5200.dll 使用上有許多問題所以寫了這個 lib 來發送 instant message

但發現 TCP/IP instant message protocol 與文件上不一樣, 實作其他部分應注意可能有一樣的問題

只有實作 instant message 的功能 其他功能並未實作

Quickstart

Add dependency

Maven

<dependency>
	<groupId>io.github.vn7n24fzkq.cpower-controller</groupId>
	<artifactId>cpower-controller</artifactId>
	<version>1.3.3</version>
	<type>pom</type>
</dependency>

Gradle

implementation 'io.github.vn7n24fzkq.cpower-controller:cpower-controller:1.3.3'

Ivy

<dependency org="io.github.vn7n24fzkq.cpower-controller" name="cpower-controller" rev="1.3.3">
	<artifact name="cpower-controller" ext="pom"></artifact>
</dependency>

Example

// create a controller object
CPowerController cPowerController = new CPowerController();
cPowerController.connect("192.168.1.222", 5200, "255.255.255.255");

// create instant message
InstantMessage instantMessage = new InstantMessage();
instantMessage.setText("Hello world");
instantMessage.setColor(true,false,false);
instantMessage.setEffect(InstantMessageEffect.Draw);
instantMessage.setFontSize((byte)0x02);
instantMessage.setHeight((short)32);
instantMessage.setWidth((short)32);
instantMessage.setLoopTime((short) 3);
instantMessage.setAlignment(InstantMessageAlignment.Center);
// send data to CPower
cPowerController.send(instantMessage);

// disconnect
cPowerController.disconnect();

About

A lib for CPower LED display

License:MIT License


Languages

Language:Java 100.0%