ser_conn_cmd_decoder.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. /**
  13. * @addtogroup ser_conn Connectivity application code
  14. * @ingroup ble_sdk_lib_serialization
  15. */
  16. /** @file
  17. *
  18. * @defgroup ser_cmd_decoder Command decoder in the connectivity chip
  19. * @{
  20. * @ingroup ser_conn
  21. *
  22. * @brief Decoder for serialized commands from an Application Chip.
  23. *
  24. * @details This file contains declaration of common function used for commands decoding and sending
  25. * responses back to an Application Chip after a command is processed.
  26. */
  27. #ifndef SER_CONN_CMD_DECODER_H__
  28. #define SER_CONN_CMD_DECODER_H__
  29. #include <stdint.h>
  30. /**@brief A function decodes an encoded command and sends a response to an Application Chip.
  31. *
  32. * @details The function decodes an encoded command and calls a SoftDevice API function when a
  33. * command decoder was found or forms a common response with error code
  34. * NRF_ERROR_NOT_SUPPORTED otherwise. Then the function sends a SoftDevice response or
  35. * the response with NRF_ERROR_NOT_SUPPORTED error code to an Application Chip.
  36. *
  37. * @param[in] p_command The encoded command.
  38. * @param[in] command_len Length of the encoded command including opcode.
  39. *
  40. * @retval NRF_SUCCESS Operation success.
  41. * @retval NRF_ERROR_NULL Operation failure. NULL pointer supplied.
  42. * @retval NRF_ERROR_INTERNAL Operation failure. Internal error ocurred. .
  43. */
  44. uint32_t ser_conn_command_process(uint8_t * p_command, uint16_t command_len);
  45. #endif /* SER_CONN_CMD_DECODER_H__ */
  46. /** @} */