@@ -82,13 +82,13 @@ pub enum HostToRotError {
82
82
/// Unexpected command returned
83
83
UnexpectedCommand ,
84
84
/// Error return from the sprot command
85
- SprotError ( SprotError ) ,
85
+ SprotError ( RecvSprotError ) ,
86
86
}
87
87
88
88
#[ derive( Debug , Clone , Copy , PartialEq , Eq , Deserialize , Serialize ) ]
89
89
#[ repr( u32 ) ]
90
90
// Errors returned from the hubris side. This is _so many_
91
- pub enum SprotError {
91
+ pub enum RecvSprotError {
92
92
// protocol
93
93
/// CRC check failed.
94
94
ProtocolInvalidCrc ,
@@ -164,8 +164,8 @@ pub enum RotToHost {
164
164
RotTqSign ,
165
165
}
166
166
167
- impl From < SprotError > for RotToHost {
168
- fn from ( e : SprotError ) -> Self {
167
+ impl From < RecvSprotError > for RotToHost {
168
+ fn from ( e : RecvSprotError ) -> Self {
169
169
RotToHost :: HostToRotError ( HostToRotError :: SprotError ( e) )
170
170
}
171
171
}
@@ -343,139 +343,155 @@ mod tests {
343
343
( HostToRotError :: IncorrectDataLen , [ 4 , 0 , 0 , 0 ] ) ,
344
344
( HostToRotError :: UnexpectedCommand , [ 5 , 0 , 0 , 0 ] ) ,
345
345
(
346
- HostToRotError :: SprotError ( SprotError :: ProtocolInvalidCrc ) ,
346
+ HostToRotError :: SprotError ( RecvSprotError :: ProtocolInvalidCrc ) ,
347
347
[ 6 , 0 , 0 , 0 ] ,
348
348
) ,
349
349
(
350
- HostToRotError :: SprotError ( SprotError :: ProtocolFlowError ) ,
350
+ HostToRotError :: SprotError ( RecvSprotError :: ProtocolFlowError ) ,
351
351
[ 6 , 1 , 0 , 0 ] ,
352
352
) ,
353
353
(
354
354
HostToRotError :: SprotError (
355
- SprotError :: ProtocolUnsupportedProtocol ,
355
+ RecvSprotError :: ProtocolUnsupportedProtocol ,
356
356
) ,
357
357
[ 6 , 2 , 0 , 0 ] ,
358
358
) ,
359
359
(
360
- HostToRotError :: SprotError ( SprotError :: ProtocolBadMessageType ) ,
360
+ HostToRotError :: SprotError (
361
+ RecvSprotError :: ProtocolBadMessageType ,
362
+ ) ,
361
363
[ 6 , 3 , 0 , 0 ] ,
362
364
) ,
363
365
(
364
366
HostToRotError :: SprotError (
365
- SprotError :: ProtocolBadMessageLength ,
367
+ RecvSprotError :: ProtocolBadMessageLength ,
366
368
) ,
367
369
[ 6 , 4 , 0 , 0 ] ,
368
370
) ,
369
371
(
370
- HostToRotError :: SprotError ( SprotError :: ProtocolCannotAssertCSn ) ,
372
+ HostToRotError :: SprotError (
373
+ RecvSprotError :: ProtocolCannotAssertCSn ,
374
+ ) ,
371
375
[ 6 , 5 , 0 , 0 ] ,
372
376
) ,
373
377
(
374
- HostToRotError :: SprotError ( SprotError :: ProtocolTimeout ) ,
378
+ HostToRotError :: SprotError ( RecvSprotError :: ProtocolTimeout ) ,
375
379
[ 6 , 6 , 0 , 0 ] ,
376
380
) ,
377
381
(
378
- HostToRotError :: SprotError ( SprotError :: ProtocolDeserialization ) ,
382
+ HostToRotError :: SprotError (
383
+ RecvSprotError :: ProtocolDeserialization ,
384
+ ) ,
379
385
[ 6 , 7 , 0 , 0 ] ,
380
386
) ,
381
387
(
382
388
HostToRotError :: SprotError (
383
- SprotError :: ProtocolRotIrqRemainsAsserted ,
389
+ RecvSprotError :: ProtocolRotIrqRemainsAsserted ,
384
390
) ,
385
391
[ 6 , 8 , 0 , 0 ] ,
386
392
) ,
387
393
(
388
394
HostToRotError :: SprotError (
389
- SprotError :: ProtocolUnexpectedResponse ,
395
+ RecvSprotError :: ProtocolUnexpectedResponse ,
390
396
) ,
391
397
[ 6 , 9 , 0 , 0 ] ,
392
398
) ,
393
399
(
394
- HostToRotError :: SprotError ( SprotError :: ProtocolBadUpdateStatus ) ,
400
+ HostToRotError :: SprotError (
401
+ RecvSprotError :: ProtocolBadUpdateStatus ,
402
+ ) ,
395
403
[ 6 , 10 , 0 , 0 ] ,
396
404
) ,
397
405
(
398
- HostToRotError :: SprotError ( SprotError :: ProtocolTaskRestarted ) ,
406
+ HostToRotError :: SprotError (
407
+ RecvSprotError :: ProtocolTaskRestarted ,
408
+ ) ,
399
409
[ 6 , 11 , 0 , 0 ] ,
400
410
) ,
401
411
(
402
- HostToRotError :: SprotError ( SprotError :: ProtocolDesynchronized ) ,
412
+ HostToRotError :: SprotError (
413
+ RecvSprotError :: ProtocolDesynchronized ,
414
+ ) ,
403
415
[ 6 , 12 , 0 , 0 ] ,
404
416
) ,
405
417
(
406
- HostToRotError :: SprotError ( SprotError :: SpiBadTransferSize ) ,
418
+ HostToRotError :: SprotError ( RecvSprotError :: SpiBadTransferSize ) ,
407
419
[ 6 , 13 , 0 , 0 ] ,
408
420
) ,
409
421
(
410
- HostToRotError :: SprotError ( SprotError :: SpiTaskRestarted ) ,
422
+ HostToRotError :: SprotError ( RecvSprotError :: SpiTaskRestarted ) ,
411
423
[ 6 , 14 , 0 , 0 ] ,
412
424
) ,
413
425
(
414
- HostToRotError :: SprotError ( SprotError :: UpdateError ) ,
426
+ HostToRotError :: SprotError ( RecvSprotError :: UpdateError ) ,
415
427
[ 6 , 15 , 0 , 0 ] ,
416
428
) ,
417
429
(
418
- HostToRotError :: SprotError ( SprotError :: SprocketsError ) ,
430
+ HostToRotError :: SprotError ( RecvSprotError :: SprocketsError ) ,
419
431
[ 6 , 16 , 0 , 0 ] ,
420
432
) ,
421
433
(
422
- HostToRotError :: SprotError ( SprotError :: WatchdogError ) ,
434
+ HostToRotError :: SprotError ( RecvSprotError :: WatchdogError ) ,
423
435
[ 6 , 17 , 0 , 0 ] ,
424
436
) ,
425
437
(
426
- HostToRotError :: SprotError ( SprotError :: AttestCertTooBig ) ,
438
+ HostToRotError :: SprotError ( RecvSprotError :: AttestCertTooBig ) ,
427
439
[ 6 , 18 , 0 , 0 ] ,
428
440
) ,
429
441
(
430
- HostToRotError :: SprotError ( SprotError :: AttestInvalidCertIndex ) ,
442
+ HostToRotError :: SprotError (
443
+ RecvSprotError :: AttestInvalidCertIndex ,
444
+ ) ,
431
445
[ 6 , 19 , 0 , 0 ] ,
432
446
) ,
433
447
(
434
- HostToRotError :: SprotError ( SprotError :: AttestNoCerts ) ,
448
+ HostToRotError :: SprotError ( RecvSprotError :: AttestNoCerts ) ,
435
449
[ 6 , 20 , 0 , 0 ] ,
436
450
) ,
437
451
(
438
- HostToRotError :: SprotError ( SprotError :: AttestOutOfRange ) ,
452
+ HostToRotError :: SprotError ( RecvSprotError :: AttestOutOfRange ) ,
439
453
[ 6 , 21 , 0 , 0 ] ,
440
454
) ,
441
455
(
442
- HostToRotError :: SprotError ( SprotError :: AttestLogFull ) ,
456
+ HostToRotError :: SprotError ( RecvSprotError :: AttestLogFull ) ,
443
457
[ 6 , 22 , 0 , 0 ] ,
444
458
) ,
445
459
(
446
- HostToRotError :: SprotError ( SprotError :: AttestLogTooBig ) ,
460
+ HostToRotError :: SprotError ( RecvSprotError :: AttestLogTooBig ) ,
447
461
[ 6 , 23 , 0 , 0 ] ,
448
462
) ,
449
463
(
450
- HostToRotError :: SprotError ( SprotError :: AttestTaskRestarted ) ,
464
+ HostToRotError :: SprotError ( RecvSprotError :: AttestTaskRestarted ) ,
451
465
[ 6 , 24 , 0 , 0 ] ,
452
466
) ,
453
467
(
454
- HostToRotError :: SprotError ( SprotError :: AttestBadLease ) ,
468
+ HostToRotError :: SprotError ( RecvSprotError :: AttestBadLease ) ,
455
469
[ 6 , 25 , 0 , 0 ] ,
456
470
) ,
457
471
(
458
472
HostToRotError :: SprotError (
459
- SprotError :: AttestUnsupportedAlgorithm ,
473
+ RecvSprotError :: AttestUnsupportedAlgorithm ,
460
474
) ,
461
475
[ 6 , 26 , 0 , 0 ] ,
462
476
) ,
463
477
(
464
- HostToRotError :: SprotError ( SprotError :: AttestSerializeLog ) ,
478
+ HostToRotError :: SprotError ( RecvSprotError :: AttestSerializeLog ) ,
465
479
[ 6 , 27 , 0 , 0 ] ,
466
480
) ,
467
481
(
468
482
HostToRotError :: SprotError (
469
- SprotError :: AttestSerializeSignature ,
483
+ RecvSprotError :: AttestSerializeSignature ,
470
484
) ,
471
485
[ 6 , 28 , 0 , 0 ] ,
472
486
) ,
473
487
(
474
- HostToRotError :: SprotError ( SprotError :: AttestSignatureTooBig ) ,
488
+ HostToRotError :: SprotError (
489
+ RecvSprotError :: AttestSignatureTooBig ,
490
+ ) ,
475
491
[ 6 , 29 , 0 , 0 ] ,
476
492
) ,
477
493
(
478
- HostToRotError :: SprotError ( SprotError :: CommsBufTooSmall ) ,
494
+ HostToRotError :: SprotError ( RecvSprotError :: CommsBufTooSmall ) ,
479
495
[ 6 , 30 , 0 , 0 ] ,
480
496
) ,
481
497
] ;
0 commit comments