Move DCE_CHECK in the esp_modem_dce

Signed-off-by: Jonathan Dreyer <jonathan.dreyer@cleanenergie.ch>
Signed-off-by: Liu Han <liuhan@espressif.com>
pull/6718/head
Jonathan Dreyer 2021-01-30 23:31:53 +01:00 zatwierdzone przez bot
rodzic de239f151f
commit 3968660b2a
8 zmienionych plików z 16 dodań i 58 usunięć

Wyświetl plik

@ -8,5 +8,4 @@ set(srcs "src/esp_modem.c"
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS include
PRIV_INCLUDE_DIRS private_include
REQUIRES driver)

Wyświetl plik

@ -1,3 +1,2 @@
COMPONENT_ADD_INCLUDEDIRS := include
COMPONENT_PRIV_INCLUDEDIRS := private_include
COMPONENT_SRCDIRS := src

Wyświetl plik

@ -13,6 +13,20 @@
// 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

Wyświetl plik

@ -1,28 +0,0 @@
// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// 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)

Wyświetl plik

@ -14,8 +14,8 @@
#include <stdlib.h>
#include <string.h>
#include "esp_log.h"
#include "esp_modem_dce_service.h"
#include "bg96.h"
#include "bg96_private.h"
#define MODEM_RESULT_CODE_POWERDOWN "POWERED DOWN"

Wyświetl plik

@ -15,20 +15,7 @@
#include "esp_log.h"
#include "esp_modem_dce_service.h"
/**
* @brief Macro defined for error checking
*
*/
static const char *DCE_TAG = "dce_service";
#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)
{

Wyświetl plik

@ -14,8 +14,8 @@
#include <stdlib.h>
#include <string.h>
#include "esp_log.h"
#include "esp_modem_dce_service.h"
#include "bg96.h"
#include "bg96_private.h"
/**
* @brief This module supports SIM7600 module, which has a very similar interface

Wyświetl plik

@ -19,20 +19,7 @@
#define MODEM_RESULT_CODE_POWERDOWN "POWER DOWN"
/**
* @brief Macro defined for error checking
*
*/
static const char *DCE_TAG = "sim800";
#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