Lines Matching full:data
121 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_configure_pps() local
143 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_configure_pps()
149 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_configure_pps()
154 ret = gnss_nmea0183_snprintk(data->pair_match_buf, sizeof(data->pair_match_buf), in quectel_lcx6g_configure_pps()
160 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_configure_pps()
165 return modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_configure_pps()
170 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_lock() local
172 (void)k_sem_take(&data->lock, K_FOREVER); in quectel_lcx6g_lock()
177 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_unlock() local
179 k_sem_give(&data->lock); in quectel_lcx6g_unlock()
184 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_pm_changed() local
188 data->pm_timeout = K_TIMEOUT_ABS_MS(pm_ready_at_ms); in quectel_lcx6g_pm_changed()
193 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_await_pm_ready() local
196 k_sleep(data->pm_timeout); in quectel_lcx6g_await_pm_ready()
201 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_resume() local
208 ret = modem_pipe_open(data->uart_pipe, K_SECONDS(10)); in quectel_lcx6g_resume()
214 ret = modem_chat_attach(&data->chat, data->uart_pipe); in quectel_lcx6g_resume()
217 modem_pipe_close(data->uart_pipe, K_SECONDS(10)); in quectel_lcx6g_resume()
221 ret = modem_chat_run_script(&data->chat, &resume_script); in quectel_lcx6g_resume()
224 modem_pipe_close(data->uart_pipe, K_SECONDS(10)); in quectel_lcx6g_resume()
231 modem_pipe_close(data->uart_pipe, K_SECONDS(10)); in quectel_lcx6g_resume()
242 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_suspend() local
249 ret = modem_chat_run_script(&data->chat, &suspend_script); in quectel_lcx6g_suspend()
256 modem_pipe_close(data->uart_pipe, K_SECONDS(10)); in quectel_lcx6g_suspend()
267 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_turn_off() local
271 return modem_pipe_close(data->uart_pipe, K_SECONDS(10)); in quectel_lcx6g_turn_off()
311 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_set_fix_rate() local
320 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_set_fix_rate()
326 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_set_fix_rate()
331 ret = gnss_nmea0183_snprintk(data->pair_match_buf, sizeof(data->pair_match_buf), in quectel_lcx6g_set_fix_rate()
337 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_set_fix_rate()
342 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_set_fix_rate()
355 struct quectel_lcx6g_data *data = user_data; in quectel_lcx6g_get_fix_rate_callback() local
366 data->fix_rate_response = (uint16_t)tmp; in quectel_lcx6g_get_fix_rate_callback()
371 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_get_fix_rate() local
376 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_get_fix_rate()
382 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_get_fix_rate()
387 strncpy(data->pair_match_buf, "$PAIR051,", sizeof(data->pair_match_buf)); in quectel_lcx6g_get_fix_rate()
388 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_get_fix_rate()
393 modem_chat_match_set_callback(&data->pair_match, quectel_lcx6g_get_fix_rate_callback); in quectel_lcx6g_get_fix_rate()
394 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_get_fix_rate()
395 modem_chat_match_set_callback(&data->pair_match, NULL); in quectel_lcx6g_get_fix_rate()
400 *fix_interval_ms = data->fix_rate_response; in quectel_lcx6g_get_fix_rate()
410 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_set_navigation_mode() local
434 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_set_navigation_mode()
440 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_set_navigation_mode()
445 ret = gnss_nmea0183_snprintk(data->pair_match_buf, sizeof(data->pair_match_buf), in quectel_lcx6g_set_navigation_mode()
451 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_set_navigation_mode()
456 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_set_navigation_mode()
469 struct quectel_lcx6g_data *data = user_data; in quectel_lcx6g_get_nav_mode_callback() local
482 data->navigation_mode_response = GNSS_NAVIGATION_MODE_LOW_DYNAMICS; in quectel_lcx6g_get_nav_mode_callback()
486 data->navigation_mode_response = GNSS_NAVIGATION_MODE_ZERO_DYNAMICS; in quectel_lcx6g_get_nav_mode_callback()
490 data->navigation_mode_response = GNSS_NAVIGATION_MODE_HIGH_DYNAMICS; in quectel_lcx6g_get_nav_mode_callback()
494 data->navigation_mode_response = GNSS_NAVIGATION_MODE_BALANCED_DYNAMICS; in quectel_lcx6g_get_nav_mode_callback()
502 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_get_navigation_mode() local
507 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_get_navigation_mode()
513 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_get_navigation_mode()
518 strncpy(data->pair_match_buf, "$PAIR081,", sizeof(data->pair_match_buf)); in quectel_lcx6g_get_navigation_mode()
519 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_get_navigation_mode()
524 modem_chat_match_set_callback(&data->pair_match, quectel_lcx6g_get_nav_mode_callback); in quectel_lcx6g_get_navigation_mode()
525 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_get_navigation_mode()
526 modem_chat_match_set_callback(&data->pair_match, NULL); in quectel_lcx6g_get_navigation_mode()
531 *mode = data->navigation_mode_response; in quectel_lcx6g_get_navigation_mode()
540 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_set_enabled_systems() local
553 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_set_enabled_systems()
564 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_set_enabled_systems()
569 ret = gnss_nmea0183_snprintk(data->pair_match_buf, sizeof(data->pair_match_buf), in quectel_lcx6g_set_enabled_systems()
575 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_set_enabled_systems()
580 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_set_enabled_systems()
585 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_set_enabled_systems()
591 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_set_enabled_systems()
596 ret = gnss_nmea0183_snprintk(data->pair_match_buf, sizeof(data->pair_match_buf), in quectel_lcx6g_set_enabled_systems()
602 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_set_enabled_systems()
607 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_set_enabled_systems()
625 struct quectel_lcx6g_data *data = user_data; in quectel_lcx6g_get_search_mode_callback() local
631 data->enabled_systems_response = search_mode_enabled(argv[1]) ? GNSS_SYSTEM_GPS : 0; in quectel_lcx6g_get_search_mode_callback()
632 data->enabled_systems_response |= search_mode_enabled(argv[2]) ? GNSS_SYSTEM_GLONASS : 0; in quectel_lcx6g_get_search_mode_callback()
633 data->enabled_systems_response |= search_mode_enabled(argv[3]) ? GNSS_SYSTEM_GALILEO : 0; in quectel_lcx6g_get_search_mode_callback()
634 data->enabled_systems_response |= search_mode_enabled(argv[4]) ? GNSS_SYSTEM_BEIDOU : 0; in quectel_lcx6g_get_search_mode_callback()
635 data->enabled_systems_response |= search_mode_enabled(argv[5]) ? GNSS_SYSTEM_QZSS : 0; in quectel_lcx6g_get_search_mode_callback()
641 struct quectel_lcx6g_data *data = user_data; in quectel_lcx6g_get_sbas_status_callback() local
647 data->enabled_systems_response |= ('1' == argv[1][0]) ? GNSS_SYSTEM_SBAS : 0; in quectel_lcx6g_get_sbas_status_callback()
653 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_get_enabled_systems() local
658 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_get_enabled_systems()
664 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_get_enabled_systems()
669 strncpy(data->pair_match_buf, "$PAIR067,", sizeof(data->pair_match_buf)); in quectel_lcx6g_get_enabled_systems()
670 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_get_enabled_systems()
675 modem_chat_match_set_callback(&data->pair_match, quectel_lcx6g_get_search_mode_callback); in quectel_lcx6g_get_enabled_systems()
676 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_get_enabled_systems()
677 modem_chat_match_set_callback(&data->pair_match, NULL); in quectel_lcx6g_get_enabled_systems()
682 ret = gnss_nmea0183_snprintk(data->pair_request_buf, sizeof(data->pair_request_buf), in quectel_lcx6g_get_enabled_systems()
688 ret = modem_chat_script_chat_set_request(&data->pair_script_chat, data->pair_request_buf); in quectel_lcx6g_get_enabled_systems()
693 strncpy(data->pair_match_buf, "$PAIR411,", sizeof(data->pair_match_buf)); in quectel_lcx6g_get_enabled_systems()
694 ret = modem_chat_match_set_match(&data->pair_match, data->pair_match_buf); in quectel_lcx6g_get_enabled_systems()
699 modem_chat_match_set_callback(&data->pair_match, quectel_lcx6g_get_sbas_status_callback); in quectel_lcx6g_get_enabled_systems()
700 ret = modem_chat_run_script(&data->chat, &data->pair_script); in quectel_lcx6g_get_enabled_systems()
701 modem_chat_match_set_callback(&data->pair_match, NULL); in quectel_lcx6g_get_enabled_systems()
706 *systems = data->enabled_systems_response; in quectel_lcx6g_get_enabled_systems()
732 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_init_nmea0183_match() local
737 .satellites = data->satellites, in quectel_lcx6g_init_nmea0183_match()
738 .satellites_size = ARRAY_SIZE(data->satellites), in quectel_lcx6g_init_nmea0183_match()
742 return gnss_nmea0183_match_init(&data->match_data, &config); in quectel_lcx6g_init_nmea0183_match()
748 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_init_pipe() local
752 .receive_buf = data->uart_backend_receive_buf, in quectel_lcx6g_init_pipe()
753 .receive_buf_size = ARRAY_SIZE(data->uart_backend_receive_buf), in quectel_lcx6g_init_pipe()
754 .transmit_buf = data->uart_backend_transmit_buf, in quectel_lcx6g_init_pipe()
755 .transmit_buf_size = ARRAY_SIZE(data->uart_backend_transmit_buf), in quectel_lcx6g_init_pipe()
758 data->uart_pipe = modem_backend_uart_init(&data->uart_backend, &uart_backend_config); in quectel_lcx6g_init_pipe()
763 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_init_chat() local
766 .user_data = data, in quectel_lcx6g_init_chat()
767 .receive_buf = data->chat_receive_buf, in quectel_lcx6g_init_chat()
768 .receive_buf_size = ARRAY_SIZE(data->chat_receive_buf), in quectel_lcx6g_init_chat()
769 .delimiter = data->chat_delimiter, in quectel_lcx6g_init_chat()
770 .delimiter_size = ARRAY_SIZE(data->chat_delimiter), in quectel_lcx6g_init_chat()
773 .argv = data->chat_argv, in quectel_lcx6g_init_chat()
774 .argv_size = ARRAY_SIZE(data->chat_argv), in quectel_lcx6g_init_chat()
779 return modem_chat_init(&data->chat, &chat_config); in quectel_lcx6g_init_chat()
784 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_init_pair_script() local
786 modem_chat_match_init(&data->pair_match); in quectel_lcx6g_init_pair_script()
787 modem_chat_match_set_separators(&data->pair_match, ",*"); in quectel_lcx6g_init_pair_script()
789 modem_chat_script_chat_init(&data->pair_script_chat); in quectel_lcx6g_init_pair_script()
790 modem_chat_script_chat_set_response_matches(&data->pair_script_chat, in quectel_lcx6g_init_pair_script()
791 &data->pair_match, 1); in quectel_lcx6g_init_pair_script()
793 modem_chat_script_init(&data->pair_script); in quectel_lcx6g_init_pair_script()
794 modem_chat_script_set_name(&data->pair_script, "pair"); in quectel_lcx6g_init_pair_script()
795 modem_chat_script_set_script_chats(&data->pair_script, &data->pair_script_chat, 1); in quectel_lcx6g_init_pair_script()
796 modem_chat_script_set_abort_matches(&data->pair_script, NULL, 0); in quectel_lcx6g_init_pair_script()
797 modem_chat_script_set_timeout(&data->pair_script, 10); in quectel_lcx6g_init_pair_script()
802 struct quectel_lcx6g_data *data = dev->data; in quectel_lcx6g_init() local
805 k_sem_init(&data->lock, 1, 1); in quectel_lcx6g_init()
846 static struct quectel_lcx6g_data LCX6G_INST_NAME(inst, data) = { \
853 &LCX6G_INST_NAME(inst, data), &LCX6G_INST_NAME(inst, config), \