added test-framework

This commit is contained in:
2021-01-02 00:30:13 +01:00
parent fb5924cff1
commit 563a7b19a8
19 changed files with 1431 additions and 49 deletions

View File

@ -1,2 +1,2 @@
idf_component_register(SRCS "mesh_main.c"
idf_component_register(SRCS "main.c"
INCLUDE_DIRS ".")

View File

@ -11,6 +11,7 @@
#include "esp_ota_ops.h"
#include "esp_partition.h"
#include "mesh_ota.h"
#define RX_SIZE (1234)
@ -476,52 +477,6 @@ void ip_event_handler(void *arg, esp_event_base_t event_base,
}
/*
* 999.999.999
* Return true if remote version is newer (higher) than local version
*/
bool bNewerVersion(const char* pu8Local, const char* pu8Remote){
ESP_LOGI(MESH_TAG, "Local %s", pu8Local);
ESP_LOGI(MESH_TAG, "Remote %s", pu8Remote);
char u8LocalTmp[12];
char u8RemoteTmp[12];
char* pu8saveptrLocal;
char* pu8saveptrRemote;
strcpy(u8LocalTmp, pu8Local);
strcpy(u8RemoteTmp, pu8Remote);
char* pu8TokenLocal = strtok_r(u8LocalTmp, ".", &pu8saveptrLocal);
char* pu8TokenRemote = strtok_r(u8RemoteTmp, ".", &pu8saveptrRemote) ;
bool bReturn = false;
uint8_t u8Index = 0;
while( (u8Index <= 2) && (bReturn == false)){
u8Index++;
printf("loop: %i\n", u8Index);
printf("tokenLocal: %s\n", pu8TokenLocal);
printf("tokenRemote: %s\n", pu8TokenRemote);
if(atoi(pu8TokenLocal) < atoi(pu8TokenRemote))
{
bReturn = true;
}
pu8TokenLocal = strtok_r(NULL, ".", &pu8saveptrLocal);
pu8TokenRemote = strtok_r(NULL, ".", &pu8saveptrRemote) ;
}
return bReturn;
}
void app_main(void)
@ -640,3 +595,5 @@ void app_main(void)
}