This is an automated email from the ASF dual-hosted git repository. casaroli pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit f8faa967588facc4de9d0ba422509a39faf67df1 Author: fangpeina <[email protected]> AuthorDate: Fri Oct 30 16:15:02 2026 +0800 system/fastboot: export fastboot_handler as public API Extract the core logic (init transports, poll loop, cleanup) from main() into fastboot_handler,allowing other modules to invoke fastboot synchronously without spawning a separate task. Add include/system/fastboot.h for callers to include instead of hand-written extern declarations. Signed-off-by: fangpeina <[email protected]> Signed-off-by: wangjianyu3 <[email protected]> --- include/system/fastboot.h | 52 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/include/system/fastboot.h b/include/system/fastboot.h new file mode 100644 index 000000000..3091f5c0f --- /dev/null +++ b/include/system/fastboot.h @@ -0,0 +1,52 @@ +/**************************************************************************** + * apps/include/system/fastboot.h + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __APPS_INCLUDE_SYSTEM_FASTBOOT_H +#define __APPS_INCLUDE_SYSTEM_FASTBOOT_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <stdint.h> + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Name: fastboot_handler + * + * Description: + * Run fastboot service synchronously. Initializes all configured + * transports (USB, TCP, Serial) and enters the command loop. + * + * Input Parameters: + * timeout - Maximum wait time in milliseconds. Pass 0 for infinite wait. + * + * Returned Value: + * 0 on success, negative errno on failure (-ETIMEDOUT if timed out). + * + ****************************************************************************/ + +int fastboot_handler(uint64_t timeout); + +#endif /* __APPS_INCLUDE_SYSTEM_FASTBOOT_H */
