How to Manage Serial Port Connections During Terminal Sleep Mode: Difference between revisions

From wizarPOS
No edit summary
(Replaced content with "{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/usb-serial-port/reopen-serial-after-wake-up}}")
Tag: Replaced
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
When the temrinal enter the sleep mode, it will disconnect the power of the usb, which will make the connection broken.
{{Migrating|https://smartpossdk.gitbook.io/cloudpossdk/faq/usb-serial-port/reopen-serial-after-wake-up}}
 
At that time, any serial port function can not work, even after the terminal restore from sleep mode, wake up.
 
So the serial port should be closed before enter sleep mode. Then open the serial port any time after wakeup, the serial port should work fine.
 
 
'''Here is the code about how to monitor the screen on/off:'''
<syntaxhighlight lang="java" line='line'>
intentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
registerReceiver(receiver, filter);
</syntaxhighlight>
when receive screen off, close the serial port.

Latest revision as of 08:25, 7 April 2024

Please visit new link of same subject:

https://smartpossdk.gitbook.io/cloudpossdk/faq/usb-serial-port/reopen-serial-after-wake-up

We're making a move! Our site's content is migrating to a new URL, to provide you with an enhanced browsing experience. Please update your bookmarks accordingly. Thank you for your continuous support!