add parent service for central

This commit is contained in:
hathach committed 2017-03-23 02:21:52 +07:00
1 parent 9f40cbfb1e
commit be42b0a360
8 files changed
+29 -9

No files matched your search

@@ -36,6 +36,9 @@
#include "bluefruit.h"
// Last service that is discovered
BLECentralService* BLECentralService::lastService = NULL;
void BLECentralService::_init(void)
{
}
@@ -63,5 +66,9 @@ err_t BLECentralService::begin(void)
bool BLECentralService::discover(uint16_t start_handle)
{
return Bluefruit.Central.discoverService(uuid, start_handle);
VERIFY( Bluefruit.Central.discoverService(uuid, start_handle) );
lastService = this;
return true;
}