* Copyright (C) 2023 Xiaomi Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __APPS_SYSTEM_UORB_LOCATION_LOCATION_H
#define __APPS_SYSTEM_UORB_LOCATION_LOCATION_H
#include <uORB/uORB.h>
#define BSSID_MAX_LENGTH 18
#define SSID_MAX_LENGTH 36
#define MAC_MAX_LENGTH 18
#define WIFI_INFO_MAX_LENGTH 30
#define MCC_MAX_LENGTH 4
#define MNC_MAX_LENGTH 4
#define IMEI_MAX_LENGTH 16
#define SUBSCRIBER_ID_MAX_LENGTH 16
#define PHONE_NUMBER_MAX_LENGTH 16
#define CELL_INFO_MAX_LENGTH 3
#define PHONE_TYPE_NONE 0
#define PHONE_TYPE_GSM 1
#define PHONE_TYPE_CDMA 2
#define PHONE_TYPE_SIP 3
#define NETWORK_TYPE_UNKNOWN 0
#define NETWORK_TYPE_GPRS 1
#define NETWORK_TYPE_EDGE 2
#define NETWORK_TYPE_UMTS 3
#define NETWORK_TYPE_CDMA 4
#define NETWORK_TYPE_EVDO_0 5
#define NETWORK_TYPE_EVDO_A 6
#define NETWORK_TYPE_1XRTT 7
#define NETWORK_TYPE_HSDPA 8
#define NETWORK_TYPE_HSUPA 9
#define NETWORK_TYPE_HSPA 10
#define NETWORK_TYPE_IDEN 11
#define NETWORK_TYPE_EVDO_B 12
#define NETWORK_TYPE_LTE 13
#define NETWORK_TYPE_EHRPD 14
#define NETWORK_TYPE_HSPAP 15
#define NETWORK_TYPE_GSM 16
#define NETWORK_TYPE_TD_SCDMA 17
#define NETWORK_TYPE_IWLAN 18
#define NETWORK_TYPE_LTE_CA 19
#define NETWORK_TYPE_NR 20
struct provider_network_wifiinfo {
char bssid[BSSID_MAX_LENGTH];
char ssid[SSID_MAX_LENGTH];
uint32_t ip_address;
uint32_t rssi;
int8_t is_connected;
};
struct provider_network_cellinfo {
char mcc_string[MCC_MAX_LENGTH];
char mnc_string[MNC_MAX_LENGTH];
int32_t cid;
int32_t lac;
int8_t dbm;
uint8_t is_registered;
};
struct lbs_wifi {
char mac_address[MAC_MAX_LENGTH];
uint32_t wifiinfo_count;
struct provider_network_wifiinfo wifiinfo[WIFI_INFO_MAX_LENGTH];
};
struct lbs_telephony {
uint32_t phone_type;
uint32_t data_network_type;
char imei[IMEI_MAX_LENGTH];
char subscriber_id[SUBSCRIBER_ID_MAX_LENGTH];
char phone_number[PHONE_NUMBER_MAX_LENGTH];
uint32_t cellinfo_count;
struct provider_network_cellinfo cellinfo[CELL_INFO_MAX_LENGTH];
};
ORB_DECLARE(location_network);
ORB_DECLARE(location_fused);
ORB_DECLARE(lbs_wifi);
ORB_DECLARE(lbs_telephony);
#endif