2022-08-02 17:05:31 +03:00
|
|
|
import logging
|
|
|
|
import subprocess
|
|
|
|
from flipper.utils.cdc import resolve_port
|
2022-09-24 14:30:19 +03:00
|
|
|
import os
|
|
|
|
import sys
|
2022-08-02 17:05:31 +03:00
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
logger = logging.getLogger()
|
|
|
|
if not (port := resolve_port(logger, "auto")):
|
2022-09-24 14:30:19 +03:00
|
|
|
logger.error("Is Flipper connected over USB and isn't 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()
|