Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,28 @@ command_result sync(CommandableIf *t);
* @return OK, FAIL or TIMEOUT
*/
command_result get_operator_name(CommandableIf *t, std::string &name, int &act);
/**
* @brief Read the Restricted (U)SIM Access
* @param[out] data response from the command
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @return OK, FAIL or TIMEOUT
*/
command_result get_restricted_usim_access(CommandableIf *t, std::string &data, int command, int file_id, int p1, int p2, int p3);
/**
* @brief Write the Restricted (U)SIM Access
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @param[in] data data to write
* @return OK, FAIL or TIMEOUT
*/
command_result set_restricted_usim_access(CommandableIf *t, int command, int file_id, int p1, int p2, int p3, const std::string &data);
/**
* @brief Stores current user profile
* @return OK, FAIL or TIMEOUT
Expand Down Expand Up @@ -138,12 +160,24 @@ command_result get_imsi(CommandableIf *t, std::string &imsi);
* @return OK, FAIL or TIMEOUT
*/
command_result get_imei(CommandableIf *t, std::string &imei);
/**
* @brief Reads the ICCID number
* @param[out] iccid SIM's ICCID number
* @return OK, FAIL or TIMEOUT
*/
command_result get_iccid(CommandableIf *t, std::string &iccid);
/**
* @brief Reads the module name
* @param[out] name module name
* @return OK, FAIL or TIMEOUT
*/
command_result get_module_name(CommandableIf *t, std::string &name);
/**
* @brief Reads the module firmware version
* @param[out] firmware module firmware version
* @return OK, FAIL or TIMEOUT
*/
command_result get_module_firmware(CommandableIf *t, std::string &firmware);
/**
* @brief Sets the modem to data mode
* @return OK, FAIL or TIMEOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ class DCE : public DCE_T<GenericModule> {
return device->get_operator_name(name);
}
using DCE_T<GenericModule>::DCE_T;
/**
* @brief Read the Restricted (U)SIM Access
* @param[out] data response from the command
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @return OK, FAIL or TIMEOUT
*/
command_result get_restricted_usim_access(std::string &data, int command, int file_id, int p1, int p2, int p3)
{
return device->get_restricted_usim_access(data, command, file_id, p1, p2, p3);
}
/**
* @brief Write the Restricted (U)SIM Access
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @param[in] data data to write
* @return OK, FAIL or TIMEOUT
*/
command_result set_restricted_usim_access(int command, int file_id, int p1, int p2, int p3, const std::string &data)
{
return device->set_restricted_usim_access(command, file_id, p1, p2, p3, data);
}
/**
* @brief Sends the initial AT sequence to sync up with the device
* @return OK, FAIL or TIMEOUT
Expand Down Expand Up @@ -180,6 +208,15 @@ class DCE : public DCE_T<GenericModule> {
{
return device->get_imei(imei);
}
/**
* @brief Reads the ICCID number
* @param[out] iccid SIM's ICCID number
* @return OK, FAIL or TIMEOUT
*/
command_result get_iccid(std::string &iccid)
{
return device->get_iccid(iccid);
}
/**
* @brief Reads the module name
* @param[out] name module name
Expand All @@ -189,6 +226,15 @@ class DCE : public DCE_T<GenericModule> {
{
return device->get_module_name(name);
}
/**
* @brief Reads the module firmware version
* @param[out] firmware module firmware version
* @return OK, FAIL or TIMEOUT
*/
command_result get_module_firmware(std::string &firmware)
{
return device->get_module_firmware(firmware);
}
/**
* @brief Sets the modem to data mode
* @return OK, FAIL or TIMEOUT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,28 @@ class GenericModule: public ModuleIf {
int dummy_act;
return get_operator_name(name, dummy_act);
}
/**
* @brief Read the Restricted (U)SIM Access
* @param[out] data response from the command
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @return OK, FAIL or TIMEOUT
*/
virtual command_result get_restricted_usim_access(std::string &data, int command, int file_id, int p1, int p2, int p3);
/**
* @brief Write the Restricted (U)SIM Access
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @param[in] data data to write
* @return OK, FAIL or TIMEOUT
*/
virtual command_result set_restricted_usim_access(int command, int file_id, int p1, int p2, int p3, const std::string &data);
/**
* @brief Common DCE commands generated from the API AT list
*/
Expand Down Expand Up @@ -209,12 +231,24 @@ class GenericModule: public ModuleIf {
* @return OK, FAIL or TIMEOUT
*/
virtual command_result get_imei(std::string &imei);
/**
* @brief Reads the ICCID number
* @param[out] iccid SIM's ICCID number
* @return OK, FAIL or TIMEOUT
*/
virtual command_result get_iccid(std::string &iccid);
/**
* @brief Reads the module name
* @param[out] name module name
* @return OK, FAIL or TIMEOUT
*/
virtual command_result get_module_name(std::string &name);
/**
* @brief Reads the module firmware version
* @param[out] firmware module firmware version
* @return OK, FAIL or TIMEOUT
*/
virtual command_result get_module_firmware(std::string &firmware);
/**
* @brief Sets the modem to data mode
* @return OK, FAIL or TIMEOUT
Expand Down
34 changes: 34 additions & 0 deletions components/esp_modem/command/include/esp_modem_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,52 @@ esp_err_t esp_modem_set_cmux(esp_modem_dce_t *dce);
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_get_imsi(esp_modem_dce_t *dce, char *imsi);
/**
* @brief Reads the ICCID number
* @param[out] iccid SIM's ICCID number
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_get_iccid(esp_modem_dce_t *dce_wrap, char *p_iccid);
/**
* @brief Reads the IMEI number
* @param[out] imei Module's IMEI number
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_get_imei(esp_modem_dce_t *dce, char *imei);
/**
* @brief Read the Restricted (U)SIM Access
* @param[out] data response from the command
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_get_restricted_usim_access(esp_modem_dce_t *dce_wrap, char *p_data, int command, int file_id, int p1, int p2, int p3);
/**
* @brief Write the Restricted (U)SIM Access
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @param[in] data data to write
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_set_restricted_usim_access(esp_modem_dce_t *dce_wrap, int command, int file_id, int p1, int p2, int p3, const char *data);
/**
* @brief Reads the module name
* @param[out] name module name
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_get_module_name(esp_modem_dce_t *dce, char *name);
/**
* @brief Reads the module firmware version
* @param[out] firmware module firmware version
* @return OK, FAIL or TIMEOUT
*/
esp_err_t esp_modem_get_module_firmware(esp_modem_dce_t *dce_wrap, char *p_firmware);
/**
* @brief Sets the modem to data mode
* @return OK, FAIL or TIMEOUT
Expand Down
46 changes: 46 additions & 0 deletions components/esp_modem/command/src/esp_modem_modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,52 @@ command_result GenericModule::get_imei(std::string &imei)
{
return esp_modem::dce_commands::get_imei(dte.get(), imei);
}
/**
* @brief Reads the ICCID number
* @param[out] iccid SIM's ICCID number
* @return OK, FAIL or TIMEOUT
*/
command_result GenericModule::get_iccid(std::string &iccid)
{
return esp_modem::dce_commands::get_iccid(dte.get(), iccid);
}
/**
* @brief Reads the module firmware version
* @param[out] firmware module firmware version
* @return OK, FAIL or TIMEOUT
*/
command_result GenericModule::get_module_firmware(std::string &firmware)
{
return esp_modem::dce_commands::get_module_firmware(dte.get(), firmware);
}
/**
* @brief Read the Restricted (U)SIM Access
* @param[out] data response from the command
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @return OK, FAIL or TIMEOUT
*/
command_result GenericModule::get_restricted_usim_access(std::string &data, int command, int file_id, int p1, int p2, int p3)
{
return esp_modem::dce_commands::get_restricted_usim_access(dte.get(), data, command, file_id, p1, p2, p3);
}
/**
* @brief Write the Restricted (U)SIM Access
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @param[in] data data to write
* @return OK, FAIL or TIMEOUT
*/
command_result GenericModule::set_restricted_usim_access(int command, int file_id, int p1, int p2, int p3, const std::string &data)
{
return esp_modem::dce_commands::set_restricted_usim_access(dte.get(), command, file_id, p1, p2, p3, data);
}
/**
* @brief Reads the module name
* @param[out] name module name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,34 @@ command_result Shiny::DCE::get_operator_name(std::string &name, int &act)
{
return esp_modem::dce_commands::get_operator_name(this, name, act);
}
/**
* @brief Read the Restricted (U)SIM Access
* @param[out] data response from the command
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @return OK, FAIL or TIMEOUT
*/
command_result Shiny::DCE::get_restricted_usim_access(std::string &data, int command, int file_id, int p1, int p2, int p3)
{
return esp_modem::dce_commands::get_restricted_usim_access(this, data, command, file_id, p1, p2, p3);
}
/**
* @brief Write the Restricted (U)SIM Access
* @param[in] command command to run
* @param[in] file_id file identifier
* @param[in] p1 param 1
* @param[in] p2 param 2
* @param[in] p3 param 3
* @param[in] data data to write
* @return OK, FAIL or TIMEOUT
*/
command_result Shiny::DCE::set_restricted_usim_access(int command, int file_id, int p1, int p2, int p3, const std::string &data)
{
return esp_modem::dce_commands::set_restricted_usim_access(this, command, file_id, p1, p2, p3, data);
}
/**
* @brief Stores current user profile
* @return OK, FAIL or TIMEOUT
Expand Down Expand Up @@ -181,6 +209,15 @@ command_result Shiny::DCE::get_imei(std::string &imei)
{
return esp_modem::dce_commands::get_imei(this, imei);
}
/**
* @brief Reads the ICCID number
* @param[out] iccid SIM's ICCID number
* @return OK, FAIL or TIMEOUT
*/
command_result Shiny::DCE::get_iccid(std::string &iccid)
{
return esp_modem::dce_commands::get_iccid(this, iccid);
}
/**
* @brief Reads the module name
* @param[out] name module name
Expand All @@ -190,6 +227,15 @@ command_result Shiny::DCE::get_module_name(std::string &name)
{
return esp_modem::dce_commands::get_module_name(this, name);
}
/**
* @brief Reads the module firmware version
* @param[out] firmware module firmware version
* @return OK, FAIL or TIMEOUT
*/
command_result Shiny::DCE::get_module_firmware(std::string &name)
{
return esp_modem::dce_commands::get_module_firmware(this, firmware);
}
/**
* @brief Sets the modem to data mode
* @return OK, FAIL or TIMEOUT
Expand Down
Loading