mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-06 22:24:33 +02:00
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>
This commit is contained in:
@@ -8,5 +8,4 @@ set(srcs "src/esp_modem.c"
|
|||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
INCLUDE_DIRS include
|
INCLUDE_DIRS include
|
||||||
PRIV_INCLUDE_DIRS private_include
|
|
||||||
REQUIRES driver)
|
REQUIRES driver)
|
||||||
|
@@ -1,3 +1,2 @@
|
|||||||
COMPONENT_ADD_INCLUDEDIRS := include
|
COMPONENT_ADD_INCLUDEDIRS := include
|
||||||
COMPONENT_PRIV_INCLUDEDIRS := private_include
|
|
||||||
COMPONENT_SRCDIRS := src
|
COMPONENT_SRCDIRS := src
|
||||||
|
@@ -13,6 +13,20 @@
|
|||||||
// 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
|
||||||
|
@@ -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)
|
|
@@ -14,8 +14,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
#include "esp_modem_dce_service.h"
|
||||||
#include "bg96.h"
|
#include "bg96.h"
|
||||||
#include "bg96_private.h"
|
|
||||||
|
|
||||||
#define MODEM_RESULT_CODE_POWERDOWN "POWERED DOWN"
|
#define MODEM_RESULT_CODE_POWERDOWN "POWERED DOWN"
|
||||||
|
|
||||||
|
@@ -15,20 +15,7 @@
|
|||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
#include "esp_modem_dce_service.h"
|
#include "esp_modem_dce_service.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Macro defined for error checking
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static const char *DCE_TAG = "dce_service";
|
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)
|
esp_err_t esp_modem_dce_handle_response_default(modem_dce_t *dce, const char *line)
|
||||||
{
|
{
|
||||||
|
@@ -14,8 +14,8 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
#include "esp_modem_dce_service.h"
|
||||||
#include "bg96.h"
|
#include "bg96.h"
|
||||||
#include "bg96_private.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This module supports SIM7600 module, which has a very similar interface
|
* @brief This module supports SIM7600 module, which has a very similar interface
|
||||||
|
@@ -19,20 +19,7 @@
|
|||||||
|
|
||||||
#define MODEM_RESULT_CODE_POWERDOWN "POWER DOWN"
|
#define MODEM_RESULT_CODE_POWERDOWN "POWER DOWN"
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Macro defined for error checking
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static const char *DCE_TAG = "sim800";
|
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
|
* @brief Handle response from AT+CPOWD=1
|
||||||
|
Reference in New Issue
Block a user