app/src/main/java/com/michael/bci/BciSender.java
void SendMessage(String writeData, BciService bciService) {
        /* The default FTDI latency is too large for EEG apps, making the incoming signal "choppy", Change from 16ms to 1ms */
        bciService.ftDevice.setLatencyTimer((byte) 16);
        bciService.ftDevice.purge((byte) (D2xxManager.FT_PURGE_TX | D2xxManager.FT_PURGE_RX)); //MAY NEED THIS
//        String writeData = "v";//writeText.getText().toString(); //MAY NEED THIS
        byte[] OutData = writeData.getBytes();
        Log.w("PROCESS_DATA:", "OutData 0:" +OutData);
        Log.w("PROCESS_DATA:", "OutData 1:" + Arrays.toString(OutData));
        bciService.ftDevice.write(OutData, writeData.length());

        if (!bciService.ftDevice.isOpen()) {
            Log.e("j2xx", "SendMessage: device not open");
        }
    }
/* Send the actual OpenBCI command via FTDI to USB Dongle */
Send the actual OpenBCI command via FTDI to USB Dongle
Send the actual OpenBCI command via FTDI to USB Dongle
void SendMessage(String writeData, BciService bciService) {
        /* The default FTDI latency is too large for EEG apps, making the incoming signal "choppy", Change from 16ms to 1ms */
        bciService.ftDevice.setLatencyTimer((byte) 16);
        bciService.ftDevice.purge((byte) (D2xxManager.FT_PURGE_TX | D2xxManager.FT_PURGE_RX)); 
//        String writeData = "v";//writeText.getText().toString(); 
        byte[] OutData = writeData.getBytes();
        Log.w("PROCESS_DATA:", "OutData 0:" +OutData);
        Log.w("PROCESS_DATA:", "OutData 1:" + Arrays.toString(OutData));
        bciService.ftDevice.write(OutData, writeData.length());
        if (!bciService.ftDevice.isOpen()) {
            Log.e("j2xx", "SendMessage: device not open");
        }
    }
void SendMessage ( String writeData , BciService bciService ) { /* The default FTDI latency is too large for EEG apps, making the incoming signal "choppy", Change from 16ms to 1ms */ bciService . ftDevice . setLatencyTimer ( ( byte ) 16 ) ; bciService . ftDevice . purge ( ( byte ) ( D2xxManager . FT_PURGE_TX | D2xxManager . FT_PURGE_RX ) ) ; byte [ ] OutData = writeData . getBytes ( ) ; Log . w ( "PROCESS_DATA:" , "OutData 0:" + OutData ) ; Log . w ( "PROCESS_DATA:" , "OutData 1:" + Arrays . toString ( OutData ) ) ; bciService . ftDevice . write ( OutData , writeData . length ( ) ) ; if ( ! bciService . ftDevice . isOpen ( ) ) { Log . e ( "j2xx" , "SendMessage: device not open" ) ; } }
Send the actual OpenBCI command via FTDI to USB Dongle
Send the actual OpenBCI command via FTDI to USB Dongle
//MAY NEED THIS //        String writeData = "v";//writeText.getText().toString(); //MAY NEED THIS