conn_mw.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. *
  11. */
  12. #ifndef _CONN_MW_H
  13. #define _CONN_MW_H
  14. #include <stdint.h>
  15. /**@brief Connectivity Middleware dispatcher function
  16. *
  17. * @details It will handle decode the opcode from RX buffer and based on the opcode it will search
  18. * for registered handler. Handler is called once it is found.
  19. *
  20. * @param[in] p_rx_buf Pointer to input buffer.
  21. * @param[in] rx_buf_len Size of p_rx_buf.
  22. * @param[out] p_tx_buf Pointer to output buffer.
  23. * @param[in,out] p_tx_buf_len \c in: size of \p p_tx_buf buffer.
  24. * \c out: Length of valid data in \p p_tx_buf.
  25. *
  26. * @retval NRF_SUCCESS Handler success.
  27. * @retval NRF_ERROR_NULL Handler failure. NULL pointer supplied.
  28. * @retval NRF_ERROR_INVALID_LENGTH Handler failure. Incorrect buffer length.
  29. * @retval NRF_ERROR_INVALID_PARAM Handler failure. Invalid operation type.
  30. * @retval NRF_ERROR_NOT_SUPPORTED Handler failure. Opcode not supported.
  31. */
  32. uint32_t conn_mw_handler (uint8_t const * const p_rx_buf,
  33. uint32_t rx_buf_len,
  34. uint8_t * const p_tx_buf,
  35. uint32_t * const p_tx_buf_len);
  36. #endif //_CONN_MW_H