Skip to content

Commit 67bc26c

Browse files
V0.2.0
1 parent 30e3566 commit 67bc26c

File tree

10 files changed

+97
-105
lines changed

10 files changed

+97
-105
lines changed

README.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,43 @@
11
# SteadyLAN Setting SDK Android Java
22

3-
This SDK using StarIO library is for changing SteadyLAN setting ( iOS environment only ).
3+
This SDK using StarIO library is for changing SteadyLAN setting.
44

55
## What is SteadyLAN
66
- [SteadyLAN (English)](https://www.star-m.jp/products/s_print/mcprint3/manual/en/settings/SteadyLAN.htm)
77
- [SteadyLAN (Japanese)](https://www.star-m.jp/products/s_print/mcprint3/manual/ja/settings/SteadyLAN.htm)
88

9-
## Scope
9+
## Supported models
10+
- mC-Print2 (Printer firmware version 2.3 or later) without MCP20 and MCP20B
11+
- mC-Print3 (Printer firmware version 2.3 or later) without MCP30
1012

11-
Supported models :
12-
- mC-Print2 (Printer firmware version 2.3 or later)
13-
- mC-Print3 (Printer firmware version 2.3 or later)
13+
## Requirements
14+
- SteadyLAN for iOS: iOS 10.1.1 or later
15+
- SteadyLAN for Android: Android 5.0 or later
16+
- SteadyLAN for Windows: <u>Windows 10 or later</u>
1417

15-
Online Manual :
16-
- [mC-Print2 Online Manual](http://www.star-m.jp/mcprint2-oml.html)
17-
- [mC-Print3 Online Manual](http://www.star-m.jp/mcprint3-oml.html)
18+
## Reference
19+
### Online Manual
20+
- [mC-Print2 Online Manual](http://www.star-m.jp/mcprint2-oml.html)
21+
- [mC-Print3 Online Manual](http://www.star-m.jp/mcprint3-oml.html)
22+
23+
### StarPRNT Command Specifications
24+
- [StarPRNT Command Specifications (English)](https://www.starmicronics.com/support/Mannualfolder/StarPRNT_cm_en.pdf)
25+
- [StarPRNT Command Specifications (Japanese)](http://sp-support.star-m.jp/Mannualfolder/starprnt_cm_jp.pdf)
26+
27+
## Note
28+
- SteadyLAN function must be configured to match the operating system (OS) of the device. It cannot be used with an OS different from the printer's settings.
29+
- A printer where the SteadyLAN function is set to “Enable for Windows” cannot perform USB communication with Android devices. In this case, either connect a device with a different OS, or else connect to the printer from a different interface, then either set the printer SteadyLAN function to “Disable” or “Enable for Android”. Or, initialize the communication settings, but when doing it, be aware that other settings will also be returned to the default settings from the time when the product was purchased.
30+
- SteadyLAN function is not available from the UWP application even if you set it to SteadyLAN for Windows because UWP application cannot communicate with the Star Printer via USB I/F.
31+
This function is available for [Windows Desktop applications](https://github.com/star-micronics/SteadyLAN-Setting-SDK-WindowsDesktop-Labs) when you set to SteadyLAN for Windows.
32+
- Parameters for specifying SteadyLAN settings may or may not be supported depending on the printer model.
33+
The support relationship is as shown in the table below. If not supported, the command is ignored.
34+
35+
| Parameter(n)<br>HEX | SteadyLAN | Model<br>MCP31L/MCP31LB | <br>MCP31C/MCP31CB | <br>MCP30 | <br>MCP21L | <br>MCP20/MCP20B |
36+
| ---- | ---- | ---- | ---- | ---- | ---- | ---- |
37+
| 0x00 | Invalid | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: red;">✘</div> |
38+
| 0x01 | Valid (for iOS) | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: red;">✘</div> |
39+
| 0x02 | Valid (for Android) | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: red;">✘</div> |
40+
| 0x03 | Valid (for Windows) | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: lightgreen;">✔</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: red;">✘</div> | <div style="text-align: center; color: red;">✘</div> |
1841

1942
## Copyright
2043

SDK/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.StarMicronics.labs.StarSteadyLANSetting"
88
minSdkVersion 21
99
targetSdkVersion 29
10-
versionCode 1
11-
versionName "0.1.0"
10+
versionCode 2
11+
versionName "0.2.0"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
buildTypes {
@@ -21,9 +21,9 @@ android {
2121

2222
dependencies {
2323
implementation 'com.starmicronics:stario:2.8.0'
24-
implementation 'androidx.appcompat:appcompat:1.0.2'
25-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
24+
implementation 'androidx.appcompat:appcompat:1.2.0'
25+
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
2626
testImplementation 'junit:junit:4.12'
27-
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
28-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
27+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
28+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
2929
}

SDK/app/src/main/java/com/starmicronics/labs/StarSteadyLANSetting/Communication.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ public void run() {
201201
boolean receiveResponse = false;
202202

203203
//Check the steadyLAN setting value
204-
// When the remote config setting is SteadyLAN(DISABLE), the following format is transmitted.
205-
// 0x1b 0x1d 0x29 0x4e 0x02 0x00 0x49 0x01 0x00 0x0a 0x00
206-
// When the remote config setting is SteadyLAN(for iOS), the following format is transmitted.
207-
// 0x1b 0x1d 0x29 0x4e 0x02 0x00 0x49 0x01 0x01 0x0a 0x00
204+
//The following format is transmitted.
205+
// 0x1b 0x1d 0x29 0x4e 0x02 0x00 0x49 0x01 [n] 0x0a 0x00
206+
//The value of [n] indicates the SteadyLAN setting.
207+
// 0x00: Invalid, 0x01: Valid(For iOS), 0x02: Valid(For Android), 0x03: Valid(For Windows)
208208
if (receiveData.length >= 11){
209209
for (int i = 0; i < receiveData.length; i++){
210210
if (receiveData[i + 0] == 0x1b &&
@@ -219,11 +219,20 @@ public void run() {
219219
receiveData[i + 9] == 0x0a &&
220220
receiveData[i + 10] == 0x00) {
221221

222-
if (receiveData[i + 8] == 0x01){
223-
message = "SteadyLAN(for iOS).";
224-
}
225-
else{ //receiveData[i + 8] == 0x00
226-
message = "SteadyLAN(Disable).";
222+
switch (receiveData[i + 8]) {
223+
// case 0x00:
224+
default:
225+
message = "SteadyLAN(Disable).";
226+
break;
227+
case 0x01:
228+
message = "SteadyLAN(for iOS).";
229+
break;
230+
case 0x02:
231+
message = "SteadyLAN(for Android).";
232+
break;
233+
case 0x03:
234+
message = "SteadyLAN(for Windows).";
235+
break;
227236
}
228237

229238
receiveResponse = true;

SDK/app/src/main/java/com/starmicronics/labs/StarSteadyLANSetting/MainActivity.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,18 @@ public void onClick(View view){
7171
Spinner spinner = findViewById(R.id.steadyLANSetting_spinner);
7272
if (spinner.getSelectedItemPosition() == 1 )
7373
{
74-
commands = new byte[]{ 0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x39, 0x01, 0x01, //set to SteadyLAN(for iOS).
74+
commands = new byte[]{ 0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x39, 0x01, 0x02, //set to SteadyLAN(for Android).
7575
0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x70, 0x01, 0x00}; //apply setting. Note: The printer is reset to apply setting when writing this command is completed.
76+
77+
//The settings for other OSs are as follows. But it will not work on Android devices.
78+
// For iOS
79+
// commands = new byte[]{ 0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x39, 0x01, 0x01, //set to SteadyLAN(for iOS).
80+
// 0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x70, 0x01, 0x00}; //apply setting. Note: The printer is reset to apply setting when writing this command is completed.
81+
82+
// For Windows
83+
// commands = new byte[]{ 0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x39, 0x01, 0x03, //set to SteadyLAN(for Windows).
84+
// 0x1b, 0x1d, 0x29, 0x4e, 0x03, 0x00, 0x70, 0x01, 0x00}; //apply setting. Note: The printer is reset to apply setting when writing this command is completed.
85+
7686
}
7787
else
7888
{

SDK/app/src/main/res/values/arrays.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<resources>
33
<string-array name="spinner_values">
44
<item>Disable</item>
5-
<item>Enable(for iOS)</item>
5+
<item>Enable</item>
66
</string-array>
77
</resources>

SDK/app/src/main/res/values/strings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<resources>
2-
<string name="app_name">Star SteadyLAN Setting Labs V0.1.0</string>
2+
<string name="app_name">Star SteadyLAN Setting Labs V0.2.0</string>
33
<string name="list_star_printer">List - Star Printer</string>
44
<string name="search">Search</string>
55
<string name="settings">Settings</string>

SDK/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77

88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.5.3'
10+
classpath 'com.android.tools.build:gradle:4.0.1'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Mar 11 08:31:13 JST 2020
2-
distributionBase=GRADLE_USER_HOME
3-
distributionPath=wrapper/dists
4-
zipStoreBase=GRADLE_USER_HOME
5-
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
1+
#Fri Sep 11 16:57:40 JST 2020
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

SDK/local.properties

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## This file must *NOT* be checked into Version Control Systems,
2+
# as it contains information specific to your local configuration.
3+
#
4+
# Location of the SDK. This is only used by Gradle.
5+
# For customization when using a Version Control System, please read the
6+
# header note.
7+
#Fri Sep 11 16:50:58 JST 2020
8+
sdk.dir=/Users/techsupport/Library/Android/sdk

0 commit comments

Comments
 (0)