Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of nRF51822 by
ble_rpc_cmd_encoder.h
00001 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. 00002 * 00003 * The information contained herein is property of Nordic Semiconductor ASA. 00004 * Terms and conditions of usage are described in detail in NORDIC 00005 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 00006 * 00007 * Licensees are granted free, non-transferable use of the information. NO 00008 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from 00009 * the file. 00010 * 00011 */ 00012 00013 /** @file 00014 * 00015 * @defgroup ble_rpc_cmd_encoder Command Encoder 00016 * @{ 00017 * @ingroup ble_sdk_lib_serialization 00018 * 00019 * @brief Encoder for serialized commands from Application Chip. 00020 * 00021 * @details This file contains the declaration of the functions that encode serialized commands 00022 * from Application Chip. 00023 */ 00024 00025 #ifndef BLE_RPC_CMD_ENCODER_H__ 00026 #define BLE_RPC_CMD_ENCODER_H__ 00027 00028 #include <stdint.h> 00029 #include "ble_rpc_defines.h " 00030 00031 /**@brief Command response type. */ 00032 typedef struct 00033 { 00034 uint8_t op_code; /**< Operation code for which this response applies. */ 00035 uint32_t err_code; /**< Error code received for this response applies. */ 00036 } cmd_response_t; 00037 00038 /**@brief Function for initializing the BLE S110 RPC Command Encoder module. 00039 * 00040 * @details This function uses the HCI Transport module, \ref hci_transport and executes 00041 * \ref hci_transport_tx_done_register and \ref hci_transport_tx_alloc . All errors 00042 * returned by those functions are passed on by this function. 00043 * 00044 * @retval NRF_SUCCESS Upon success 00045 * @return Errors from \ref hci_transport and \ref hci_transport_tx_alloc . 00046 */ 00047 uint32_t ble_rpc_cmd_encoder_init(void); 00048 00049 /**@brief Function for blocking in a loop, using WFE to allow low power mode, while awaiting a 00050 * response from the connectivity chip. 00051 * 00052 * @param[in] op_code The Operation Code for which a response message is expected. 00053 * 00054 * @return The decoded error code received from the connectivity chip. 00055 */ 00056 uint32_t ble_rpc_cmd_resp_wait(uint8_t op_code); 00057 00058 /**@brief Function for handling the command response packet. 00059 * 00060 * @details This function will be called when a command response is received in the transport 00061 * layer. The response is decoded and returned to the waiting caller. 00062 * 00063 * @param[in] p_packet The packet from the transport layer. 00064 * @param[in] packet_length The length of the packet. 00065 */ 00066 void ble_rpc_cmd_rsp_pkt_received(uint8_t * p_packet, uint16_t packet_length); 00067 00068 #endif // BLE_RPC_CMD_ENCODER_H__ 00069 00070 /**@} */
Generated on Tue Jul 12 2022 18:44:25 by
1.7.2
