#ifndef cl_mbx_mbx_h #define cl_mbx_mbx_h /* Cesar project {{{ * * Copyright (C) 2012 Spidcom * * <<>> * * }}} */ /** * \file cl/mbx/mbx.h * \brief MBX Handler. * \ingroup cl_mbx */ #include "hal/ipmbox/ipmbox.h" /** * Use this callback to provide a received MME to the CP. * \param user user data * \param tei the station's source TEI * \param buffer the buffer containing the MME * \param length the MME length * \param encryption inform if the MF has been encrypted or not when it * arrives from the PWL */ typedef void (*cl_mme_callback_t) (void *user, uint tei, u8 *buffer, uint length, bool encryption); /** Forward declaration */ typedef struct cl_mbx_t cl_mbx_t; BEGIN_DECLS /** * Initialise the cl mbx handler. * \param ipmbox context * \param cb the callback * \param user_data the user data * \return the cl_mbx context */ cl_mbx_t* cl_mbx_init (ipmbox_t *ipmbox); /** * Uninitialise the context. * \param ctx the module context */ void cl_mbx_uninit (cl_mbx_t* ctx); /** * Register the callback to be called on MME reception. * \param ctx the module context * \param cb the callback * \param user_data the user data */ void cl_mbx_callback_register (cl_mbx_t *ctx, cl_mme_callback_t cb, void *user_data); /** * send a message through the MBX queue. * \param ctx the module context * \param buffer the buffer containing the data * \param length the length of the payload */ void cl_mbx_ipmbox_send (cl_mbx_t *ctx, u8 *buffer, uint length); END_DECLS #endif /* cl_mbx_mbx_h */