int main() { GAgent_Init( &pgContextData ); GAgent_dumpInfo( pgContextData ); while(1) { GAgent_Tick( pgContextData ); GAgent_SelectFd( pgContextData,1,0 ); GAgent_Lan_Handle( pgContextData, pgContextData->rtinfo.Rxbuf , GAGENT_BUF_LEN ); GAgent_Local_Handle( pgContextData, pgContextData->rtinfo.Rxbuf, GAGENT_BUF_LEN ); GAgent_Cloud_Handle( pgContextData, pgContextData->rtinfo.Rxbuf, GAGENT_BUF_LEN ); } }
int main(void) { /* zhou stub */ /* 创建gagent进程单独运行 */ //CoreInit(); X86_Serial_Init(); IOF_Config_hook_init(); IOF_General_Hook_Init(); GAgent_TimerInit(); X86_Timer_Creat(GAGENT_TIMER_S_1, GAGENT_TIMER_US, x86_timer_handle); /* 1S */ GAgent_Init(); while(1) { GAgent_TimerRun(); GAgent_DoBusiness(); //sleep(1); } }
int main(void) { /* 创建gagent进程单独运行 */ //CoreInit(); IOF_Config_hook_init(); IOF_General_Hook_Init(); GAgent_TimerInit(); X86_Timer_Creat(GAGENT_TIMER_S_1, GAGENT_TIMER_US, x86_timer_handle); /* 1S */ GAgent_Init(); top(&G_mavlink_attitude); while(1) { GAgent_TimerRun(); GAgent_DoBusiness(); // printf("roll =%f,pitch =%f,yaw =%f,rollspeed =%f,pitchspeed =%f,yawspeed=%f \n",G_mavlink_attitude.roll,G_mavlink_attitude.pitch, G_mavlink_attitude.yaw,G_mavlink_attitude.rollspeed,G_mavlink_attitude.pitchspeed,G_mavlink_attitude.yawspeed); msleep(1500); } }
int nl6621_gizwits_entry(void) { int ret = 0; UINT8 prioUser = TCPIP_THREAD_PRIO + 1; /* Print GAgent version */ print_version(); log_info("Entry gizwits initialize(time:%d(s); %d(ms)).\n", nl6621_GetTime_S(), nl6621_GetTime_MS()); init_system_task(); sys_status.status = SYS_STATUS_WIFI_STOP; sys_status.onboarding = SYS_STATUS_ONBOARDING_FAILED; sys_thread_new("SysStatusThread", SysStatusThread, NULL, NST_TEST_APP_TASK_STK_SIZE, prioUser++); /* Initialize the system timer **/ GAgent_TimerInit(); nl6621_Timer_Creat(GAGENT_TIMER_S_1, GAGENT_TIMER_US, nl6621_timer_handle); /* 1S */ #if HEART_BEAT_DEBUG_MACRO GAgent_Timer_Init(); #endif /* initialize GAgent resource */ GAgent_Init(); OSTimeDly(100); /* After module network create finish, setup soft timer to process the RESET task. * */ GAgent_ResetTask(); /* * Create network task thread. Include UDP server, UDP Broadcast, TCP server, TCP * login cloud task thread. * */ sys_thread_new("UdpServerThread", UdpServerThread, NULL, NST_TEST_APP_TASK_STK_SIZE, prioUser++); sys_thread_new("DevDiscoverThread", DevDiscoverThread, NULL, NST_TEST_APP_TASK_STK_SIZE, prioUser++);/*ota DevDiscoverThread*/ sys_thread_new("UdpBCTThread", UdpBCTThread, NULL, NST_TEST_APP_TASK_STK_SIZE, prioUser++); sys_thread_new("TcpServerThread", TcpServerThread, NULL, NST_TEST_APP_TASK_STK_SIZE, prioUser++); sys_thread_new("TcpCloudThread", TcpCloudThread, NULL, NST_TEST_APP_TASK_STK_SIZE * 4, prioUser++); /* support NTP protocol */ sys_thread_new("RTCThread", NTPThread, NULL, NST_TEST_APP_TASK_STK_SIZE, prioUser++); log_info("Try to connect wifi...[%08x]\n", g_stGAgentConfigData.flag); /*power save enable,soft ps mode, mcu keep running, open/close radio power dynamically*/ // InfListenIntervalSet(255, 1); #ifdef POWERSAVE_SUPPORT ret = InfPowerSaveSet(PS_MODE_SOFT); printf("InfPowerSaveSet : %d\n",ret); #endif while (1) { GAgent_TimerRun(); check_socket(); check_system_reset(); OSTimeDly(10); } }