~aleteoryx/muditaos

ref: 1a6ea1f4b3eb85b3c3018ecf51016cb35d5172cb muditaos/test/phone_send_sms.py -rw-r--r-- 754 bytes
1a6ea1f4 — Alek Rudnik [EGD-4205] mudita 1st audio assets (#940) 5 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/python3
# Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

# get to sms from desktop and send sms ABC

import json
from harness.uart import conn, log

def cmd_json(data):
    ret = {}
    try:
        ret = json.loads(data)
    except Exception as ex:
        print(ex)
    return ret

# get in sms
conn.key(ord('d'), 0.3)
conn.key(ord('d'), 0.3)
conn.key(ord('\n'), 0.3)
data = cmd_json(conn.read(4))
log.info(data)

# select nevest thread
conn.key(ord('\n'), 3)

# add sms ABC
# writeKey(ser, 1, 0.3)
conn.key(2, 3) # wait 3 sec -> so that needed assets for text processing would load bufor 100%
conn.key(3, 0.5)
conn.key(4, 0.5)

#send
conn.key(ord('\n'), 0.3)