diff --git a/examples/protocols/pppos_client/components/modem/include/esp_modem_dce.h b/examples/protocols/pppos_client/components/modem/include/esp_modem_dce.h index 7e89d428c0..3da9d0aea1 100644 --- a/examples/protocols/pppos_client/components/modem/include/esp_modem_dce.h +++ b/examples/protocols/pppos_client/components/modem/include/esp_modem_dce.h @@ -13,20 +13,6 @@ // limitations under the License. #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 extern "C" { #endif diff --git a/examples/protocols/pppos_client/components/modem/src/bg96.c b/examples/protocols/pppos_client/components/modem/src/bg96.c index e74180d52c..af8e16a754 100644 --- a/examples/protocols/pppos_client/components/modem/src/bg96.c +++ b/examples/protocols/pppos_client/components/modem/src/bg96.c @@ -21,6 +21,20 @@ 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 */ diff --git a/examples/protocols/pppos_client/components/modem/src/esp_modem_dce_service.c b/examples/protocols/pppos_client/components/modem/src/esp_modem_dce_service.c index f2984c1f90..5753c18f36 100644 --- a/examples/protocols/pppos_client/components/modem/src/esp_modem_dce_service.c +++ b/examples/protocols/pppos_client/components/modem/src/esp_modem_dce_service.c @@ -17,6 +17,20 @@ 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 err = ESP_FAIL; diff --git a/examples/protocols/pppos_client/components/modem/src/sim7600.c b/examples/protocols/pppos_client/components/modem/src/sim7600.c index 3b7aac8b13..3ec3b3fff4 100644 --- a/examples/protocols/pppos_client/components/modem/src/sim7600.c +++ b/examples/protocols/pppos_client/components/modem/src/sim7600.c @@ -24,6 +24,20 @@ */ 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 */ diff --git a/examples/protocols/pppos_client/components/modem/src/sim800.c b/examples/protocols/pppos_client/components/modem/src/sim800.c index 4dd2a2f176..d0a80c6f52 100644 --- a/examples/protocols/pppos_client/components/modem/src/sim800.c +++ b/examples/protocols/pppos_client/components/modem/src/sim800.c @@ -21,6 +21,20 @@ 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 */