rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | #ifndef __HAL2MNL_INTERFACE_H__ |
| 2 | #define __HAL2MNL_INTERFACE_H__ |
| 3 | |
| 4 | #include "hal_mnl_interface_common.h" |
| 5 | |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" { |
| 8 | #endif |
| 9 | |
| 10 | typedef 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 | |
| 40 | int hal2mnl_hal_reboot(); |
| 41 | |
| 42 | int hal2mnl_gps_init(); |
| 43 | int hal2mnl_gps_start(); |
| 44 | int hal2mnl_gps_stop(); |
| 45 | int hal2mnl_gps_cleanup(); |
| 46 | |
| 47 | int hal2mnl_gps_inject_time(int64_t time, int64_t time_reference, int uncertainty); |
| 48 | int hal2mnl_gps_inject_location(double lat, double lng, float acc); |
| 49 | int hal2mnl_gps_delete_aiding_data(int flags); |
| 50 | int 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 | |
| 53 | int hal2mnl_data_conn_open(const char* apn); |
| 54 | int hal2mnl_data_conn_open_with_apn_ip_type(const char* apn, apn_ip_type ip_type); |
| 55 | int hal2mnl_data_conn_closed(); |
| 56 | int hal2mnl_data_conn_failed(); |
| 57 | |
| 58 | int hal2mnl_set_server(agps_type type, const char* hostname, int port); |
| 59 | int hal2mnl_set_ref_location(cell_type type, int mcc, int mnc, int lac, int cid); |
| 60 | int hal2mnl_set_id(agps_id_type type, const char* setid); |
| 61 | |
| 62 | int hal2mnl_ni_message(char* msg, int len); |
| 63 | int hal2mnl_ni_respond(int notif_id, ni_user_response_type user_response); |
| 64 | |
| 65 | int hal2mnl_update_network_state(int connected, network_type type, int roaming, |
| 66 | const char* extra_info); |
| 67 | int hal2mnl_update_network_availability(int available, const char* apn); |
| 68 | |
| 69 | int hal2mnl_set_gps_measurement(bool enabled, bool enableFullTracking); |
| 70 | int hal2mnl_set_gps_navigation(bool enabled); |
| 71 | |
| 72 | int hal2mnl_set_vzw_debug(bool enabled); |
| 73 | int hal2mnl_update_gnss_config(const char* config_data, int length); |
| 74 | int hal2mnl_setBlacklist(long long* blacklist, int32_t size); |
| 75 | |
| 76 | // -1 means failure |
| 77 | int mnl2hal_hdlr(int fd, mnl2hal_interface* hdlr); |
| 78 | |
| 79 | // -1 means failure |
| 80 | int create_mnl2hal_fd(); |
| 81 | |
| 82 | #ifdef __cplusplus |
| 83 | } |
| 84 | #endif |
| 85 | |
| 86 | #endif |
| 87 | |