critical relability fix

This commit is contained in:
2024-08-23 18:35:39 +03:00
parent f672878873
commit e5e24943a6
3 changed files with 17 additions and 5 deletions

View File

@@ -570,7 +570,7 @@ return 0;
aJsonObject * canDriver::getConfbyID(uint8_t devId)
{
if (!canConfigObj) return NULL;
if (!canRemoteConfigObj) return NULL;
if (!canRemoteConfigObj || canRemoteConfigObj->type != aJson_Object) return NULL;
aJsonObject * remoteConfObj=canRemoteConfigObj->child;
while (remoteConfObj)
{
@@ -587,7 +587,7 @@ return NULL;
aJsonObject * canDriver::findConfbyName(char* devName, int * devAddr)
{
if (!canRemoteConfigObj && !devName) return NULL;
if (!canRemoteConfigObj || canRemoteConfigObj->type != aJson_Object || !devName ) return NULL;
aJsonObject * remoteConfObj=canRemoteConfigObj->child;
while (remoteConfObj)
{
@@ -616,7 +616,7 @@ extern PubSubClient mqttClient;
bool canDriver::subscribeTopics(char * root, size_t buflen)
{
if (!root) return false;
if (!canRemoteConfigObj) return false;
if (!canRemoteConfigObj || canRemoteConfigObj->type != aJson_Object) return false;
int rootLen = strlen(root);

View File

@@ -341,13 +341,13 @@ uint16_t getCanNum(aJsonObject* verb)
case aJson_Array:
{
aJsonObject *canNumObj=aJson.getArrayItem(verb,1);
if (canNumObj->type == aJson_Int) return canNumObj->valueint;
if (canNumObj && canNumObj->type == aJson_Int) return canNumObj->valueint;
return 0;
}
case aJson_Object:
{
aJsonObject *canNumObj=aJson.getObjectItem(verb, "can");
if (canNumObj->type == aJson_Int) return canNumObj->valueint;
if (canNumObj && canNumObj->type == aJson_Int) return canNumObj->valueint;
return 0;
}
}

View File

@@ -2717,6 +2717,18 @@ infoSerial<<F("\n(+)CAN");
#else
infoSerial<<F("\n(-)CAN");
#endif
#ifdef PULSEPIN12
infoSerial<<F("\n(+)PULSE on PIN12");
#else
infoSerial<<F("\n(-)PULSE on PIN12");
#endif
#ifdef CRYPT
infoSerial<<F("\n(+)CRYPT");
#else
infoSerial<<F("\n(-)CRYPT");
#endif
//#ifdef IPMODBUS
//infoSerial<<F("\n(+)IPMODBUS");
//#endif