mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 09:18:54 -05:00
Upgrade rescuesdriq tool to new header spec
This commit is contained in:
parent
e8a8ef6f3d
commit
92027b4511
@ -8,7 +8,7 @@ The header is composed as follows:
|
||||
|
||||
- Sample rate in S/s (4 bytes, 32 bits)
|
||||
- Center frequency in Hz (8 bytes, 64 bits)
|
||||
- Start time Unix timestamp epoch in seconds (8 bytes, 64 bits)
|
||||
- Start time Unix timestamp epoch in milliseconds (8 bytes, 64 bits)
|
||||
- Sample size as 16 or 24 bits (4 bytes, 32 bits)
|
||||
- filler with all zeroes (4 bytes, 32 bits)
|
||||
- CRC32 (IEEE) of the 28 bytes above (4 bytes, 32 bits)
|
||||
|
@ -71,7 +71,7 @@ func printHeader(header *HeaderStd) {
|
||||
fmt.Println("Sample rate:", header.SampleRate)
|
||||
fmt.Println("Frequency :", header.CenterFrequency)
|
||||
fmt.Println("Sample Size:", header.SampleSize)
|
||||
tm := time.Unix(header.StartTimestamp, 0)
|
||||
tm := time.Unix(header.StartTimestamp / 1000, header.StartTimestamp % 1000)
|
||||
fmt.Println("Start :", tm)
|
||||
fmt.Println("CRC32 :", header.CRC32)
|
||||
fmt.Println("CRC32 OK :", GetCRC(header))
|
||||
@ -152,13 +152,13 @@ func main() {
|
||||
if flagSeen["ts"] {
|
||||
t, err := time.Parse(time.RFC3339, *timeStr)
|
||||
if err == nil {
|
||||
headerOrigin.StartTimestamp = t.Unix()
|
||||
headerOrigin.StartTimestamp = t.UnixNano() / int64(time.Millisecond)
|
||||
} else {
|
||||
fmt.Println("Incorrect time specified. Defaulting to now")
|
||||
headerOrigin.StartTimestamp = int64(time.Now().Unix())
|
||||
headerOrigin.StartTimestamp = int64(time.Now().UnixNano() / int64(time.Millisecond))
|
||||
}
|
||||
} else if *timeNow {
|
||||
headerOrigin.StartTimestamp = int64(time.Now().Unix())
|
||||
headerOrigin.StartTimestamp = int64(time.Now().Unix() * 1000)
|
||||
}
|
||||
|
||||
fmt.Println("\nHeader is now")
|
||||
|
Loading…
Reference in New Issue
Block a user