File tree 3 files changed +29
-29
lines changed
3 files changed +29
-29
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,33 @@ export default class BoardConfiguration {
140
140
return storing . finally ( ( ) => this . serialMessagesSubscription . unsubscribe ( ) ) ;
141
141
}
142
142
143
+ uploadSketch ( compiledSketch , board ) {
144
+ const uploadTarget = {
145
+ board : board . fqbn ,
146
+ port : board . port ,
147
+ network : false
148
+ } ;
149
+
150
+ const file = {
151
+ name : compiledSketch . name + board . upload [ 0 ] . ext ,
152
+ data : compiledSketch . hex
153
+ } ;
154
+
155
+ const uploadData = {
156
+ files : [ file ] ,
157
+ commandline : board . upload [ 0 ] . commandline ,
158
+ signature : board . upload [ 0 ] . options . signature ,
159
+ extrafiles : [ ] ,
160
+ options : {
161
+ wait_for_upload_port : ( board . upload [ 0 ] . options . wait_for_upload_port === true || board . upload [ 0 ] . options . wait_for_upload_port === 'true' ) ,
162
+ use_1200bps_touch : ( board . upload [ 0 ] . options . use_1200bps_touch === true || board . upload [ 0 ] . options . use_1200bps_touch === 'true' ) ,
163
+ params_verbose : '-v'
164
+ }
165
+ } ;
166
+
167
+ this . daemon . upload ( uploadTarget , uploadData ) ;
168
+ }
169
+
143
170
/**
144
171
* Uploads the sketch and performs action in order to configure the board for Arduino Cloud
145
172
* @param {Object } compiledSketch the Object containing the provisioning sketch, ready to be compiled
@@ -218,6 +245,6 @@ export default class BoardConfiguration {
218
245
} ) ;
219
246
220
247
this . daemon . initUpload ( ) ;
221
- this . daemon . uploadSketch ( compiledSketch , board ) ;
248
+ this . uploadSketch ( compiledSketch , board ) ;
222
249
}
223
250
}
Original file line number Diff line number Diff line change @@ -94,33 +94,6 @@ export default class Daemon {
94
94
throw new Error ( 'Stop Upload not supported on Chrome OS' ) ;
95
95
}
96
96
97
- uploadSketch ( compiledSketch , board ) {
98
- const uploadTarget = {
99
- board : board . fqbn ,
100
- port : board . port ,
101
- network : false
102
- } ;
103
-
104
- const file = {
105
- name : compiledSketch . name + board . upload [ 0 ] . ext ,
106
- data : compiledSketch . hex
107
- } ;
108
-
109
- const uploadData = {
110
- files : [ file ] ,
111
- commandline : board . upload [ 0 ] . commandline ,
112
- signature : board . upload [ 0 ] . options . signature ,
113
- extrafiles : [ ] ,
114
- options : {
115
- wait_for_upload_port : ( board . upload [ 0 ] . options . wait_for_upload_port === true || board . upload [ 0 ] . options . wait_for_upload_port === 'true' ) ,
116
- use_1200bps_touch : ( board . upload [ 0 ] . options . use_1200bps_touch === true || board . upload [ 0 ] . options . use_1200bps_touch === 'true' ) ,
117
- params_verbose : '-v'
118
- }
119
- } ;
120
-
121
- this . upload ( uploadTarget , uploadData ) ;
122
- }
123
-
124
97
initUpload ( ) {
125
98
this . uploading . next ( { status : this . UPLOAD_NOPE } ) ;
126
99
}
Original file line number Diff line number Diff line change @@ -34,5 +34,5 @@ import BoardConfiguration from './boardConfiguration';
34
34
35
35
const Daemon = window . navigator . userAgent . indexOf ( ' CrOS ' ) !== - 1 ? ChromeOsDaemon : SocketDaemon ;
36
36
37
- export { BoardConfiguration } ;
37
+ export { Daemon , BoardConfiguration } ;
38
38
export default Daemon ;
You can’t perform that action at this time.
0 commit comments