CogniBoost/sw/libCogniBoost/cbLibDev.c
static void cbCacheSave(cbHnd_T     hnd,
                        cbTid_T     uTid,
                        cbPktHdr_T *pPktHdr,
                        byte_t      bufRspMsg[])
{
  cbTransInfo_T  *pInfo;
  size_t          uMsgLen;

  cbLock(hnd);

  pInfo = hnd->m_tblTransCache[uTid & CB_HDR_TID_MASK];

  delete(pInfo->m_pPktHdr);
  delete(pInfo->m_pBuf);

  uMsgLen = (size_t)(pPktHdr->m_hdrMsgLen);

  pInfo->m_pPktHdr  = new_memdup(sizeof(cbPktHdr_T), pPktHdr);
  pInfo->m_pBuf     = new_memdup(uMsgLen, bufRspMsg);
  pInfo->m_bCached  = true;

  LOGDIAG3("Device %d: Saved response to cache: tid=%u, msg=%s(msgid=%u).",
      hnd->m_fd, uTid, CB_MSG_NAME_ID(cbGetMsgId(bufRspMsg, uMsgLen)));

  cbUnlock(hnd);
}
/*!
 * \brief Cache a transaction response.
 *
 * Caching a response occurs when this client thread receives a response
 * for another client thread.
 *
 * \param hnd           CogniBoost device handle.
 * \param uTid          Transaction id.
 * \param [in] pPktHdr  Response packet header.
 * \param [in] bufRspMsg   Packed response message buffer.
 */
\brief Cache a transaction response.
Caching a response occurs when this client thread receives a response
for another client thread.

\param hnd           CogniBoost device handle.
\param uTid          Transaction id.
\param [in] pPktHdr  Response packet header.
\param [in] bufRspMsg   Packed response message buffer.
\ brief Cache a transaction response . Caching a response occurs when this client thread receives a response for another client thread . \ param hnd CogniBoost device handle . \ param uTid Transaction id . \ param [ in ] pPktHdr Response packet header . \ param [ in ] bufRspMsg Packed response message buffer .
static void cbCacheSave(cbHnd_T     hnd,
                        cbTid_T     uTid,
                        cbPktHdr_T *pPktHdr,
                        byte_t      bufRspMsg[])
{
  cbTransInfo_T  *pInfo;
  size_t          uMsgLen;
  cbLock(hnd);
  pInfo = hnd->m_tblTransCache[uTid & CB_HDR_TID_MASK];
  delete(pInfo->m_pPktHdr);
  delete(pInfo->m_pBuf);
  uMsgLen = (size_t)(pPktHdr->m_hdrMsgLen);
  pInfo->m_pPktHdr  = new_memdup(sizeof(cbPktHdr_T), pPktHdr);
  pInfo->m_pBuf     = new_memdup(uMsgLen, bufRspMsg);
  pInfo->m_bCached  = true;
  LOGDIAG3("Device %d: Saved response to cache: tid=%u, msg=%s(msgid=%u).",
      hnd->m_fd, uTid, CB_MSG_NAME_ID(cbGetMsgId(bufRspMsg, uMsgLen)));
  cbUnlock(hnd);
}
static void cbCacheSave ( cbHnd_T hnd , cbTid_T uTid , cbPktHdr_T * pPktHdr , byte_t bufRspMsg [ ] ) { cbTransInfo_T * pInfo ; size_t uMsgLen ; cbLock ( hnd ) ; pInfo = hnd -> m_tblTransCache [ uTid & CB_HDR_TID_MASK ] ; delete ( pInfo -> m_pPktHdr ) ; delete ( pInfo -> m_pBuf ) ; uMsgLen = ( size_t ) ( pPktHdr -> m_hdrMsgLen ) ; pInfo -> m_pPktHdr = new_memdup ( sizeof ( cbPktHdr_T ) , pPktHdr ) ; pInfo -> m_pBuf = new_memdup ( uMsgLen , bufRspMsg ) ; pInfo -> m_bCached = true ; LOGDIAG3 ( " " , hnd -> m_fd , uTid , CB_MSG_NAME_ID ( cbGetMsgId ( bufRspMsg , uMsgLen ) ) ) ; cbUnlock ( hnd ) ; }
\brief Cache a transaction response.
\ brief Cache a transaction response .