1秒需要发24000个字节左右,连续调用GATT_bm_allo 不到100次之后就分配失败了。attHandleValueNoti_t 的pValue 这个指针是不是每次使用GATT_Notification 都需要重新分配内存?好像只分配一次的话GATT_Notification就会失败。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
1秒需要发24000个字节左右,连续调用GATT_bm_allo 不到100次之后就分配失败了。attHandleValueNoti_t 的pValue 这个指针是不是每次使用GATT_Notification 都需要重新分配内存?好像只分配一次的话GATT_Notification就会失败。
应该是heap满了
/*------------------------------------------------------------------- * GATT Buffer Management APIs */ /** * @brief GATT implementation of the allocator functionality. * * @note * This function should only be called by GATT and * the upper layer protocol/application. * * @param connHandle - connection that message is to be sent on. * @param opcode - opcode of message that buffer to be allocated for. * @param size - number of bytes to allocate from the heap. * @param pSizeAlloc - number of bytes allocated for the caller from the heap. * * @return pointer to the heap allocation * @return NULL if error or failure. */ extern void *GATT_bm_alloc( uint16 connHandle, uint8 opcode, uint16 size, uint16 *pSizeAlloc ); /** * @brief GATT implementation of the de-allocator functionality. * * @param pMsg - pointer to GATT message containing the memory to free. * @param opcode - opcode of the message */ extern void GATT_bm_free( gattMsg_t *pMsg, uint8 opcode ); /// @cond NODOC