pwittchen / neurosky-android-sdk

Android SDK for the NeuroSky MindWave Mobile Brainwave Sensing Headset
https://pwittchen.github.io/neurosky-android-sdk/docs
Apache License 2.0
50 stars 16 forks source link

Issue with start/stop monitoring #62

Open vhiguita opened 4 years ago

vhiguita commented 4 years ago

When I am using the method neuroSky.stopMonitoring() with Kotlin, it stays in an 'Idle' state, after of resuming the data transmission is not working with this method neuroSky.startMonitoring(). How could I do to fix it?.

//Start monitoring
 btn_start_monitoring.setOnClickListener {
            neuroSky.startMonitoring()

 }
//Stop monitoring "Idle State"
btn_stop_monitoring.setOnClickListener {
            neuroSky.stopMonitoring()      
}
pwittchen commented 4 years ago

Hi @vhiguita,

I think your issue is related to #16. Underlying ThinkGear SDK works in such a way, so this bug is inherited here too. I think, unfortunately the best way to handle it for now is to call disonnect() method and when you want to start monitoring again, then you need to call connect() and startMonitoring(). I'll investigate it and see if it's possible to handle it in a better way.

Regards, Piotr