fischmat / mysticlight4j Goto Github PK
View Code? Open in Web Editor NEWJava Library for controlling MSI Mystic Light compatible LEDs
License: MIT License
Java Library for controlling MSI Mystic Light compatible LEDs
License: MIT License
Hey,
i wasnt quite able to make this project runable.
Neither implementation example of your readme seem to work for me.
Here's my Class:
package com.nearix.test;
import java.util.Collection;
import java.util.List;
import de.matthiasfisch.mysticlight4j.Device;
import de.matthiasfisch.mysticlight4j.LED;
import de.matthiasfisch.mysticlight4j.MysticLight4j;
import de.matthiasfisch.mysticlight4j.api.DeviceInfo;
import de.matthiasfisch.mysticlight4j.api.LedInfo;
import de.matthiasfisch.mysticlight4j.api.MysticLightAPI;
public class Main {
public static void main(String[] args) {
MysticLight4j mysticLight = new MysticLight4j();
Collection devices = mysticLight.getAllAvailableDevices();
for (Device device : devices) {
String id = device.getIdentifier(); // Unique ID of the device
String name = device.getName(); // Display name of the device
System.out.println(name);
List leds = device.getLEDs(); // The LED groups on the device
}
// Console:
// C:\Users\NeariX\OneDrive - OSZ IMT\Coding\Eclipse\WorkSpace\MSI Mystic Light Java
// Exception in thread "main" java.lang.NoSuchMethodError:
// at de.matthiasfisch.mysticlight4j.api.MysticLightNativeBinding.getLedInfo(Native Method)
// at de.matthiasfisch.mysticlight4j.api.MysticLightAPI.getLedInfo(MysticLightAPI.java:151)
// at de.matthiasfisch.mysticlight4j.LED.(LED.java:33)
// at de.matthiasfisch.mysticlight4j.Device.lambda$0(Device.java:29)
// at java.util.stream.IntPipeline$4$1.accept(IntPipeline.java:250)
// at java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:110)
// at java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:693)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
// at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
// at de.matthiasfisch.mysticlight4j.Device.(Device.java:30)
// at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
// at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
// at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
// at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
// at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
// at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
// at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
// at de.matthiasfisch.mysticlight4j.MysticLight4j.getAllAvailableDevices(MysticLight4j.java:64)
// at com.nearix.test.Main.main(Main.java:13)
MysticLightAPI.initialize();
DeviceInfo[] devices = MysticLightAPI.getDeviceInfo();
for (DeviceInfo device : devices) {
// Prints the unique identifier of the device
System.out.println(device.getDeviceType());
System.out.println("LED groups for this device:");
for (int i = 0; i < device.getLedCount(); i++) {
LedInfo led = MysticLightAPI.getLedInfo(device.getDeviceType(), i);
System.out.println(led.getName());
}
}
// Console:
// MSI_MB
// LED groups for this device:
// Exception in thread "main" java.lang.NoSuchMethodError:
// at de.matthiasfisch.mysticlight4j.api.MysticLightNativeBinding.getLedInfo(Native Method)
// at de.matthiasfisch.mysticlight4j.api.MysticLightAPI.getLedInfo(MysticLightAPI.java:151)
// at com.nearix.test.Main.main(Main.java:25)
}
}
It doesn't seem to find the getLedInfo Method.
I was giving this project my first try and tried to use your example given in your readme to fetch my devices, but with both the object oriented and low-level api the error:
Exception in thread "main" de.matthiasfisch.mysticlight4j.api.MysticLightAPIException: MSI Application not found or installed version not supported.
at de.matthiasfisch.mysticlight4j.api.MysticLightNativeBinding.initialize(Native Method)
at de.matthiasfisch.mysticlight4j.api.MysticLightAPI.initialize(MysticLightAPI.java:80)
at de.matthiasfisch.mysticlight4j.api.MysticLightAPI.initialize(MysticLightAPI.java:60)
at de.matthiasfisch.mysticlight4j.MysticLight4j.(MysticLight4j.java:54)
at de.matthiasfisch.mysticlight4j.MysticLight4j.(MysticLight4j.java:32)
occured while initializing the msi api. my mystic light sdk is present so i assume it may have something to do with the version? i would appreciate your help and if you need any logs or something i can of course send them to you.
thank you in advance.
Getting the below error after setting up the environment running the below code:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000000000000, pid=4244, tid=23540
#
# JRE version: Java(TM) SE Runtime Environment (16.0.1+9) (build 16.0.1+9-24)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0.1+9-24, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
# Problematic frame:
# C 0x0000000000000000
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\...\MysticLightTest\hs_err_pid4244.log
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
import de.matthiasfisch.mysticlight4j.api.MysticLightAPI;
import java.nio.file.Path;
public class driver {
public static void main(String[] args){
MysticLightAPI.initialize(Path.of("MysticLightSDK"));
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.