Created
March 31, 2019 09:45
-
-
Save CWrecker/9936c8ee1534018b3983939b07995cf5 to your computer and use it in GitHub Desktop.
Here we are adding the buttons to force serial-connection related functions.
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
//------------------------------- | |
//Serial Connection Functions | |
//---------------------- | |
usbManager = (UsbManager) getSystemService(this.USB_SERVICE); | |
startButton = (Button) findViewById(R.id.buttonStart); | |
sendButton = (Button) findViewById(R.id.buttonSend); | |
orderButton = (Button) findViewById(R.id.btnorder); | |
clearButton = (Button) findViewById(R.id.buttonClear); | |
stopButton = (Button) findViewById(R.id.buttonStop); | |
editText = (EditText) findViewById(R.id.editText); | |
textView = (TextView) findViewById(R.id.textView); | |
setUiEnabled(false); | |
IntentFilter filter = new IntentFilter(); | |
filter.addAction(ACTION_USB_PERMISSION); | |
filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); | |
filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); | |
registerReceiver(broadcastReceiver, filter); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment