Help Center > > Developer Guide> SDK Usage Guide on the Device Side> LiteOS SDK Integration Development Guide> Processfor Connecting Devices to OceanConnect on the Device Side> Entrypoint Function for LiteOS SDK Device-Cloud Interconnect Components

Entrypoint Function for LiteOS SDK Device-Cloud Interconnect Components

Updated at: Jun 26, 2019 GMT+08:00

To connect the LiteOS SDK device-cloud interconnect component Agent Tiny to OceanConnect, create an entrypoint function agent_tiny_entry().

Function

Description

void agent_tiny_entry(void)

Entrypoint function for LiteOS SDK device-cloud interconnect components. This function can be used to initialize Agent Tiny, create report tasks, and call the main function body of Agent Tiny.

Parameter list: N/A

Return value: null

Based on the task mechanism provided by the LiteOS kernel, a developer can create a main task main_task, and call the entrypoint function agent_tiny_entry() in the main task to enable the Agent Tiny workflow.

 UINT32 creat_main_task()
     {
         UINT32 uwRet = LOS_OK;
         TSK_INIT_PARAM_S task_init_param;
         task_init_param.usTaskPrio = 0;
         task_init_param.pcName = "main_task";
         task_init_param.pfnTaskEntry = (TSK_ENTRY_FUNC)main_task;
         task_init_param.uwStackSize = 0x1000;
         uwRet = LOS_TaskCreate(&g_TskHandle, &task_init_param);
         if(LOS_OK != uwRet)
         {
             return uwRet;
         }
         return uwRet;
     }

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel