Skip to content

Commit 14c64ce

Browse files
committed
screen.ts: tryToSend removing timeout, acks and repeats for now
1 parent e0edf72 commit 14c64ce

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

screen.ts

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,30 +71,27 @@ namespace user_interface_base {
7171
}
7272

7373
public static tryToSend(data: Buffer | String) {
74-
let received = false;
75-
radio.onReceivedString((s: String) => {
76-
basic.showString("R")
77-
if (s == "ACK")
78-
received = true;
79-
})
80-
81-
// let i = 0;
82-
let timePassed = 0;
83-
while (!received) {
84-
if (timePassed % 100 == 0) {
85-
if (typeof data == "string") {
86-
radio.sendString(data);
87-
} else {
88-
// basic.showNumber(i)
89-
// i++;
90-
radio.sendBuffer(data as Buffer);
91-
}
92-
}
93-
timePassed += 10;
94-
basic.pause(10)
74+
// let received = false;
75+
// radio.onReceivedString((s: String) => {
76+
// basic.showString("R")
77+
// if (s == "ACK")
78+
// received = true;
79+
// })
80+
//
81+
// let timePassed = 0;
82+
// while (!received) {
83+
// if (timePassed % 100 == 0) {
84+
if (typeof data == "string") {
85+
radio.sendString(data);
86+
} else {
87+
radio.sendBuffer(data as Buffer);
9588
}
96-
97-
radio.onReceivedString((_: String) => { }); // Reset
89+
// }
90+
// timePassed += 10;
91+
// basic.pause(10)
92+
// }
93+
//
94+
// radio.onReceivedString((_: String) => { }); // Reset
9895
}
9996

10097
public static getBuffer(bitmap: Bitmap, chunkIndex: number, chunkSize: number): Buffer {

0 commit comments

Comments
 (0)