generated from OSGP/gxf-service-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from OSGP/feature/FDP-2306
FDP-2306: handle failure urcs better
- Loading branch information
Showing
8 changed files
with
145 additions
and
424 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
application/src/main/kotlin/org/gxf/crestdeviceservice/coap/PskErrorUrc.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-FileCopyrightText: Contributors to the GXF project | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.gxf.crestdeviceservice.coap | ||
|
||
enum class PskErrorUrc(val code: String, val message: String) { | ||
PSK_EQER("PSK:EQER", "Set PSK does not equal earlier PSK"), | ||
PSK_DLNA("PSK:DLNA", "Downlink not allowed"), | ||
PSK_DLER("PSK:DLER", "Downlink (syntax) error"), | ||
PSK_HSER("PSK:HSER", "SHA256 hash error"), | ||
PSK_CSER("PSK:CSER", "Checksum error"); | ||
|
||
companion object { | ||
fun messageFromCode(code: String): String { | ||
val error = entries.firstOrNull { it.code == code } | ||
return error?.message ?: "Unknown URC" | ||
} | ||
|
||
fun isPskErrorURC(code: String) = entries.any { it.code == code } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.