File tree Expand file tree Collapse file tree 1 file changed +20
-23
lines changed
Expand file tree Collapse file tree 1 file changed +20
-23
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments