@@ -21,19 +21,19 @@ const GET_AT_COMMAND_STATUS = 4;
21
21
22
22
23
23
module . exports = class eSimCommands extends CLICommandBase {
24
- constructor ( ) { // TODO: Bring ui class
25
- super ( ) ;
26
- spinnerMixin ( this ) ;
24
+ constructor ( ) { // TODO: Bring ui class
25
+ super ( ) ;
26
+ spinnerMixin ( this ) ;
27
27
this . serial = new SerialCommand ( ) ;
28
28
this . lpa = null ;
29
29
this . inputJson = null ;
30
30
this . inputJsonData = null ;
31
31
this . outputJson = null ;
32
32
this . downloadedProfiles = [ ] ;
33
33
this . verbose = false ;
34
- }
34
+ }
35
35
36
- async provisionCommand ( args ) {
36
+ async provisionCommand ( args ) {
37
37
this . verbose = true ;
38
38
this . _validateArgs ( args ) ;
39
39
@@ -46,7 +46,7 @@ module.exports = class eSimCommands extends CLICommandBase {
46
46
throw new Error ( errorMessage ) ;
47
47
}
48
48
await this . doProvision ( devices [ 0 ] , { verbose : true } ) ;
49
- }
49
+ }
50
50
51
51
async bulkProvisionCommand ( args ) {
52
52
this . _validateArgs ( args ) ;
@@ -72,9 +72,7 @@ module.exports = class eSimCommands extends CLICommandBase {
72
72
const platform = platformForId ( device . specs . productId ) . name ;
73
73
const port = device . port ;
74
74
75
- if ( verbose ) {
76
- console . log ( `${ os . EOL } Provisioning device ${ device . deviceId } with platform ${ platform } ` ) ;
77
- }
75
+ provisionOutputLogs . push ( `${ os . EOL } Provisioning device ${ device . deviceId } with platform ${ platform } ` ) ;
78
76
79
77
// Flash firmware and retrieve EID
80
78
const flashResp = await this . _flashATPassThroughFirmware ( device , platform , port ) ;
@@ -106,7 +104,6 @@ module.exports = class eSimCommands extends CLICommandBase {
106
104
}
107
105
const eid = eidResp . eid ;
108
106
provisionOutputLogs . push ( `EID: ${ eid } ` ) ;
109
- console . log ( 'EID : ' , eid ) ;
110
107
111
108
const matchingEsim = this . inputJsonData . provisioning_data . find ( item => item . esim_id === eid ) ;
112
109
const iccidFromJson = matchingEsim . profiles . map ( ( profile ) => profile . iccid ) ;
@@ -348,7 +345,7 @@ module.exports = class eSimCommands extends CLICommandBase {
348
345
}
349
346
} catch ( error ) {
350
347
// Ignore
351
- console . log ( '[dbg] error: ' , error ) ;
348
+ logAndPush ( `Error during AT-OK check: ${ error . message } ` ) ;
352
349
}
353
350
354
351
if ( ! atOkReceived ) {
@@ -497,8 +494,8 @@ module.exports = class eSimCommands extends CLICommandBase {
497
494
console . log ( '[dbg] result: ' , result ) ;
498
495
const timeTaken = ( ( Date . now ( ) - startTime ) / 1000 ) . toFixed ( 2 ) ;
499
496
500
- logAndPush ( result . stdout ) ;
501
497
if ( result . stdout . includes ( 'Profile successfully downloaded' ) ) {
498
+ // logAndPush(result.stdout);
502
499
logAndPush ( `\n\tProfile ${ provider } successfully downloaded in ${ timeTaken } sec` ) ;
503
500
downloadedProfiles . push ( {
504
501
status : "success" ,
@@ -508,6 +505,7 @@ module.exports = class eSimCommands extends CLICommandBase {
508
505
} ) ;
509
506
} else {
510
507
logAndPush ( `\n\tProfile download failed for ${ provider } ` ) ;
508
+ logAndPush ( result . stdout ) ;
511
509
overallSuccess = false ;
512
510
downloadedProfiles . push ( {
513
511
status : "failed" ,
0 commit comments