2022-08-02 14:05:31 +00:00
|
|
|
import logging
|
2022-09-24 11:30:19 +00:00
|
|
|
import os
|
2023-05-03 05:48:49 +00:00
|
|
|
import subprocess
|
2022-09-24 11:30:19 +00:00
|
|
|
import sys
|
2022-08-02 14:05:31 +00:00
|
|
|
|
2023-05-03 05:48:49 +00:00
|
|
|
from flipper.utils.cdc import resolve_port
|
|
|
|
|
2022-08-02 14:05:31 +00:00
|
|
|
|
|
|
|
def main():
|
|
|
|
logger = logging.getLogger()
|
|
|
|
if not (port := resolve_port(logger, "auto")):
|
2023-06-06 18:18:24 +00:00
|
|
|
logger.error("Is Flipper connected via USB and not in DFU mode?")
|
2022-08-02 14:05:31 +00:00
|
|
|
return 1
|
2022-09-24 11:30:19 +00:00
|
|
|
subprocess.call(
|
|
|
|
[
|
|
|
|
os.path.basename(sys.executable),
|
|
|
|
"-m",
|
|
|
|
"serial.tools.miniterm",
|
|
|
|
"--raw",
|
|
|
|
port,
|
|
|
|
"230400",
|
|
|
|
]
|
|
|
|
)
|
2022-08-02 14:05:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|