blob: a5e4344e5c11327fcb2cbf1244502f67123ff4bc [file] [log] [blame]
Sylvain Munaut341542b2009-12-22 21:53:22 +01001/*
2 * rrlp.h
3 *
4 * RRLP Header
5 *
6 *
7 * Copyright (C) 2009 Sylvain Munaut <tnt@246tNt.com>
8 *
9 * This program is free software: you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation, either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 */
22
23#ifndef __RRLP_H__
24#define __RRLP_H__
25
26#include <stdint.h>
27
28#include "gps.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34
35/* Our internal simplified structure for requests */
36
37#define RRLP_AR_REF_LOC (1<<0)
38#define RRLP_AR_REF_TIME (1<<1)
39#define RRLP_AR_UTC_MODEL (1<<2)
40#define RRLP_AR_IONO_MODEL (1<<3)
41#define RRLP_AR_ALMANAC (1<<4)
42#define RRLP_AR_EPHEMERIS (1<<5)
43
44struct rrlp_assist_req {
45 uint32_t req_elems;
46 uint64_t eph_svs;
47};
48
49
50/* Methods */
51int rrlp_decode_assistance_request(struct rrlp_assist_req *ar,
52 void *req, int req_len);
53
54int rrlp_gps_assist_pdus(
55 struct gps_assist_data *gps_ad, struct rrlp_assist_req *req,
56 void **o_pdu, int *o_len, int o_max_pdus);
57
58
59#ifdef __cplusplus
60}
61#endif
62
63#endif /* __RRLP_H__ */
64