/*
 * Copyright (c) 2023 PMD Device Solutions Ltd
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef MODEM_NRF9160_SLM_H_
#define MODEM_NRF9160_SLM_H_

#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C" {
#endif

#define NRF9160_SLM_MDM_MANUFACTURER_LENGTH  10
#define NRF9160_SLM_MDM_MODEL_LENGTH         16
#define NRF9160_SLM_MDM_REVISION_LENGTH      64
#define NRF9160_SLM_MDM_IMEI_LENGTH          16
#define NRF9160_SLM_MDM_IMSI_LENGTH          16
#define NRF9160_SLM_MDM_ICCID_LENGTH         32

struct nrf9160_slm_modem_info {
	char mdm_manufacturer[NRF9160_SLM_MDM_MANUFACTURER_LENGTH];
	char mdm_model[NRF9160_SLM_MDM_MODEL_LENGTH];
	char mdm_revision[NRF9160_SLM_MDM_REVISION_LENGTH];
	char mdm_imei[NRF9160_SLM_MDM_IMEI_LENGTH];
#if defined(CONFIG_MODEM_SIM_NUMBERS)
	char mdm_imsi[NRF9160_SLM_MDM_IMSI_LENGTH];
	char mdm_iccid[NRF9160_SLM_MDM_ICCID_LENGTH];
#endif
	int  mdm_rssi;
};

struct device;
typedef void (*nrf9160_slm_power_cb)(const struct device */*, void **/);
typedef void (*nrf9160_slm_ready_cb)(const struct device *, int ready/*, void **/);

void nrf9160_slm_start(const struct device *dev);
void nrf9160_slm_stop(const struct device *dev);

/**
 * @brief Register functions callbacks for power modem on/off.
 *
 * @param dev: nrf9160 SLM modem device
 * @param modem_on: callback function to
 *		execute during modem configuring.
 * @param modem_off: callback function to
 *		execute during modem stopping.
 * @param user_data: user specified data
 */
void nrf9160_slm_register_modem_power_callback(const struct device *dev,
					   nrf9160_slm_power_cb modem_on,
					   nrf9160_slm_power_cb modem_off//,
					   /*void *user_data*/);

/**
 * @brief Register functions callbacks for power modem on/off.
 *
 * @param dev: nrf9160 SLM modem device
 * @param modem_ready: callback function to
 *		execute when modem is ready or stops being ready
 * @param user_data: user specified data
 */
void nrf9160_slm_register_modem_ready_callback(const struct device *dev,
					   nrf9160_slm_ready_cb modem_ready//,
					   /*void *user_data*/);

/**
 * @brief Get GSM modem information.
 *
 * @param dev: GSM modem device.
 *
 * @retval struct nrf9160_slm_modem_info * pointer to modem information structure.
 */
const struct nrf9160_slm_modem_info *nrf9160_slm_modem_info(const struct device *dev);


#ifdef __cplusplus
}
#endif

#endif /* MODEM_NRF9160_SLM_H_ */
