|
29 | 29 | # endif |
30 | 30 | # endif |
31 | 31 |
|
32 | | -#if MYNEWT_VAL(NIMBLE_CPP_DEBUG_ASSERT_ENABLED) && !defined NDEBUG |
33 | | -void nimble_cpp_assert(const char *file, unsigned line) __attribute((weak, noreturn)); |
34 | | -# define NIMBLE_ATT_VAL_FILE (__builtin_strrchr(__FILE__, '/') ? \ |
35 | | - __builtin_strrchr (__FILE__, '/') + 1 : __FILE__) |
36 | | -# define NIMBLE_CPP_DEBUG_ASSERT(cond) \ |
37 | | - if (!(cond)) { \ |
38 | | - nimble_cpp_assert(NIMBLE_ATT_VAL_FILE, __LINE__); \ |
39 | | - } |
40 | | -#else |
41 | | -# define NIMBLE_CPP_DEBUG_ASSERT(cond) (void(0)) |
42 | | -#endif |
| 32 | +# if MYNEWT_VAL(NIMBLE_CPP_DEBUG_ASSERT_ENABLED) && !defined NDEBUG |
| 33 | +void nimble_cpp_assert(const char* file, unsigned line) __attribute((weak, noreturn)); |
| 34 | +# define NIMBLE_ATT_VAL_FILE (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__) |
| 35 | +# define NIMBLE_CPP_DEBUG_ASSERT(cond) \ |
| 36 | + if (!(cond)) { \ |
| 37 | + nimble_cpp_assert(NIMBLE_ATT_VAL_FILE, __LINE__); \ |
| 38 | + } |
| 39 | +# else |
| 40 | +# define NIMBLE_CPP_DEBUG_ASSERT(cond) (void(0)) |
| 41 | +# endif |
43 | 42 |
|
44 | 43 | # include <string> |
45 | 44 |
|
@@ -74,6 +73,12 @@ class NimBLEUtils { |
74 | 73 | static NimBLEAddress generateAddr(bool nrpa); |
75 | 74 | static bool taskWait(const NimBLETaskData& taskData, uint32_t timeout); |
76 | 75 | static void taskRelease(const NimBLETaskData& taskData, int rc = 0); |
| 76 | + static void* getHostTaskHandle(); |
| 77 | + static bool inHostTask(); |
| 78 | + |
| 79 | + private: |
| 80 | + friend class NimBLEDevice; |
| 81 | + static void* m_hostTaskHandle; |
77 | 82 | }; |
78 | 83 |
|
79 | 84 | #endif // CONFIG_BT_NIMBLE_ENABLED |
|
0 commit comments