i am using a roving networks bluetooth adapter that is paired with my phone. in my program i send commands to the adapter via the textwriter to reboot the adapter to change to new baud rates. i then close the serial streams and disconnect the serial connection (serial1.disconnect). subsequently i reconnect to the bluetooth adapter using serial1.connect3(".....",1).
my question is - is there any way to tell programmatically when the serial disconnect is "complete" before i attempt to reconnect? currently i use a loop to wait approximately 5 seconds. using a shorter time period usually results in a program hang/freeze.
also, the only way i was able to reconnect is to use the connect3 syntax. not quite sure why the simple connect method doesn't work. and, how do you know which port to use? i used "1" and it worked but "3" doesn't.
my question is - is there any way to tell programmatically when the serial disconnect is "complete" before i attempt to reconnect? currently i use a loop to wait approximately 5 seconds. using a shorter time period usually results in a program hang/freeze.
also, the only way i was able to reconnect is to use the connect3 syntax. not quite sure why the simple connect method doesn't work. and, how do you know which port to use? i used "1" and it worked but "3" doesn't.