I have been developing an app to connect to my BLE embedded system based on a TI 2640 SoC. I have had some success but have found that once a Scan() is completed and the Connect() command is issued with the appropriate ID, the amount of time required prior to the "Connected" event being raised can vary from a second or two to 45 seconds or more. I have noted that the library generates a log message "Discovering Services". This message is also delayed until just prior to the Connected event occurring.
I have tried several scanner apps and the TI development app with my embedded system and in all cases, the services are discovered in a fairly brief period, about 2 - 4 seconds consistently.
A second observation that seems to be connect to the timeliness of the connection is Activity Control. I maintain all of the BLE related events in the Starter file. After a successful Connected event has occurred, I call the ReadData() command with my custom service as the parameter. This generates a DataAvailable event. At the end of and within the ReadData event, I call a function that is a member of the Main activity file which stops a spinner icon and starts a different activity. If the service discovery is very fast (within a second or two), the second activity starts briefly but then I get the following in the log:
** Activity (auxconfiguration) Pause, UserClosed = false **
Killing previous instance (main).
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
The peculiar issue is that if the amount of time required to discover the services is greater than about 5 seconds, this activity control issue does not occur. My configuration activity is not paused and Main is not killed.
Any suggestions would be appreciated.
Thank you.
I have tried several scanner apps and the TI development app with my embedded system and in all cases, the services are discovered in a fairly brief period, about 2 - 4 seconds consistently.
A second observation that seems to be connect to the timeliness of the connection is Activity Control. I maintain all of the BLE related events in the Starter file. After a successful Connected event has occurred, I call the ReadData() command with my custom service as the parameter. This generates a DataAvailable event. At the end of and within the ReadData event, I call a function that is a member of the Main activity file which stops a spinner icon and starts a different activity. If the service discovery is very fast (within a second or two), the second activity starts briefly but then I get the following in the log:
** Activity (auxconfiguration) Pause, UserClosed = false **
Killing previous instance (main).
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
The peculiar issue is that if the amount of time required to discover the services is greater than about 5 seconds, this activity control issue does not occur. My configuration activity is not paused and Main is not killed.
Any suggestions would be appreciated.
Thank you.