mirror of
https://github.com/jwetzell/psn-go.git
synced 2026-08-17 13:23:40 +00:00
32 lines
530 B
Go
32 lines
530 B
Go
package decoders
|
|
|
|
import (
|
|
"encoding/binary"
|
|
"math"
|
|
)
|
|
|
|
type DataTrackerStatusChunkData struct {
|
|
Validity float32
|
|
}
|
|
|
|
type DataTrackerStatusChunk struct {
|
|
Chunk Chunk
|
|
Data DataTrackerStatusChunkData
|
|
}
|
|
|
|
func DecodeDataTrackerStatusChunk(bytes []byte) DataTrackerStatusChunk {
|
|
chunk := DecodeChunk(bytes)
|
|
|
|
statusBits := binary.LittleEndian.Uint32(chunk.ChunkData[0:4])
|
|
|
|
data := DataTrackerStatusChunkData{
|
|
Validity: math.Float32frombits(statusBits),
|
|
}
|
|
|
|
return DataTrackerStatusChunk{
|
|
Chunk: chunk,
|
|
Data: data,
|
|
}
|
|
|
|
}
|