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