peer_data.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Copyright (c) 2015 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 PEER_DATA_H__
  13. #define PEER_DATA_H__
  14. #include <stdint.h>
  15. #include "peer_manager_types.h"
  16. #include "peer_manager_internal.h"
  17. #include "fds.h"
  18. /**
  19. * @cond NO_DOXYGEN
  20. * @defgroup peer_data Peer Data
  21. * @ingroup peer_manager
  22. * @{
  23. * @brief An internal module of @ref peer_manager. This module defines the structure of the data
  24. * that is managed by the @ref peer_manager. It also provides functions for parsing the data.
  25. */
  26. /**@brief Function for enumerating the separate (non-contiguous) parts of the peer data.
  27. *
  28. * @param[in] p_peer_data The peer data to enumerate.
  29. * @param[out] p_chunks The resulting chunks. This must be an array of at least 2 elements.
  30. * @param[out] p_n_chunks The number of chunks. If this is 0, something went wrong.
  31. */
  32. void peer_data_parts_get(pm_peer_data_const_t const * p_peer_data, fds_record_chunk_t * p_chunks, uint16_t * p_n_chunks);
  33. /**@brief Function for converting @ref pm_peer_data_flash_t into @ref pm_peer_data_t.
  34. *
  35. * @param[in] p_in_data The source data.
  36. * @param[out] p_out_data The target data structure.
  37. *
  38. * @retval NRF_SUCCESS Successful conversion.
  39. * @retval NRF_ERROR_NULL A parameter was NULL.
  40. * @retval NRF_ERROR_NO_MEM A buffer was not large enough.
  41. */
  42. ret_code_t peer_data_deserialize(pm_peer_data_flash_t const * p_in_data, pm_peer_data_t * p_out_data);
  43. /** @}
  44. * @endcond
  45. */
  46. #endif /* PEER_DATA_H__ */