Skip to content

Commit

Permalink
Update status code for sensitive sensor routine
Browse files Browse the repository at this point in the history
  • Loading branch information
BaiiYuan committed Jun 14, 2024
1 parent b5dc8ea commit 3fdf94f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,20 @@ No codes are defined for Floating Point Accuracy.
| **`0x0000002`** | Signal strength routine did not run. | `1.4.0` |

#### Sensitive Sensor
| Code | Status message | Released in `dpsl` version |
| --------------- | ------------------------------------------------- | -------------------------- |
| `0x0280001` | Routine failed. | `1.4.1` |
| `0x0280002` | Routine failed to complete existence check. | `1.4.1` |
| **`0x0000002`** | Unexpected flow in routine. | `1.4.1` |
| **`0x0000002`** | Routine failed to initialize sensor devices. | `1.4.1` |
| **`0x0000002`** | Routine failed to set frequency. | `1.4.1` |
| **`0x0000002`** | Routine failed to get required channels. | `1.4.1` |
| **`0x0000002`** | Routine failed to set channels enabled. | `1.4.1` |
| **`0x0000002`** | Observer error occurred while reading sample. | `1.4.1` |
| **`0x0000002`** | Mojo connection lost. | `1.4.1` |
| **`0x0000002`** | Routine failed to read sample from sensor device. | `1.4.1` |

(Legacy status codes used before M128)
| Code | Status message | Released in `dpsl` version |
| --------------- | ------------------------------------------------------------ | -------------------------- |
| `0x0280001` | Sensitive sensor routine failed to pass all sensors. | `1.4.0` |
Expand Down
10 changes: 10 additions & 0 deletions src/status_codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,20 @@ function getStatusCodeForPrimeSearch(routineStatus) {
function getStatusCodeForSensitiveSensor(routineStatus) {
switch (routineStatus.status_message) {
case 'Sensitive sensor routine failed to pass all sensors.':
case 'Routine failed.':
return 0x0280001;
case 'Sensitive sensor routine failed to pass configuration check.':
case 'Routine failed to complete existence check.':
return 0x0280002;
case 'Sensitive sensor routine failed unexpectedly.':
case 'Unexpected flow in routine.':
case 'Routine failed to initialize sensor devices.':
case 'Routine failed to set frequency.':
case 'Routine failed to get required channels.':
case 'Routine failed to set channels enabled.':
case 'Observer error occurred while reading sample.':
case 'Mojo connection lost.':
case 'Routine failed to read sample from sensor device.':
return CODE_ROUTINE_EXCEPTION;
default:
return undefined;
Expand Down

0 comments on commit 3fdf94f

Please sign in to comment.