File tree Expand file tree Collapse file tree 1 file changed +3
-27
lines changed
Expand file tree Collapse file tree 1 file changed +3
-27
lines changed Original file line number Diff line number Diff line change @@ -121,41 +121,17 @@ namespace user_interface_base {
121121 const numberOfChunks : number =
122122 ( bitmap . height * bitmap . width ) / maxPacketBufferSize ;
123123
124- // Send bitmap meta-data :
124+ // Send bitmap size information :
125125 radio . sendString ( "" + maxPacketBufferSize + "," + bitmap . width + "," + bitmap . height ) ;
126-
127- // this.waitForAck();
128-
129-
130- let received = false ;
131- radio . onReceivedString ( ( _ : String ) => {
132- received = true ;
133- } )
134-
135- while ( ! received ) {
136- basic . pause ( 3 )
137- }
126+ this . waitForAck ( ) ;
138127
139128 // Send a chunk of the bitmap and wait for ACK, RX will rebuild the bitmap:
140129 for ( let j = 0 ; j < numberOfChunks ; j ++ ) {
141130 const rowBuffer = this . getBuffer ( bitmap , j , maxPacketBufferSize ) ;
142131 radio . sendBuffer ( rowBuffer ) ;
143132
144- // this.waitForAck();
145-
146- // basic.showString("A")
147- received = false ;
148- // radio.onReceivedString((_: String) => {
149- // received = true;
150- // })
151-
152- while ( ! received ) {
153- basic . pause ( 3 )
154- }
155- basic . showString ( "D" )
133+ this . waitForAck ( ) ;
156134 }
157-
158- // basic.showString("D")
159135 }
160136
161137
You can’t perform that action at this time.
0 commit comments