use atat::atat_derive::AtatCmd;
use responses::{GnssAsssitance, GnssCloudServerName, GnssConfig, GnssTimeout};
use types::{
AcquisitionMode, FixSensitivity, GnssAssitanceType, LocationMode, ProgramGnssAction,
UrcNotificationSetting,
};
use crate::gnss::types::QuotedF32;
use super::{Bool, NoResponse, Reserved};
pub mod responses;
pub mod types;
pub mod urc;
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSCFG?", GnssConfig)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GetGnssConfig;
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSCFG", NoResponse)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SetApproximatePositionAssitance {
#[at_arg(position = 0)]
pub lat: QuotedF32,
#[at_arg(position = 1)]
pub long: QuotedF32,
#[at_arg(position = 2)]
pub elev: Option<QuotedF32>,
}
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSCFG", NoResponse)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SetGnssConfig {
#[at_arg(position = 0)]
pub location_mode: LocationMode,
#[at_arg(position = 1)]
pub fix_sensitivity: FixSensitivity,
#[at_arg(position = 2)]
pub urc_settings: UrcNotificationSetting,
#[at_arg(position = 3)]
pub reserved: Reserved,
#[at_arg(position = 4)]
pub metrics: Bool,
#[at_arg(position = 5)]
pub acquisition_mode: AcquisitionMode,
#[at_arg(position = 6)]
pub early_abort: Bool,
}
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSASSISTANCE", NoResponse)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct UpdateGnssAssitance {
#[at_arg(position = 0)]
pub typ: GnssAssitanceType,
}
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSASSISTANCE?", heapless::Vec<GnssAsssitance, 3>)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GetGnssAssitance;
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSFIXPROG", NoResponse)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct ProgramGnss {
#[at_arg(position = 0, len = 8)]
pub action: ProgramGnssAction,
}
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSCLOUDSEL", NoResponse)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SetGnssCloudServerName<'a> {
#[at_arg(position = 0, len = 256)]
pub hostname: &'a str,
}
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSCLOUDSEL?", GnssCloudServerName)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GetGnssCloudServerName;
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSTIMEOUT", NoResponse)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct SetGnssTimeout {
#[at_arg(position = 0)]
pub timeout: u32,
}
#[derive(Clone, AtatCmd)]
#[at_cmd("+LPGNSSTIMEOUT?", GnssTimeout)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
pub struct GetGnssTimeout;