/* Registers the callback function that this server calls, whenever it received a PDU containing a function code not currently supported. With the aid of this callback function the user can implement support for new function codes.  */
void TbxMbServerSetCallbackCustomFunction(tTbxMbServer channel, tTbxMbServerCustomFunction callback)
/* Registers the callback function that this server calls, whenever it received a PDU containing a function code not currently supported. With the aid of this callback function the user can implement support for new function codes.  */
void TbxMbServerSetCallbackCustomFunction(tTbxMbServer channel, tTbxMbServerCustomFunction callback)
{
  TBX_ASSERT((channel != NULL) && (callback != NULL));
  if ((channel != NULL) && (callback != NULL))
  {
    tTbxMbServerCtx * serverCtx = (tTbxMbServerCtx *)channel;
    TBX_ASSERT(serverCtx->type == TBX_MB_SERVER_CONTEXT_TYPE);
    TbxCriticalSectionEnter();
    serverCtx->customFunctionFcn = callback;
    TbxCriticalSectionExit();
  }
}