Connect multiple applications to terminal
Closed this issue · 7 comments
Sometimes it's possible to connect multiple applications to one single terminal. This is not what we want. Is this by design? And if it is, is it possible to turn this off?
Strangely the terminal is not always available on the second application when already connected.
Hello Emiellohr,
You can use this code to to remove last stored device:
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getContext());
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.remove(Utils.PREFERENCES_LAST_CONNECTED_DEVICE_ADDRESS);
editor.remove(Utils.PREFERENCES_LAST_CONNECTED_DEVICE_NAME);
editor.apply();
Kind regards,
Stefan
Hi Stefan. Thanks for your reply, but this is not what I meant. Let me try to explain it more clearly.
The behaviour is that an application (1) is connected to a specific myPos terminal (1). Then I start the application on a second tablet (2) and the same terminal (1) will be visible in the connections dialog. Is it possible to configure that only one application can connect to a single terminal?
Hello Emiellohr,
myPos terminal is publicly visible Bluetooth connection from any device event if it is already connected. But the multiple connections to it will be rejected.
If you want to pair a specific tablet/terminal couple, you can use POSHandler.getInstance().connectDevice(context, posSN); passing the serial number from the back of the POS device.
Hi Stephan,
Thanks for your reply. The "mPOSHandler.connectDevice(context, posSN);" method would indeed be nice, but is not available in 'com.mypos:slavesdk:1.0.2'. I get a: "Expected 1 arguments but found 2" message.
Can you please tell me what I'm doing wrong?
Kind regards,
Emiel
Please try 'com.mypos:slavesdk-beta:2.0.7' instead.
Kind regrads
This seems to improve the behavior. When is this version released as a stable version (with some documentation).
Hi,
I double check your devices software versions and I confirm slavesdk-beta2.0.7 is fully compatible with them. You can find more info into 'new-features' branch of this repository or send an e-mail to online@mypos.com
Thanks