I don't think I've seen the situation where the stream closed but the IOIO 
was still connected, but I will look for that specifically.

I'm not planning to use BT in production, I just need it for development 
because the phone's USB is connected to the computer for debugging. If 
there were some other way to debug Android while the phone is connected to 
the IOIO, I'd try that. I did try ADB over WiFi, but it seemed only useful 
for watching LogCat. Android Studio did not integrate with it. Has anyone 
tried a USB-OTG hub like this (
https://www.amazon.com/Hittime-Adapter-Extension-Smartphone-Tablet/dp/B00FGKXY9S
 
<https://www.google.com/url?q=https%3A%2F%2Fwww.amazon.com%2FHittime-Adapter-Extension-Smartphone-Tablet%2Fdp%2FB00FGKXY9S&sa=D&sntz=1&usg=AFQjCNEU0LA3pRmPNDPmk8jiBxdRPWffMg>)
 
with a IOIO & ADB? If only there'd be some special developer phone with 2 
USB ports.

I'm new to multi-threading and I'm sure that there are better ways. I start 
the IOIO service and the Lidar service in the MainActivity.onCreate:

        //start the IOIO Service
        Log.d(TAG,"Creating thread for IOIO service...");
        thdIoioService = new Thread() {
            public void run() {
                startService(new Intent(getApplicationContext(), 
MyIoioService.class));
            }
        };
        thdIoioService.setName("thdIoioService");
        thdIoioService.start();

        //start the Lidar Service
        Log.d(TAG,"Creating thread for Lidar service...");
        thdLidarService = new Thread() {
            public void run() {
                startService(new Intent(getApplicationContext(), 
RpLidarService.class));
            }
        };
        thdLidarService.setName("thdLidarService");
        thdLidarService.start();



The lidarSevice thread is message handler that creates the lidar controller 
object. I have all the exceptions caught in the controller and the error 
bubbles up to method called by the message handler so the app never 
crashes. I'm not sure how the BT can disconnect and the IOIO stays online - 
doesn't the IOIO run  disconnect/connect routines when the BT 
connects/disconnects? Perhaps you are referring to transient RF loss that 
BT can handle without disconnecting?

Kevin




-- 
You received this message because you are subscribed to the Google Groups 
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ioio-users+unsubscr...@googlegroups.com.
To post to this group, send email to ioio-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to