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 @@ -131,6 +131,33 @@ export default class BoardConfiguration {
131
131
return storing . finally ( ( ) => this . serialMessagesSubscription . unsubscribe ( ) ) ;
132
132
}
133
133
134
+ uploadSketch ( compiledSketch , board ) {
135
+ const uploadTarget = {
136
+ board : board . fqbn ,
137
+ port : board . port ,
138
+ network : false
139
+ } ;
140
+
141
+ const file = {
142
+ name : compiledSketch . name + board . upload [ 0 ] . ext ,
143
+ data : compiledSketch . hex
144
+ } ;
145
+
146
+ const uploadData = {
147
+ files : [ file ] ,
148
+ commandline : board . upload [ 0 ] . commandline ,
149
+ signature : board . upload [ 0 ] . options . signature ,
150
+ extrafiles : [ ] ,
151
+ options : {
152
+ wait_for_upload_port : ( board . upload [ 0 ] . options . wait_for_upload_port === true || board . upload [ 0 ] . options . wait_for_upload_port === 'true' ) ,
153
+ use_1200bps_touch : ( board . upload [ 0 ] . options . use_1200bps_touch === true || board . upload [ 0 ] . options . use_1200bps_touch === 'true' ) ,
154
+ params_verbose : '-v'
155
+ }
156
+ } ;
157
+
158
+ this . daemon . upload ( uploadTarget , uploadData ) ;
159
+ }
160
+
134
161
/**
135
162
* Uploads the sketch and performs action in order to configure the board for Arduino Cloud
136
163
* @param {Object } compiledSketch the Object containing the provisioning sketch, ready to be compiled
@@ -209,6 +236,6 @@ export default class BoardConfiguration {
209
236
} ) ;
210
237
211
238
this . daemon . initUpload ( ) ;
212
- this . daemon . uploadSketch ( compiledSketch , board ) ;
239
+ this . uploadSketch ( compiledSketch , board ) ;
213
240
}
214
241
}
Original file line number Diff line number Diff line change @@ -114,33 +114,6 @@ export default class Daemon {
114
114
throw new Error ( 'Stop Upload not supported on Chrome OS' ) ;
115
115
}
116
116
117
- uploadSketch ( compiledSketch , board ) {
118
- const uploadTarget = {
119
- board : board . fqbn ,
120
- port : board . port ,
121
- network : false
122
- } ;
123
-
124
- const file = {
125
- name : compiledSketch . name + board . upload [ 0 ] . ext ,
126
- data : compiledSketch . hex
127
- } ;
128
-
129
- const uploadData = {
130
- files : [ file ] ,
131
- commandline : board . upload [ 0 ] . commandline ,
132
- signature : board . upload [ 0 ] . options . signature ,
133
- extrafiles : [ ] ,
134
- options : {
135
- wait_for_upload_port : ( board . upload [ 0 ] . options . wait_for_upload_port === true || board . upload [ 0 ] . options . wait_for_upload_port === 'true' ) ,
136
- use_1200bps_touch : ( board . upload [ 0 ] . options . use_1200bps_touch === true || board . upload [ 0 ] . options . use_1200bps_touch === 'true' ) ,
137
- params_verbose : '-v'
138
- }
139
- } ;
140
-
141
- this . upload ( uploadTarget , uploadData ) ;
142
- }
143
-
144
117
initUpload ( ) {
145
118
this . uploading . next ( { status : this . UPLOAD_NOPE } ) ;
146
119
}
Original file line number Diff line number Diff line change @@ -25,5 +25,5 @@ import BoardConfiguration from './boardConfiguration';
25
25
26
26
const Daemon = window . navigator . userAgent . indexOf ( ' CrOS ' ) !== - 1 ? ChromeOsDaemon : SocketDaemon ;
27
27
28
- export { BoardConfiguration } ;
28
+ export { Daemon , BoardConfiguration } ;
29
29
export default Daemon ;
You can’t perform that action at this time.
0 commit comments