mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-26 09:59:01 +00:00
oops my latest change busted android connection detection
This commit is contained in:
parent
d179bda728
commit
bc76c79e1e
@ -27,18 +27,19 @@ PhoneAPI::~PhoneAPI()
|
|||||||
|
|
||||||
void PhoneAPI::handleStartConfig()
|
void PhoneAPI::handleStartConfig()
|
||||||
{
|
{
|
||||||
// even if we were already connected - restart our state machine
|
// Must be before setting state (because state is how we know !connected)
|
||||||
state = STATE_SEND_MY_INFO;
|
|
||||||
|
|
||||||
DEBUG_MSG("Reset nodeinfo read pointer\n");
|
|
||||||
nodeInfoForPhone = NULL; // Don't keep returning old nodeinfos
|
|
||||||
nodeDB.resetReadPointer(); // FIXME, this read pointer should be moved out of nodeDB and into this class - because
|
|
||||||
// this will break once we have multiple instances of PhoneAPI running independently
|
|
||||||
|
|
||||||
if (!isConnected()) {
|
if (!isConnected()) {
|
||||||
onConnectionChanged(true);
|
onConnectionChanged(true);
|
||||||
observe(&service.fromNumChanged);
|
observe(&service.fromNumChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// even if we were already connected - restart our state machine
|
||||||
|
state = STATE_SEND_MY_INFO;
|
||||||
|
|
||||||
|
DEBUG_MSG("Starting API client config\n");
|
||||||
|
nodeInfoForPhone = NULL; // Don't keep returning old nodeinfos
|
||||||
|
nodeDB.resetReadPointer(); // FIXME, this read pointer should be moved out of nodeDB and into this class - because
|
||||||
|
// this will break once we have multiple instances of PhoneAPI running independently
|
||||||
}
|
}
|
||||||
|
|
||||||
void PhoneAPI::close()
|
void PhoneAPI::close()
|
||||||
|
@ -32,7 +32,7 @@ void BluetoothPhoneAPI::onNowHasData(uint32_t fromRadioNum)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BluetoothPhoneAPI::checkIsConnected() {
|
bool BluetoothPhoneAPI::checkIsConnected() {
|
||||||
return curConnectionHandle != -1;
|
return curConnectionHandle >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int toradio_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
|
int toradio_callback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg)
|
||||||
|
Loading…
Reference in New Issue
Block a user