Bluetooth: nble: Use weak functions printing debug info

Since the headers defining RPC with Nordic chip changes frequently
define weak functions printing BT_WARN("Not implemented") if
function is not defined.
Weak function symbol is marked with "W" as viewed by nm.

Change-Id: Ia39b64c6e89fdddc65683711fd192a235fe754d4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
Andrei Emeltchenko 2016-01-26 12:05:18 +02:00 committed by Anas Nashif
commit 9c3de9ebca
2 changed files with 83 additions and 1 deletions

View file

@ -1 +1 @@
obj-$(CONFIG_NBLE) += gap.o conn.o gatt.o uart.o rpc_serialize.o rpc_deserialize.o obj-$(CONFIG_NBLE) += gap.o conn.o gatt.o uart.o rpc_serialize.o rpc_deserialize.o stubs.o

82
drivers/nble/stubs.c Normal file
View file

@ -0,0 +1,82 @@
/*
* Copyright (c) 2016 Intel Corporation
*
* 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.
*/
#include <bluetooth/log.h>
#include "gap_internal.h"
#include "gatt_internal.h"
#include "rpc_functions_to_quark.h"
#ifndef __weak
#define __weak __attribute__((weak))
#endif
#define FN_SIG_NONE(n) \
__weak void n(void) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_NONE
#define FN_SIG_S(n, s) \
__weak void n(s _p) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_S
#define FN_SIG_P(n, p) \
__weak void n(p _p) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_P
#define FN_SIG_S_B(n, s, b, l) \
__weak void n(s _p, b _b, l _l) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_S_B
#define FN_SIG_B_B_P(n, b1, l1, b2, l2, p) \
__weak void n(b1 _b1, l1 _l1, b2 _b2, l2 _l2, p _p) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_B_B_P
#define FN_SIG_S_P(n, s, p) \
__weak void n(s _s, p _p) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_S_P
#define FN_SIG_S_B_P(n, s, b, l, p) \
__weak void n(s _s, b _b, l _l, p _p) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_S_B_P
#define FN_SIG_S_B_B_P(n, s, b1, l1, b2, l2, p) \
__weak void n(s _s, b1 _b1, l1 _l1, b2 _b2, l2 _l2, p _p) \
{ \
BT_WARN("Not implemented"); \
}
LIST_FN_SIG_S_B_B_P