nuttx-apps/wireless/bluetooth/nimble/include/logcfg/logcfg.h
raiden00pl d8ea8e3d1f nimble: improve integration with NuttX
1. add Makefile.nimble that helps integrate NimBLE with custom applications
  To enable NimBLE for an custom application, user needs to include Makefile.nimble in the app's Makefile:
    include $(APPDIR)/wireless/bluetooth/nimble/Makefile.nimble

2. add NuttX specific syscfg.h
  - file based on nimble/porting/examples/nuttx/include/syscfg/syscfg.h
  - all unnecessary definitions was removed
  - definitions are configurable from Kconfig

3. add NuttX specific logcfg.h
  - bind NimBLE logging with debug.h macros
2023-06-27 22:28:32 +03:00

67 lines
2.7 KiB
C

/****************************************************************************
* apps/wireless/bluetooth/nimble/include/logcfg/logcfg.h
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership. The
* ASF licenses this file to you 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.
*
****************************************************************************/
#ifndef __APPS_WIRELESS_BLUETOOTH_NIMBLE_INCLUDE_LOGCFG_LOGCFG_H
#define __APPS_WIRELESS_BLUETOOTH_NIMBLE_INCLUDE_LOGCFG_LOGCFG_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <debug.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
#ifdef CONFIG_NIMBLE_DEBUG_ERROR
# define nimble_err _err
#else
# define nimble_err _none
#endif
#ifdef CONFIG_NIMBLE_DEBUG_WARN
# define nimble_warn _warn
#else
# define nimble_warn _none
#endif
#ifdef CONFIG_NIMBLE_DEBUG_INFO
# define nimble_info _info
#else
# define nimble_info _none
#endif
#define BLE_HS_LOG_DEBUG(msg, ...) nimble_info(msg, ##__VA_ARGS__)
#define BLE_HS_LOG_INFO(msg, ...) nimble_info(msg, ##__VA_ARGS__)
#define BLE_HS_LOG_WARN(msg, ...) nimble_warn(msg, ##__VA_ARGS__)
#define BLE_HS_LOG_ERROR(msg, ...) nimble_err(msg, ##__VA_ARGS__)
#define BLE_HS_LOG_CRITICAL(msg, ...) nimble_err(msg, ##__VA_ARGS__)
#define BLE_HS_LOG_DISABLED(msg, ...) nimble_err(msg, ##__VA_ARGS__)
#define DFLT_LOG_DEBUG(msg, ...) nimble_info(msg, ##__VA_ARGS__)
#define DFLT_LOG_INFO(msg, ...) nimble_info(msg, ##__VA_ARGS__)
#define DFLT_LOG_WARN(msg, ...) nimble_warn(msg, ##__VA_ARGS__)
#define DFLT_LOG_ERROR(msg, ...) nimble_err(msg, ##__VA_ARGS__)
#define DFLT_LOG_CRITICAL(msg, ...) nimble_err(msg, ##__VA_ARGS__)
#define DFLT_LOG_DISABLED(msg, ...) nimble_err(msg, ##__VA_ARGS__)
#endif /* __APPS_WIRELESS_BLUETOOTH_NIMBLE_INCLUDE_LOGCFG_LOGCFG_H */