@@ -188,8 +188,19 @@ StackFlow::StackFlow::StackFlow(const std::string &unit_name)
188188
189189 status_.store (0 );
190190 exit_flage_.store (false );
191- even_loop_thread_ = std::make_unique<std::thread>(std::bind (&StackFlow::even_loop, this ));
192- event_queue_.enqueue (EVENT_SYS_INIT, " " , " " );
191+ even_loop_thread_ = std::make_unique<std::thread>(std::bind (&StackFlow::even_loop, this ));
192+ llm_channel_obj::uart_push_url = std::string (" ipc:///tmp/llm/5556.sock" );
193+ status_.store (1 );
194+ repeat_event (1000 , [this ]() {
195+ std::string serial_zmq_url = this ->sys_sql_select (" serial_zmq_url" );
196+ if (!serial_zmq_url.empty ()) {
197+ SLOGI (" serial_zmq_url:%s" , serial_zmq_url.c_str ());
198+ llm_channel_obj::uart_push_url = serial_zmq_url;
199+ return 0 ;
200+ } else {
201+ return 1 ;
202+ }
203+ });
193204}
194205
195206StackFlow::~StackFlow ()
@@ -222,17 +233,7 @@ void StackFlow::_none_event(const std::string &data1, const std::string &data2)
222233
223234void StackFlow::_sys_init (const std::string &zmq_url, const std::string &data)
224235{
225- // serial_zmq_url
226- std::string serial_zmq_url;
227- serial_zmq_url = sys_sql_select (" serial_zmq_url" );
228- if (!serial_zmq_url.empty ()) {
229- SLOGI (" serial_zmq_url:%s" , serial_zmq_url.c_str ());
230- llm_channel_obj::uart_push_url = serial_zmq_url;
231- status_.store (1 );
232- } else {
233- sleep (1 );
234- event_queue_.enqueue (EVENT_SYS_INIT, " " , " " );
235- }
236+ // todo:...
236237}
237238
238239std::string StackFlow::_rpc_setup (pzmq *_pzmq, const std::string &data)
0 commit comments