Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Mentalab-hub/develop
Pull request for Version 0.2 Release
- Loading branch information
Showing
115 changed files
with
1,544 additions
and
45,592 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,47 @@ | ||
package com.mentalab; | ||
|
||
import android.os.Build.VERSION_CODES; | ||
import android.os.Bundle; | ||
import androidx.annotation.RequiresApi; | ||
import androidx.appcompat.app.AppCompatActivity; | ||
import com.mentalab.exception.CommandFailedException; | ||
import com.mentalab.exception.InvalidDataException; | ||
import com.mentalab.exception.NoBluetoothException; | ||
import com.mentalab.exception.NoConnectionException; | ||
import java.io.InputStream; | ||
import java.util.Map; | ||
import java.util.Queue; | ||
import java.util.Set; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
|
||
@RequiresApi(api = VERSION_CODES.R) | ||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
|
||
try { | ||
Set<String> deviceList = MentalabCommands.scan(); | ||
MentalabCommands.connect(deviceList.iterator().next()); | ||
InputStream inputStream = MentalabCommands.getRawData(); | ||
Map<String, Queue<Float>> map = MentalabCodec.decode(inputStream); | ||
|
||
// Map<String, Boolean> configMap = Map.of(DeviceConfigSwitches.Channels[7], false, | ||
// MentalabConstants.DeviceConfigSwitches.Channels[6], false); | ||
// MentalabCommands.setEnabled(configMap); | ||
// MentalabCommands.pushToLsl(); | ||
// MentalabCommands.formatDeviceMemory(); | ||
// Thread.sleep(2000); | ||
// MentalabCodec.stopDecoder(); | ||
} catch (NoBluetoothException exception) { | ||
exception.printStackTrace(); | ||
} catch (InvalidDataException exception) { | ||
exception.printStackTrace(); | ||
} catch (NoConnectionException exception) { | ||
exception.printStackTrace(); | ||
} catch (CommandFailedException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.