long dao / nRF51822

Dependents:   VNG_BLE_Basic

Fork of nRF51822 by Nordic Semiconductor

Committer:
bogdanm
Date:
Wed Mar 26 14:38:17 2014 +0000
Revision:
0:eff01767de02
Initial import of the nRF51822 code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 0:eff01767de02 1 /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
bogdanm 0:eff01767de02 2 *
bogdanm 0:eff01767de02 3 * The information contained herein is property of Nordic Semiconductor ASA.
bogdanm 0:eff01767de02 4 * Terms and conditions of usage are described in detail in NORDIC
bogdanm 0:eff01767de02 5 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
bogdanm 0:eff01767de02 6 *
bogdanm 0:eff01767de02 7 * Licensees are granted free, non-transferable use of the information. NO
bogdanm 0:eff01767de02 8 * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
bogdanm 0:eff01767de02 9 * the file.
bogdanm 0:eff01767de02 10 *
bogdanm 0:eff01767de02 11 */
bogdanm 0:eff01767de02 12
bogdanm 0:eff01767de02 13 /** @file
bogdanm 0:eff01767de02 14 *
bogdanm 0:eff01767de02 15 * @defgroup rpc_cmd_defines Defines related to serialized BLE commands.
bogdanm 0:eff01767de02 16 * @{
bogdanm 0:eff01767de02 17 * @ingroup ble_sdk_lib
bogdanm 0:eff01767de02 18 *
bogdanm 0:eff01767de02 19 * @brief Defines for serialized BLE commands.
bogdanm 0:eff01767de02 20 *
bogdanm 0:eff01767de02 21 */
bogdanm 0:eff01767de02 22
bogdanm 0:eff01767de02 23 #ifndef BLE_RPC_DEFINES_H__
bogdanm 0:eff01767de02 24 #define BLE_RPC_DEFINES_H__
bogdanm 0:eff01767de02 25
bogdanm 0:eff01767de02 26 #define RPC_CMD_OP_CODE_POS 0 /**< Position of the Op Code in the command buffer.*/
bogdanm 0:eff01767de02 27 #define RPC_CMD_DATA_POS 1 /**< Position of the data in the command buffer.*/
bogdanm 0:eff01767de02 28
bogdanm 0:eff01767de02 29 #define RPC_CMD_RESP_PKT_TYPE_POS 0 /**< Position of Packet type in the command response buffer.*/
bogdanm 0:eff01767de02 30 #define RPC_CMD_RESP_OP_CODE_POS 1 /**< Position of the Op Code in the command response buffer.*/
bogdanm 0:eff01767de02 31 #define RPC_CMD_RESP_STATUS_POS 2 /**< Position of the status field in the command response buffer.*/
bogdanm 0:eff01767de02 32
bogdanm 0:eff01767de02 33 #define RPC_BLE_FIELD_LEN 1 /**< Optional field length size in bytes. */
bogdanm 0:eff01767de02 34 #define RPC_BLE_FIELD_PRESENT 0x01 /**< Value to indicate that an optional field is encoded in the serialized packet, e.g. white list. */
bogdanm 0:eff01767de02 35 #define RPC_BLE_FIELD_NOT_PRESENT 0x00 /**< Value to indicate that an optional field is not encoded in the serialized packet. */
bogdanm 0:eff01767de02 36
bogdanm 0:eff01767de02 37 #define RPC_ERR_CODE_SIZE 4 /**< BLE API err_code size in bytes. */
bogdanm 0:eff01767de02 38 #define BLE_PKT_TYPE_SIZE 1 /**< Packet type (@ref ble_rpc_pkt_type_t) field size in bytes. */
bogdanm 0:eff01767de02 39 #define BLE_OP_CODE_SIZE 1 /**< Operation code field size in bytes. */
bogdanm 0:eff01767de02 40
bogdanm 0:eff01767de02 41 #define RPC_BLE_CMD_RESP_PKT_MIN_SIZE 6 /**< Minimum length of a command response. */
bogdanm 0:eff01767de02 42 #define RPC_BLE_PKT_MAX_SIZE 596 /**< Maximum size for a BLE packet on the HCI Transport layer. This value is the hci_mem_pool buffer size minus the HCI Transport size. @note This value must be aligned with TX_BUF_SIZE in hci_mem_pool_internal.h. */
bogdanm 0:eff01767de02 43
bogdanm 0:eff01767de02 44 /**@brief The types of packets. */
bogdanm 0:eff01767de02 45 typedef enum
bogdanm 0:eff01767de02 46 {
bogdanm 0:eff01767de02 47 BLE_RPC_PKT_CMD, /**< Command packet type. */
bogdanm 0:eff01767de02 48 BLE_RPC_PKT_RESP, /**< Command Response packet type. */
bogdanm 0:eff01767de02 49 BLE_RPC_PKT_EVT, /**< Event packet type. */
bogdanm 0:eff01767de02 50 BLE_RPC_PKT_TYPE_MAX /**< Upper bound. */
bogdanm 0:eff01767de02 51 } ble_rpc_pkt_type_t;
bogdanm 0:eff01767de02 52
bogdanm 0:eff01767de02 53 #endif // BLE_RPC_DEFINES_H__
bogdanm 0:eff01767de02 54
bogdanm 0:eff01767de02 55 /** @} */