#include "myBase.h"
#include "myLog.h"
#include "myTask.h"

#include "app_sys.h"
#include "mySystem.h"


LOCAL std::string path = "/mnt/RTU/test/config/";
LOCAL std::string self_ptl_cfg = "self_ptl.xml";

int app_cfg_parse()
{
    if(0 != self_ptl_cfg_parse(path + self_ptl_cfg))
    {
        MY_LOG_E("self_ptl_cfg_parse failed, path:%s", (path + self_ptl_cfg).c_str());
        return -1;
    }

    return 0;
}

int main(void)
{
    #ifdef RK356x
    MY_LOG_I("RK356x");
    #else
    MY_LOG_I("ubuntu");
    #endif

    MY_LOG_I("main start !");

    if(0 != app_cfg_parse())
    {
        MY_LOG_E("app_cfg_parse failed !");
        return -1;
    }

    if(0 != app_sys_init())
    {
        MY_LOG_E("app_sys_init failed !");
        return -1;
    }

    while(1)
    {
        task_sleep_ms(1000);
    }

    return 0;
}
