OSStatus MICOStartApplication( mico_Context_t * const inContext ) { app_log_trace(); OSStatus err = kNoErr; require_action(inContext, exit, err = kParamErr); haProtocolInit(inContext); PlatformUartInitialize(inContext); err = mico_rtos_create_thread(NULL, MICO_APPLICATION_PRIORITY, "UART Recv", uartRecv_thread, 0x500, (void*)inContext ); require_noerr_action( err, exit, app_log("ERROR: Unable to start the uart recv thread.") ); if(inContext->flashContentInRam.appConfig.localServerEnable == true){ err = mico_rtos_create_thread(NULL, MICO_APPLICATION_PRIORITY, "Local Server", localTcpServer_thread, 0x200, (void*)inContext ); require_noerr_action( err, exit, app_log("ERROR: Unable to start the local server thread.") ); } if(inContext->flashContentInRam.appConfig.remoteServerEnable == true){ err = mico_rtos_create_thread(NULL, MICO_APPLICATION_PRIORITY, "Remote Client", remoteTcpClient_thread, 0x500, (void*)inContext ); require_noerr_action( err, exit, app_log("ERROR: Unable to start the remote client thread.") ); } exit: return err; }
void ConfigSoftApWillStart(mico_Context_t * const inContext ) { OSStatus err; sppProtocolInit(inContext); PlatformUartInitialize(inContext); err = mico_rtos_create_thread(NULL, MICO_APPLICATION_PRIORITY, "UART Recv", uartRecv_thread, 0x500, (void*)inContext ); require_noerr_action( err, exit, config_delegate_log("ERROR: Unable to start the uart recv thread.") ); if(inContext->flashContentInRam.appConfig.localServerEnable == true){ err = mico_rtos_create_thread(NULL, MICO_APPLICATION_PRIORITY, "Local Server", localTcpServer_thread, 0x200, (void*)inContext ); require_noerr_action( err, exit, config_delegate_log("ERROR: Unable to start the local server thread.") ); } exit: return; }