-
Notifications
You must be signed in to change notification settings - Fork 6
/
header.go
59 lines (57 loc) · 2.06 KB
/
header.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
type Header struct {
Version uint32
Filesize uint32
CRC32 uint32
OpenTimestamp uint32
CloseTimestamp uint32
CountryCode uint8
_ [3]byte
LanguageCode uint8
TemperatureFlag uint8
Unknown uint8
_ uint8
MessageOffset uint32
NumberOfLongForecastTables uint32
LongForecastTableOffset uint32
NumberOfShortForecastTables uint32
ShortForecastTableOffset uint32
NumberOfWeatherConditionTables uint32
WeatherConditionTableOffset uint32
NumberOfUVIndexTables uint32
UVIndexTableOffset uint32
NumberOfLaundryIndexTables uint32
LaundryIndexTableOffset uint32
NumberOfPollenCountTables uint32
PollenCountTableOffset uint32
NumberOfLocations uint32
LocationsTableOffset uint32
}
func (f *Forecast) MakeHeader() {
f.Header = Header{
Version: 0,
Filesize: 0,
CRC32: 0,
OpenTimestamp: fixTime(int(currentTime)),
CloseTimestamp: fixTime(int(currentTime)) + 63,
CountryCode: f.currentCountryCode,
LanguageCode: f.currentLanguageCode,
TemperatureFlag: f.GetTemperatureFlag(),
Unknown: 1,
MessageOffset: 0,
NumberOfLongForecastTables: 0,
LongForecastTableOffset: 0,
NumberOfShortForecastTables: 0,
ShortForecastTableOffset: 0,
NumberOfWeatherConditionTables: 0,
WeatherConditionTableOffset: 0,
NumberOfUVIndexTables: 0,
UVIndexTableOffset: 0,
NumberOfLaundryIndexTables: 0,
LaundryIndexTableOffset: 0,
NumberOfPollenCountTables: 0,
PollenCountTableOffset: 0,
NumberOfLocations: 0,
LocationsTableOffset: 0,
}
}