blob: 77cd3311b15e9852fa472f3ed53cbabbc7eea1ab [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001#ifndef __HAL2MNL_INTERFACE_H__
2#define __HAL2MNL_INTERFACE_H__
3
4#include "hal_mnl_interface_common.h"
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10typedef struct {
11 void (*mnld_reboot)();
12
13 void (*location)(gps_location location);
14 void (*gps_status)(gps_status status);
15 void (*gps_sv)(gnss_sv_info sv);
16 void (*nmea)(int64_t timestamp, const char* nmea, int length);
17 void (*gps_capabilities)(gps_capabilites capabilities);
18 void (*gps_measurements)(gps_data data);
19 void (*gps_navigation)(gps_nav_msg msg);
20 void (*gnss_measurements)(gnss_data data);
21 void (*gnss_navigation)(gnss_nav_msg msg);
22
23 void (*request_wakelock)();
24 void (*release_wakelock)();
25
26 void (*request_utc_time)();
27
28 void (*request_data_conn)(struct sockaddr_storage* addr);
29 void (*release_data_conn)();
30 void (*request_ni_notify)(int session_id, agps_notify_type type, const char* requestor_id,
31 const char* client_name, ni_encoding_type requestor_id_encoding,
32 ni_encoding_type client_name_encoding);
33 void (*request_set_id)(request_setid flags);
34 void (*request_ref_loc)(request_refloc flags);
35 void (*output_vzw_debug)(const char* str);
36 void (*update_gnss_name)(const char* name, int length);
37 void (*request_nlp)(bool independentFromGnss);
38} mnl2hal_interface;
39
40int hal2mnl_hal_reboot();
41
42int hal2mnl_gps_init();
43int hal2mnl_gps_start();
44int hal2mnl_gps_stop();
45int hal2mnl_gps_cleanup();
46
47int hal2mnl_gps_inject_time(int64_t time, int64_t time_reference, int uncertainty);
48int hal2mnl_gps_inject_location(double lat, double lng, float acc);
49int hal2mnl_gps_delete_aiding_data(int flags);
50int hal2mnl_gps_set_position_mode(gps_pos_mode mode, gps_pos_recurrence recurrence,
51 int min_interval, int preferred_acc, int preferred_time, bool lowPowerMode);
52
53int hal2mnl_data_conn_open(const char* apn);
54int hal2mnl_data_conn_open_with_apn_ip_type(const char* apn, apn_ip_type ip_type);
55int hal2mnl_data_conn_closed();
56int hal2mnl_data_conn_failed();
57
58int hal2mnl_set_server(agps_type type, const char* hostname, int port);
59int hal2mnl_set_ref_location(cell_type type, int mcc, int mnc, int lac, int cid);
60int hal2mnl_set_id(agps_id_type type, const char* setid);
61
62int hal2mnl_ni_message(char* msg, int len);
63int hal2mnl_ni_respond(int notif_id, ni_user_response_type user_response);
64
65int hal2mnl_update_network_state(int connected, network_type type, int roaming,
66 const char* extra_info);
67int hal2mnl_update_network_availability(int available, const char* apn);
68
69int hal2mnl_set_gps_measurement(bool enabled, bool enableFullTracking);
70int hal2mnl_set_gps_navigation(bool enabled);
71
72int hal2mnl_set_vzw_debug(bool enabled);
73int hal2mnl_update_gnss_config(const char* config_data, int length);
74int hal2mnl_setBlacklist(long long* blacklist, int32_t size);
75
76// -1 means failure
77int mnl2hal_hdlr(int fd, mnl2hal_interface* hdlr);
78
79// -1 means failure
80int create_mnl2hal_fd();
81
82#ifdef __cplusplus
83}
84#endif
85
86#endif
87