You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Turns out it's not that easy.
There are a few problems:
CBOR serialization from Jetbrains does not support non-string keys ISSUE
No support of Number deserialization (for example baseTime and Time could be Long and Double)
If you use Double and Long in Serializable object it wil not be optimized according to actual value (For example if you use value:Long = 1 it will be serialized as Long not as Byte)
Cbor support could be added.
fun ByteArray.toSenmlRecords(): List{
return try {
Cbor {
ignoreUnknownKeys = true
}.decodeFromByteArray(this)
} catch (e: kotlinx.serialization.SerializationException) {
Napier.e { e.message ?: "Unknown exception while deserializing SenML pack" }
emptyList()
}
}
The text was updated successfully, but these errors were encountered: