mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 03:39:49 +03:00
critical relability fix
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user