provisioning example, waitForProvisioning()

This commit is contained in:
Manuel Bleichenbacher
2018-07-23 14:30:03 +02:00
parent b179ce6884
commit 3e084a4ed9
6 changed files with 142 additions and 12 deletions

View File

@ -87,6 +87,21 @@ void TheThingsNetwork::startProvisioningTask()
#endif
}
void TheThingsNetwork::waitForProvisioning()
{
#if !defined(CONFIG_TTN_PROVISION_UART_NONE)
if (isProvisioned())
{
ESP_LOGI(TAG, "Device is already provisioned");
return;
}
while (!provisioning_have_keys())
vTaskDelay(1000 / portTICK_PERIOD_MS);
ESP_LOGI(TAG, "Device successfully provisioned");
#endif
}
bool TheThingsNetwork::join(const char *devEui, const char *appEui, const char *appKey)
{