move discovery if needed into BLEClientService.discover()

This commit is contained in:
hathach committed 2017-07-18 21:46:37 +07:00
1 parent 56366d4b2e
commit d28cefd39f
2 files changed
+3 -3

No files matched your search

@@ -73,6 +73,9 @@ bool BLEClientService::begin(void)
bool BLEClientService::discover(uint16_t conn_handle)
{
// Initialize Discovery module if needed
if ( !Bluefruit.Discovery.begun() ) Bluefruit.Discovery.begin();
VERIFY( Bluefruit.Discovery._discoverService(conn_handle, *this) );
_conn_hdl = conn_handle;
return true;
@@ -84,9 +84,6 @@ bool BLEAncs::begin(void)
// Invoke base class begin()
BLEClientService::begin();
// Initialize Discovery module if needed
if ( !Bluefruit.Discovery.begun() ) Bluefruit.Discovery.begin();
_adamsg.begin(false);
_control.begin();