-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
16 changed files
with
230 additions
and
48 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
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
11 changes: 11 additions & 0 deletions
11
enioka_scan/src/main/java/com/enioka/scanner/sdk/athesi/RD50TE/AthesiE5LIntents.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,11 @@ | ||
package com.enioka.scanner.sdk.athesi.RD50TE; | ||
|
||
/** | ||
* Intent actions, extras and related constants for the Athesi E5L integrated scanner, observed through android error logs. | ||
*/ | ||
public class AthesiE5LIntents { | ||
public static final String BARCODE_EVENT = "com.android.serial.BARCODEPORT_RECEIVEDDATA_ACTION"; | ||
public static final String BARCODE_DATA_EXTRA = "DATA"; | ||
public static final String PRESS_TRIGGER = "com.android.action.keyevent.KEYCODE_KEYCODE_SCAN_L_DOWN"; | ||
public static final String RELEASE_TRIGGER = "com.android.action.keyevent.KEYCODE_KEYCODE_SCAN_L_UP"; | ||
} |
30 changes: 30 additions & 0 deletions
30
enioka_scan/src/main/java/com/enioka/scanner/sdk/athesi/RD50TE/AthesiE5LProvider.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,30 @@ | ||
package com.enioka.scanner.sdk.athesi.RD50TE; | ||
|
||
import android.content.Context; | ||
|
||
import com.enioka.scanner.api.Scanner; | ||
import com.enioka.scanner.api.ScannerSearchOptions; | ||
import com.enioka.scanner.helpers.intent.IntentScannerProvider; | ||
|
||
/** | ||
* Provider for Athesi E5L scanners. | ||
* May use similar intents as other modern Athesi scanners but only the E5L is accepted as it is the only one that could be tested. | ||
*/ | ||
public class AthesiE5LProvider extends IntentScannerProvider { | ||
public static final String PROVIDER_KEY = "AthesiE5LProvider"; | ||
|
||
@Override | ||
protected void configureProvider() { | ||
specificDevices.add("RD50TE"); | ||
} | ||
|
||
@Override | ||
public String getKey() { | ||
return PROVIDER_KEY; | ||
} | ||
|
||
@Override | ||
protected Scanner createNewScanner(Context ctx, ScannerSearchOptions options) { | ||
return new AthesiE5LScanner(); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
enioka_scan/src/main/java/com/enioka/scanner/sdk/athesi/RD50TE/AthesiE5LScanner.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,68 @@ | ||
package com.enioka.scanner.sdk.athesi.RD50TE; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.support.annotation.Nullable; | ||
|
||
import com.enioka.scanner.api.Scanner; | ||
import com.enioka.scanner.api.proxies.ScannerCommandCallbackProxy; | ||
import com.enioka.scanner.data.Barcode; | ||
import com.enioka.scanner.data.BarcodeType; | ||
import com.enioka.scanner.helpers.intent.IntentScanner; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Scanner interface for modern Athesi scanners (i.e. E5L) | ||
*/ | ||
public class AthesiE5LScanner extends IntentScanner<String> implements Scanner.WithTriggerSupport { | ||
private static final String LOG_TAG = "AthesiE5LScanner"; | ||
|
||
@Override | ||
public void onReceive(Context context, Intent intent) { | ||
List<Barcode> barcodes = new ArrayList<>(); | ||
barcodes.add(new Barcode(intent.getStringExtra(AthesiE5LIntents.BARCODE_DATA_EXTRA), BarcodeType.UNKNOWN)); | ||
if (dataCb != null) { | ||
dataCb.onData(this, barcodes); | ||
} | ||
} | ||
|
||
@Override | ||
public String getProviderKey() { | ||
return AthesiE5LProvider.PROVIDER_KEY; | ||
} | ||
|
||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////// | ||
// LIFE CYCLE | ||
//////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
@Override | ||
protected void configureProvider() { | ||
broadcastIntentFilters.add(AthesiE5LIntents.BARCODE_EVENT); | ||
disableScanner = null; // FIXME | ||
enableScanner = null; // FIXME | ||
} | ||
|
||
|
||
//////////////////////////////////////////////////////////////////////////////////////////////// | ||
// SOFTWARE TRIGGERS | ||
//////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
@Override | ||
public void pressScanTrigger(@Nullable ScannerCommandCallbackProxy cb) { | ||
broadcastIntent(AthesiE5LIntents.PRESS_TRIGGER); | ||
if (cb != null) { | ||
cb.onSuccess(); | ||
} | ||
} | ||
|
||
@Override | ||
public void releaseScanTrigger(@Nullable ScannerCommandCallbackProxy cb) { | ||
broadcastIntent(AthesiE5LIntents.RELEASE_TRIGGER); | ||
if (cb != null) { | ||
cb.onSuccess(); | ||
} | ||
} | ||
} |
Oops, something went wrong.