Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: update printing architecture #139

Merged
merged 31 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a183577
feat(changed): updated printing architecture
tr3v3r Mar 11, 2024
4f32215
feat(add): add print helpers and pairing printer method
tr3v3r Mar 12, 2024
a9fef44
tryToConnectUtil
tr3v3r Mar 13, 2024
cc0f2fd
fix lint
tr3v3r Mar 14, 2024
64e7f04
chore: release 4.0.0-beta.0
tr3v3r Mar 14, 2024
05b993f
feat(changed): add addTextLang method, get rid of legacy code
tr3v3r Mar 15, 2024
065f6a2
add clearCommandBuffer method
Waleed065 Mar 17, 2024
1149aca
fix lint
tr3v3r Mar 17, 2024
ef430d6
chore: release 4.0.0-beta.1
tr3v3r Mar 17, 2024
f0bb84f
move pairBluetoothDevice to Discovery module, move printer helpers to…
tr3v3r Mar 21, 2024
f81ae8f
refactor: remover redundant code, regroup folders, move native consta…
tr3v3r Mar 21, 2024
021cb51
chore: release 4.0.0-beta.2
tr3v3r Mar 28, 2024
7c2047a
Add possibility to inject your own queue engine, exporto all enums an…
tr3v3r Apr 5, 2024
08f2041
chore: release 4.0.0-beta.3
tr3v3r Apr 5, 2024
ec510ef
fix(fixed): fix Android blocking thread, increase timeout for discove…
tr3v3r Apr 26, 2024
9c9e99a
chore: release 4.0.0-beta.4
tr3v3r Apr 26, 2024
482c192
chore: release 4.0.0-beta.5
tr3v3r Apr 26, 2024
9da6f38
feat(added): docs for Printer constructor and connect method, allow t…
tr3v3r May 7, 2024
862821b
chore: release 4.0.0-beta.6
tr3v3r May 7, 2024
a59014d
docs(added): add docs for addText, disconnect, addFeedLine methods
tr3v3r May 11, 2024
1ede5fe
docs(added): add docs for sendData method
tr3v3r May 16, 2024
c01ddc6
doc(added): cover addCut, getPrinterSetting methods
tr3v3r May 21, 2024
952fc69
docs(added): cover getStatus method
tr3v3r May 22, 2024
5445f8c
docs(added): cover addImage method
tr3v3r May 23, 2024
3b78e2b
docs(added): cover addBarcode
tr3v3r May 29, 2024
550ee68
docs(added): cover addSymbol
tr3v3r Jul 17, 2024
18a445b
docs(added) cover addCommand, addPulse, addTextAlign
tr3v3r Jul 18, 2024
5575f1d
docs(added): cover addTextSize, addTextStyle, addTextLang, addTextSmooth
tr3v3r Jul 19, 2024
db0f6aa
docs(added): cover addTextLine static method
tr3v3r Jul 24, 2024
d42ec77
docs(added): finish docs
tr3v3r Jul 25, 2024
1e37295
resolve conflicts
tr3v3r Jul 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,070 changes: 379 additions & 691 deletions android/src/main/java/com/reactnativeescposprinter/EposStringHelper.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
import com.facebook.react.bridge.ReactMethod;
Expand Down Expand Up @@ -40,6 +39,9 @@
import com.google.android.gms.common.GoogleApiAvailability;
import com.google.android.gms.common.ConnectionResult;

import com.reactnativeescposprinter.EposStringHelper;



@ReactModule(name = EscPosPrinterDiscoveryModule.NAME)
public class EscPosPrinterDiscoveryModule extends ReactContextBaseJavaModule implements ActivityEventListener {
Expand All @@ -56,39 +58,10 @@ public EscPosPrinterDiscoveryModule(ReactApplicationContext reactContext) {
reactContext.addActivityEventListener(this);
}

@Override
public Map<String, Object> getConstants() {
final Map<String, Object> constants = new HashMap<>();
// filter options
constants.put("PORTTYPE_ALL", Discovery.PORTTYPE_ALL);
constants.put("PORTTYPE_TCP", Discovery.PORTTYPE_TCP);
constants.put("PORTTYPE_BLUETOOTH", Discovery.PORTTYPE_BLUETOOTH);
constants.put("PORTTYPE_USB", Discovery.PORTTYPE_USB);
constants.put("MODEL_ALL", Discovery.MODEL_ALL);
constants.put("TYPE_ALL", Discovery.TYPE_ALL);
constants.put("TYPE_PRINTER", Discovery.TYPE_PRINTER);
constants.put("TYPE_HYBRID_PRINTER", Discovery.TYPE_HYBRID_PRINTER);
constants.put("TYPE_DISPLAY", Discovery.TYPE_DISPLAY);
constants.put("TYPE_KEYBOARD", Discovery.TYPE_KEYBOARD);
constants.put("TYPE_SCANNER", Discovery.TYPE_SCANNER);
constants.put("TYPE_SERIAL", Discovery.TYPE_SERIAL);
constants.put("TYPE_POS_KEYBOARD", Discovery.TYPE_POS_KEYBOARD);
constants.put("TYPE_MSR", Discovery.TYPE_MSR);
constants.put("TYPE_GFE", Discovery.TYPE_GFE);
constants.put("TYPE_OTHER_PERIPHERAL", Discovery.TYPE_OTHER_PERIPHERAL);
constants.put("FILTER_NAME", Discovery.FILTER_NAME);
constants.put("FILTER_NONE", Discovery.FILTER_NONE);
constants.put("TRUE", Discovery.TRUE);
constants.put("FALSE", Discovery.FALSE);
// return values
constants.put("ERR_PARAM", Epos2Exception.ERR_PARAM);
constants.put("ERR_ILLEGAL", Epos2Exception.ERR_ILLEGAL);
constants.put("ERR_MEMORY", Epos2Exception.ERR_MEMORY);
constants.put("ERR_FAILURE", Epos2Exception.ERR_FAILURE);
constants.put("ERR_PROCESSING", Epos2Exception.ERR_PROCESSING);

return constants;
}
@Override
public Map<String, Object> getConstants() {
return EposStringHelper.getDiscoveryConstants();
}

@Override
@NonNull
Expand Down
Loading
Loading