#include <sys/socket.h>
#include <iostream>
#include <algorithm>
-#include <thread>
#include <errno.h>
#include <cassert>
#include <cctype>
*/
LibHomeScreen::LibHomeScreen()
{
-
}
/**
HMI_DEBUG("libhomescreen","Initialized");
}
- this->runEventloop();
-
return ret;
}
return -1;
}
-static void *event_loop_run(void *args)
-{
- struct sd_event* loop = (struct sd_event*)(args);
- HMI_DEBUG("libhomescreen","start eventloop");
- for(;;)
- sd_event_run(loop, 30000000);
-}
-
-/**
- * This function start receiving the reply/event message from home screen
- *
- * #### Parameters
- * Nothing
- *
- * #### Return
- * - Returns thread_id on success or -1 in case of error.
- *
- * #### Note
- *
- */
-int LibHomeScreen::runEventloop()
-{
- if(mploop && sp_websock)
- {
- pthread_t thread_id;
- int ret = pthread_create(&thread_id, NULL, event_loop_run, mploop);
- if(ret != 0)
- {
- HMI_ERROR("libhomescreen","Cannot run eventloop due to error:%d", errno);
- return -1;
- }
- else
- return thread_id;
- }
- else
- {
- HMI_ERROR("libhomescreen","Connecting is not established yet");
- return -1;
- }
-}
-
/**
* Sending ShortCut Icon tapped event
*