summaryrefslogtreecommitdiff
path: root/digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h
diff options
context:
space:
mode:
authorFlorent Duchon2012-12-26 17:36:00 +0100
committerFlorent Duchon2013-02-13 21:21:12 +0100
commitb24866225a6301d3a663f874725e83c012dc25d3 (patch)
treeca527a2aab9abcdfbaf244c53ca63f0c531892b0 /digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h
parent2ba279f4eb2f23fa08a7c13465d16ae6ba5d0f96 (diff)
digital/beacon: add bitcloud stack into common directory digital/zigbit
Diffstat (limited to 'digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h')
-rw-r--r--digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h90
1 files changed, 90 insertions, 0 deletions
diff --git a/digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h b/digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h
new file mode 100644
index 00000000..46017dc4
--- /dev/null
+++ b/digital/zigbit/bitcloud/stack/Components/ZCL/include/zclMemoryManager.h
@@ -0,0 +1,90 @@
+/************************************************************************//**
+ \file zclMemoryManager.h
+
+ \brief
+ The header file describes the ZCL Memory Manager interface
+
+ \author
+ Atmel Corporation: http://www.atmel.com \n
+ Support email: avr@atmel.com
+
+ Copyright (c) 2008-2011, Atmel Corporation. All rights reserved.
+ Licensed under Atmel's Limited License Agreement (BitCloudTM).
+
+ \internal
+ History:
+ 27.11.08 A. Potashov - Created.
+******************************************************************************/
+
+#ifndef _ZCLMEMORYMANAGER_H
+#define _ZCLMEMORYMANAGER_H
+
+/******************************************************************************
+ Includes section
+******************************************************************************/
+#include <types.h>
+#include <aps.h>
+#include <appFramework.h>
+#include <macAddr.h>
+#include <zcl.h>
+#include <dbg.h>
+
+/******************************************************************************
+ Types section
+******************************************************************************/
+typedef union
+{
+ APS_DataReq_t apsDataReq;
+ APS_DataInd_t apsDataInd;
+} ZclMmPrimitive_t;
+
+typedef struct
+{
+ TOP_GUARD
+ uint8_t header[APS_ASDU_OFFSET]; // Auxiliary header (required by stack)
+ uint8_t asdu[ZCL_MAX_ASDU_SIZE]; // ASDU content
+#if (APS_AFFIX_LENGTH - APS_ASDU_OFFSET)
+ uint8_t footer[APS_AFFIX_LENGTH - APS_ASDU_OFFSET]; //Auxiliary footer (required by stack)
+#endif
+ BOTTOM_GUARD
+} ZclMmFrame_t;
+
+typedef enum
+{
+ ZCL_MM_BUFFER_FREE = 0x00,
+ ZCL_MM_BUFFER_BUSY = 0x01
+} ZclMmBufferBusy_t;
+
+typedef struct
+{
+ ZclMmPrimitive_t primitive;
+ ZclMmFrame_t frame;
+} ZclMmBuffer_t;
+
+typedef struct
+{
+ uint8_t busy; //ZclMmBufferBusy_t should be used
+ ZclMmBuffer_t buf;
+} ZclMmBufferDescriptor_t;
+
+/******************************************************************************
+ Prototypes section
+******************************************************************************/
+/*************************************************************************//**
+\brief Looks for and return free zcl memory buffer
+
+\return pointer to memory buffer or NULL if there is no free buffer.
+*****************************************************************************/
+ZclMmBuffer_t *zclMmGetMem(void);
+
+/*************************************************************************//**
+\brief Makes free zcl busy buffer
+
+\param[in] mem - pointer to used zcl buffer
+*****************************************************************************/
+void zclMmFreeMem(ZclMmBuffer_t *mem);
+
+#endif //#ifndef _ZCLMEMORYMANAGER_H
+
+
+//eof zclMemoryManager.h