Merge pull request #357 from iranl/enlarge-stack
Enlarge stack and check for valid config on JSON changes
This commit is contained in:
@@ -469,7 +469,7 @@ void NukiOpenerWrapper::updateConfig()
|
||||
|
||||
void NukiOpenerWrapper::updateAuthData()
|
||||
{
|
||||
if(_nukiOpener.getSecurityPincode() == 0) return;
|
||||
if(!isPinSet()) return;
|
||||
|
||||
Nuki::CmdResult result = _nukiOpener.retrieveLogEntries(0, 0, 0, true);
|
||||
if(result != Nuki::CmdResult::Success)
|
||||
@@ -767,10 +767,19 @@ Nuki::BatteryType NukiOpenerWrapper::batteryTypeToEnum(const char* str)
|
||||
|
||||
void NukiOpenerWrapper::onConfigUpdateReceived(const char *value)
|
||||
{
|
||||
|
||||
JsonDocument jsonResult;
|
||||
char _resbuf[2048];
|
||||
|
||||
if(_nukiOpener.getSecurityPincode() == 0)
|
||||
if(!_configRead || !_nukiConfigValid)
|
||||
{
|
||||
jsonResult["general"] = "configNotReady";
|
||||
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
|
||||
_network->publishConfigCommandResult(_resbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isPinSet())
|
||||
{
|
||||
jsonResult["general"] = "noPinSet";
|
||||
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
|
||||
@@ -1402,7 +1411,7 @@ void NukiOpenerWrapper::onKeypadCommandReceived(const char *command, const uint
|
||||
|
||||
void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
|
||||
{
|
||||
if(_nukiOpener.getSecurityPincode() == 0)
|
||||
if(!isPinSet())
|
||||
{
|
||||
_network->publishKeypadJsonCommandResult("noPinSet");
|
||||
return;
|
||||
@@ -1744,7 +1753,13 @@ void NukiOpenerWrapper::onKeypadJsonCommandReceived(const char *value)
|
||||
|
||||
void NukiOpenerWrapper::onTimeControlCommandReceived(const char *value)
|
||||
{
|
||||
if(_nukiOpener.getSecurityPincode() == 0)
|
||||
if(!_configRead || !_nukiConfigValid)
|
||||
{
|
||||
_network->publishTimeControlCommandResult("configNotReady");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isPinSet())
|
||||
{
|
||||
_network->publishTimeControlCommandResult("noPinSet");
|
||||
return;
|
||||
|
||||
@@ -450,7 +450,7 @@ void NukiWrapper::updateConfig()
|
||||
|
||||
void NukiWrapper::updateAuthData()
|
||||
{
|
||||
if(_nukiLock.getSecurityPincode() == 0) return;
|
||||
if(!isPinSet()) return;
|
||||
|
||||
Nuki::CmdResult result = _nukiLock.retrieveLogEntries(0, 0, 0, true);
|
||||
if(result != Nuki::CmdResult::Success)
|
||||
@@ -707,7 +707,15 @@ void NukiWrapper::onConfigUpdateReceived(const char *value)
|
||||
JsonDocument jsonResult;
|
||||
char _resbuf[2048];
|
||||
|
||||
if(_nukiLock.getSecurityPincode() == 0)
|
||||
if(!_configRead || !_nukiConfigValid)
|
||||
{
|
||||
jsonResult["general"] = "configNotReady";
|
||||
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
|
||||
_network->publishConfigCommandResult(_resbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isPinSet())
|
||||
{
|
||||
jsonResult["general"] = "noPinSet";
|
||||
serializeJson(jsonResult, _resbuf, sizeof(_resbuf));
|
||||
@@ -1389,7 +1397,7 @@ void NukiWrapper::onKeypadCommandReceived(const char *command, const uint &id, c
|
||||
|
||||
void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
|
||||
{
|
||||
if(_nukiLock.getSecurityPincode() == 0)
|
||||
if(!isPinSet())
|
||||
{
|
||||
_network->publishKeypadJsonCommandResult("noPinSet");
|
||||
return;
|
||||
@@ -1731,7 +1739,13 @@ void NukiWrapper::onKeypadJsonCommandReceived(const char *value)
|
||||
|
||||
void NukiWrapper::onTimeControlCommandReceived(const char *value)
|
||||
{
|
||||
if(_nukiLock.getSecurityPincode() == 0)
|
||||
if(!_configRead || !_nukiConfigValid)
|
||||
{
|
||||
_network->publishTimeControlCommandResult("configNotReady");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isPinSet())
|
||||
{
|
||||
_network->publishTimeControlCommandResult("noPinSet");
|
||||
return;
|
||||
|
||||
@@ -112,9 +112,9 @@ void setupTasks()
|
||||
{
|
||||
// configMAX_PRIORITIES is 25
|
||||
|
||||
xTaskCreatePinnedToCore(networkTask, "ntw", 10240, NULL, 3, &networkTaskHandle, 1);
|
||||
xTaskCreatePinnedToCore(nukiTask, "nuki", 5120, NULL, 2, &nukiTaskHandle, 1);
|
||||
xTaskCreatePinnedToCore(presenceDetectionTask, "prdet", 896, NULL, 5, &presenceDetectionTaskHandle, 1);
|
||||
xTaskCreatePinnedToCore(networkTask, "ntw", 12288, NULL, 3, &networkTaskHandle, 1);
|
||||
xTaskCreatePinnedToCore(nukiTask, "nuki", 8192, NULL, 2, &nukiTaskHandle, 1);
|
||||
xTaskCreatePinnedToCore(presenceDetectionTask, "prdet", 1024, NULL, 5, &presenceDetectionTaskHandle, 1);
|
||||
}
|
||||
|
||||
void initEthServer(const NetworkDeviceType device)
|
||||
|
||||
Reference in New Issue
Block a user