mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
pppos-client: Refactor modem component
Merges https://github.com/espressif/esp-idf/pull/6483
This commit is contained in:
@@ -13,20 +13,6 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Macro defined for error checking
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#define DCE_CHECK(a, str, goto_tag, ...) \
|
|
||||||
do \
|
|
||||||
{ \
|
|
||||||
if (!(a)) \
|
|
||||||
{ \
|
|
||||||
ESP_LOGE(DCE_TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
|
|
||||||
goto goto_tag; \
|
|
||||||
} \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@@ -21,6 +21,20 @@
|
|||||||
|
|
||||||
static const char *DCE_TAG = "bg96";
|
static const char *DCE_TAG = "bg96";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro defined for error checking
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define DCE_CHECK(a, str, goto_tag, ...) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
if (!(a)) \
|
||||||
|
{ \
|
||||||
|
ESP_LOGE(DCE_TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
|
||||||
|
goto goto_tag; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Handle response from AT+QPOWD=1
|
* @brief Handle response from AT+QPOWD=1
|
||||||
*/
|
*/
|
||||||
|
@@ -17,6 +17,20 @@
|
|||||||
|
|
||||||
static const char *DCE_TAG = "dce_service";
|
static const char *DCE_TAG = "dce_service";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro defined for error checking
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define DCE_CHECK(a, str, goto_tag, ...) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
if (!(a)) \
|
||||||
|
{ \
|
||||||
|
ESP_LOGE(DCE_TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
|
||||||
|
goto goto_tag; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
esp_err_t esp_modem_dce_handle_response_default(modem_dce_t *dce, const char *line)
|
esp_err_t esp_modem_dce_handle_response_default(modem_dce_t *dce, const char *line)
|
||||||
{
|
{
|
||||||
esp_err_t err = ESP_FAIL;
|
esp_err_t err = ESP_FAIL;
|
||||||
|
@@ -24,6 +24,20 @@
|
|||||||
*/
|
*/
|
||||||
static const char *DCE_TAG = "sim7600";
|
static const char *DCE_TAG = "sim7600";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro defined for error checking
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define DCE_CHECK(a, str, goto_tag, ...) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
if (!(a)) \
|
||||||
|
{ \
|
||||||
|
ESP_LOGE(DCE_TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
|
||||||
|
goto goto_tag; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Handle response from AT+CBC
|
* @brief Handle response from AT+CBC
|
||||||
*/
|
*/
|
||||||
|
@@ -21,6 +21,20 @@
|
|||||||
|
|
||||||
static const char *DCE_TAG = "sim800";
|
static const char *DCE_TAG = "sim800";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Macro defined for error checking
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define DCE_CHECK(a, str, goto_tag, ...) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
if (!(a)) \
|
||||||
|
{ \
|
||||||
|
ESP_LOGE(DCE_TAG, "%s(%d): " str, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
|
||||||
|
goto goto_tag; \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Handle response from AT+CPOWD=1
|
* @brief Handle response from AT+CPOWD=1
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user