forked from rene0/dcf77pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdecode_alarm.h
39 lines (34 loc) · 978 Bytes
/
decode_alarm.h
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
// Copyright 2013-2018 René Ladan
// SPDX-License-Identifier: BSD-2-Clause
#ifndef DCF77PI_DECODE_ALARM_H
#define DCF77PI_DECODE_ALARM_H
/**
* Structure for the (defunct) German civil warning system
*
* confirmed by "Vortrag INS Bevoelkerungswarnung Hannovermesse 2008.pdf"
* (c) 2008 DIN e.V.
* With permission from Mr. Karl Wenzelewski of DIN
*/
struct alm {
struct {
unsigned r1, r2, r3, r4;
} region[2];
struct {
unsigned ps, pl;
} parity[2];
};
/**
* Decode the alarm buffer into the various fields of "struct alm"
*
* @param civbuf The input buffer containing the civil alarm.
* @param alarm The structure containing the decoded values.
*/
void decode_alarm(const unsigned civbuf[], struct alm * const alarm);
/**
* Determines the name of the region which the alarm is broadcasted for.
*
* @param alarm The structure containing the alarm information.
* @return The region name.
*/
const char * const get_region_name(struct alm alarm);
#endif