Skip to content

Commit

Permalink
Fixes for esp idf commit 79f206be47c3f608615c1de8c491107e6c9194bb and…
Browse files Browse the repository at this point in the history
… start of esp-idf integration
  • Loading branch information
Philius committed Nov 1, 2017
1 parent 006c88c commit 190cfac
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 12 deletions.
23 changes: 23 additions & 0 deletions Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
menu "nkolban's c++ wrappers"

menuconfig NKOLBAN
bool "nkolban's c++ wrappers"
default y
help
Select this option to use nkolban's c++ wrappers.

menuconfig NKOLBAN_BLE
bool "bluetooth wrappers"
depends on BT_ENABLED && NKOLBAN
default y
help
Select this option to use nkolban's c++ bluetooth ble wrappers.

menuconfig NKOLBAN_BLE2902
bool "BLE2902"
depends on NKOLBAN_BLE
default y
help
Select this option to use nkolban's c++ bluetooth BLE2902 wrappers.

endmenu
35 changes: 35 additions & 0 deletions component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
c := cpp_utils
COMPONENT_EXTRA_INCLUDES := $(realpath $c)
COMPONENT_ADD_INCLUDEDIRS := $c
COMPONENT_SRCDIRS := $c

$(call compile_only_if,$(CONFIG_NKOLBAN), \
$c/Task.o \
$c/FreeRTOS.o \
$c/GeneralUtils.o \
)

$(call compile_only_if,$(CONFIG_NKOLBAN_BLE), \
$c/BLEAddress.o \
$c/BLEAdvertisedDevice.o \
$c/BLEAdvertising.o \
$c/BLECharacteristic.o \
$c/BLECharacteristicCallbacks.o \
$c/BLECharacteristicMap.o \
$c/BLEClient.o \
$c/BLEDescriptor.o \
$c/BLEDescriptorMap.o \
$c/BLEDevice.o \
$c/BLERemoteCharacteristic.o \
$c/BLERemoteDescriptor.o \
$c/BLERemoteService.o \
$c/BLEScan.o \
$c/BLEServer.o \
$c/BLEService.o \
$c/BLEServiceMap.o \
$c/BLEUUID.o \
$c/BLEUtils.o \
$c/BLEValue.o \
)

$(call compile_only_if,$(CONFIG_NKOLBAN_BLE2902),$c/BLE2902.o)
2 changes: 1 addition & 1 deletion cpp_utils/BLEClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include <string.h>
#include <map>
#include <string>
#include <BLERemoteService.h>
#include "BLERemoteService.h"
#include "BLEService.h"
#include "BLEAddress.h"

Expand Down
16 changes: 6 additions & 10 deletions cpp_utils/BLEUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1286,8 +1286,7 @@ void BLEUtils::dumpGattClientEvent(
// - uint16_t conn_id
// - esp_bd_addr_t remote_bda
case ESP_GATTC_CONNECT_EVT: {
ESP_LOGD(LOG_TAG, "[staus: %s, conn_id: %d, remote_bda: %s]",
BLEUtils::gattStatusToString(evtParam->connect.status).c_str(),
ESP_LOGD(LOG_TAG, "[conn_id: %d, remote_bda: %s]",
evtParam->connect.conn_id,
BLEAddress(evtParam->connect.remote_bda).toString().c_str()
);
Expand All @@ -1302,8 +1301,7 @@ void BLEUtils::dumpGattClientEvent(
// - uint16_t conn_id
// - esp_bd_addr_t remote_bda
case ESP_GATTC_DISCONNECT_EVT: {
ESP_LOGD(LOG_TAG, "[staus: %s, conn_id: %d, remote_bda: %s]",
BLEUtils::gattStatusToString(evtParam->disconnect.status).c_str(),
ESP_LOGD(LOG_TAG, "[conn_id: %d, remote_bda: %s]",
evtParam->disconnect.conn_id,
BLEAddress(evtParam->disconnect.remote_bda).toString().c_str()
);
Expand Down Expand Up @@ -1586,10 +1584,9 @@ void BLEUtils::dumpGattServerEvent(
} // ESP_GATTS_CONGEST_EVT

case ESP_GATTS_CONNECT_EVT: {
ESP_LOGD(LOG_TAG, "[conn_id: %d, remote_bda: %s, is_connected: %d]",
ESP_LOGD(LOG_TAG, "[conn_id: %d, remote_bda: %s]",
evtParam->connect.conn_id,
BLEAddress(evtParam->connect.remote_bda).toString().c_str(),
evtParam->connect.is_connected);
BLEAddress(evtParam->connect.remote_bda).toString().c_str());
break;
} // ESP_GATTS_CONNECT_EVT

Expand All @@ -1603,10 +1600,9 @@ void BLEUtils::dumpGattServerEvent(
} // ESP_GATTS_CREATE_EVT

case ESP_GATTS_DISCONNECT_EVT: {
ESP_LOGD(LOG_TAG, "[conn_id: %d, remote_bda: %s, is_connected: %d]",
ESP_LOGD(LOG_TAG, "[conn_id: %d, remote_bda: %s]",
evtParam->connect.conn_id,
BLEAddress(evtParam->connect.remote_bda).toString().c_str(),
evtParam->connect.is_connected);
BLEAddress(evtParam->connect.remote_bda).toString().c_str());
break;
} // ESP_GATTS_DISCONNECT_EVT

Expand Down
2 changes: 1 addition & 1 deletion cpp_utils/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY = /home/kolban/esp32/esptest/apps/workspace/esp32-snippets/cpp_utils/docs
OUTPUT_DIRECTORY = docs

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down

0 comments on commit 190cfac

Please sign in to comment.