-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for variable RS485/UART serial frame lengths
- Loading branch information
1 parent
e4d50dc
commit 9c43eba
Showing
28 changed files
with
849 additions
and
372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/target/ | ||
/.settings/ | ||
/.classpath | ||
/.project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.ai-republic.bms-to-inverter</groupId> | ||
<artifactId>bms-to-inverter-parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>bms-jk-rs485</artifactId> | ||
|
||
<name>${project.artifactId}-${project.version}</name> | ||
<description>Module for the JK BMS RS485 support</description> | ||
|
||
<properties> | ||
<encoding>UTF-8</encoding> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.ai-republic.bms-to-inverter</groupId> | ||
<artifactId>protocol-rs485</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
33 changes: 33 additions & 0 deletions
33
...k-rs485/src/main/java/com/airepublic/bmstoinverter/bms/jk/rs485/JKBmsRS485Descriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.airepublic.bmstoinverter.bms.jk.rs485; | ||
|
||
import com.airepublic.bmstoinverter.core.BMS; | ||
import com.airepublic.bmstoinverter.core.BMSConfig; | ||
import com.airepublic.bmstoinverter.core.BMSDescriptor; | ||
import com.airepublic.bmstoinverter.core.Port; | ||
import com.airepublic.bmstoinverter.protocol.rs485.FrameDefinition; | ||
import com.airepublic.bmstoinverter.protocol.rs485.JSerialCommPort; | ||
import com.fazecast.jSerialComm.SerialPort; | ||
|
||
/** | ||
* The {@link BMSDescriptor} for the Daly BMS using the CAN protocol. | ||
*/ | ||
public class JKBmsRS485Descriptor implements BMSDescriptor { | ||
@Override | ||
public String getName() { | ||
return "JK_CAN"; | ||
} | ||
|
||
|
||
@Override | ||
public Class<? extends BMS> getBMSClass() { | ||
return JKBmsRS485Processor.class; | ||
} | ||
|
||
|
||
@Override | ||
public Port createPort(final BMSConfig config) { | ||
final Port port = new JSerialCommPort(config.getPortLocator(), 115000, 8, 1, SerialPort.NO_PARITY, new byte[] { 78 }, FrameDefinition.create("")); | ||
return port; | ||
} | ||
|
||
} |
Oops, something went wrong.