1秒需要发24000个字节左右,连续调用GATT_bm_allo 不到100次之后就分配失败了。attHandleValueNoti_t 的pValue 这个指针是不是每次使用GATT_Notification 都需要重新分配内存?好像只分配一次的话GATT_Notification就会失败。
Kevin Qiu1:
应该是heap满了/*-------------------------------------------------------------------* GATT Buffer Management APIs*//*** @briefGATT implementation of the allocator functionality.** @note* This function should only be called by GATT and*the upper layer protocol/application.** @paramconnHandle - connection that message is to be sent on.* @paramopcode - opcode of message that buffer to be allocated for.* @paramsize - number of bytes to allocate from the heap.* @parampSizeAlloc - 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 );/*** @briefGATT implementation of the de-allocator functionality.** @parampMsg - pointer to GATT message containing the memory to free.* @paramopcode - opcode of the message*/ extern void GATT_bm_free( gattMsg_t *pMsg, uint8 opcode );/// @cond NODOC