2021-04-14 17:57:42 +02:00
|
|
|
// cat ../include/generate/esp_modem_command_declare.inc | clang -E -P -CC -xc -I../include -DGENERATE_DOCS - | sed -n '1,/DCE command documentation/!p' > c_api.h
|
|
|
|
// cat ../include/generate/esp_modem_command_declare.inc | clang -E -P -xc -I../include -DGENERATE_DOCS -DGENERATE_RST_LINKS - | sed 's/NL/\n/g' > cxx_api_links.rst
|
2021-04-15 14:59:30 +02:00
|
|
|
|
|
|
|
// call parametrs by names for documentation
|
|
|
|
|
|
|
|
|
2021-04-13 20:29:55 +02:00
|
|
|
// --- DCE command documentation starts here ---
|
|
|
|
|
2021-04-14 17:57:42 +02:00
|
|
|
class esp_modem::DCE: public DCE_T<GenericModule> {
|
2021-04-13 20:29:55 +02:00
|
|
|
public:
|
|
|
|
using DCE_T<GenericModule>::DCE_T;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-14 17:57:42 +02:00
|
|
|
|
2021-04-13 20:29:55 +02:00
|
|
|
/**
|
2021-04-15 14:59:30 +02:00
|
|
|
* @brief Sets the supplied PIN code
|
|
|
|
* @param[in] pin Pin
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/command_result set_pin (const std::string& pin); /**
|
2021-04-13 20:29:55 +02:00
|
|
|
* @brief Checks if the SIM needs a PIN
|
2021-04-15 14:59:30 +02:00
|
|
|
* @param[out] pin_ok true if the SIM card doesn't need a PIN to unlock
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result read_pin (bool& pin_ok); /**
|
2021-04-15 14:59:30 +02:00
|
|
|
* @brief Sets echo mode
|
|
|
|
* @param[in] echo_on true if echo mode on (repeats the commands)
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result set_echo (const bool echo_on); /**
|
|
|
|
* @brief Sets the Txt or Pdu mode for SMS (only txt is supported)
|
|
|
|
* @param[in] txt true if txt mode
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result sms_txt_mode (const bool txt); /**
|
|
|
|
* @brief Sets the default (GSM) charater set
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result sms_character_set (); /**
|
|
|
|
* @brief Sends SMS message in txt mode
|
|
|
|
* @param[in] number Phone number to send the message to
|
|
|
|
* @param[in] message Text message to be sent
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result send_sms (const std::string& number, const std::string& message); /**
|
|
|
|
* @brief Resumes data mode (Switches back to th data mode, which was temporarily suspended)
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result resume_data_mode (); /**
|
2021-04-15 14:59:30 +02:00
|
|
|
* @brief Sets php context
|
|
|
|
* @param[in] x PdP context struct to setup modem cellular connection
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result set_pdp_context (PdpContext& x); /**
|
2021-04-15 14:59:30 +02:00
|
|
|
* @brief Switches to the command mode
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result set_command_mode (); /**
|
2021-04-15 14:59:30 +02:00
|
|
|
* @brief Switches to the CMUX mode
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result set_cmux (); /**
|
2021-04-15 14:59:30 +02:00
|
|
|
* @brief Reads the IMSI number
|
|
|
|
* @param[out] imsi Module's IMSI number
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result get_imsi (std::string& imsi); /**
|
|
|
|
* @brief Reads the IMEI number
|
|
|
|
* @param[out] imei Module's IMEI number
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result get_imei (std::string& imei); /**
|
2021-04-13 20:29:55 +02:00
|
|
|
* @brief Reads the module name
|
|
|
|
* @param[out] name module name
|
2021-04-15 14:59:30 +02:00
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result get_module_name (std::string& name); /**
|
|
|
|
* @brief Sets the modem to data mode
|
2021-04-15 14:59:30 +02:00
|
|
|
* @return OK, FAIL or TIMEOUT
|
2021-04-13 20:29:55 +02:00
|
|
|
*/ command_result set_data_mode (); /**
|
|
|
|
* @brief Get Signal quality
|
2021-04-15 14:59:30 +02:00
|
|
|
* @param[out] rssi signal strength indication
|
|
|
|
* @param[out] ber channel bit error rate
|
|
|
|
* @return OK, FAIL or TIMEOUT
|
|
|
|
*/ command_result get_signal_quality (int& rssi, int& ber);
|
2021-04-13 20:29:55 +02:00
|
|
|
};
|