9 changed files with 93 additions and 61 deletions
-
2src/main/java/a8k/app/constant/AppVersion.java
-
1src/main/java/a8k/app/controler/api/v1/app/setting/DeviceInfoControler.java
-
14src/main/java/a8k/app/i18n/Internationalization.java
-
29src/main/java/a8k/app/iflytophald/type/protocol/McuModuleVersion.java
-
8src/main/java/a8k/app/iflytophald/type/protocol/OptModuleRegIndex.java
-
6src/main/java/a8k/app/iflytophald/type/protocol/RegIndex.java
-
57src/main/java/a8k/app/service/appsetup/A8kSubModuleRegInitService.java
-
13src/main/java/a8k/app/type/BoardVersions.java
-
16src/test/java/a8k/app/iflytophald/type/protocol/McuModuleVersionTest.java
@ -1,5 +1,5 @@ |
|||||
package a8k.app.constant; |
package a8k.app.constant; |
||||
|
|
||||
public class AppVersion { |
public class AppVersion { |
||||
public static final String APP_VERSION = "A80.CN.01.00.07"; |
|
||||
|
public static final String APP_VERSION = "B80.CN.01.00.07"; |
||||
} |
} |
@ -0,0 +1,29 @@ |
|||||
|
package a8k.app.iflytophald.type.protocol; |
||||
|
|
||||
|
public class McuModuleVersion { |
||||
|
public Integer main; |
||||
|
public Integer sub; |
||||
|
public Integer fix; |
||||
|
|
||||
|
public McuModuleVersion(int versionRaw) { |
||||
|
this.main = (versionRaw >> 16) & 0xFF; |
||||
|
this.sub = (versionRaw >> 8) & 0xFF; |
||||
|
this.fix = versionRaw & 0xFF; |
||||
|
} |
||||
|
|
||||
|
public McuModuleVersion(Integer main, Integer sub, Integer fix) { |
||||
|
this.main = main; |
||||
|
this.sub = sub; |
||||
|
this.fix = fix; |
||||
|
} |
||||
|
|
||||
|
public Integer getVersionRaw() { |
||||
|
return (main << 16) | (sub << 8) | fix; |
||||
|
} |
||||
|
|
||||
|
public String toString() { |
||||
|
// 软件种类 项目代码 国家代码 主要变更 部分变更 暂时性变更 |
||||
|
//F80.CN.01.00.02 |
||||
|
return String.format("M80.CN.%02d.%02d.%02d", main, sub, fix); |
||||
|
} |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
package a8k.app.iflytophald.type.protocol; |
||||
|
|
||||
|
import org.junit.jupiter.api.Test; |
||||
|
|
||||
|
import static org.junit.jupiter.api.Assertions.*; |
||||
|
|
||||
|
class McuModuleVersionTest { |
||||
|
|
||||
|
@Test |
||||
|
void testConstruct() { |
||||
|
McuModuleVersion version = new McuModuleVersion(0x010203); |
||||
|
assertEquals(1, version.main); |
||||
|
assertEquals(2, version.sub); |
||||
|
assertEquals(3, version.fix); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue