BLE temperature profile using digital DS1820 or analog LM35 sensors

Dependencies:   DS1820

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ble_rpc_defines.h Source File

ble_rpc_defines.h

Go to the documentation of this file.
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 rpc_cmd_defines Defines related to serialized BLE commands.
00016  * @{
00017  * @ingroup ble_sdk_lib
00018  *
00019  * @brief Defines for serialized BLE commands.
00020  *
00021  */
00022  
00023 #ifndef BLE_RPC_DEFINES_H__
00024 #define BLE_RPC_DEFINES_H__
00025 
00026 #define RPC_CMD_OP_CODE_POS                     0                      /**< Position of the Op Code in the command buffer.*/
00027 #define RPC_CMD_DATA_POS                        1                      /**< Position of the data in the command buffer.*/
00028 
00029 #define RPC_CMD_RESP_PKT_TYPE_POS               0                      /**< Position of Packet type  in the command response buffer.*/
00030 #define RPC_CMD_RESP_OP_CODE_POS                1                      /**< Position of the Op Code in the command response buffer.*/
00031 #define RPC_CMD_RESP_STATUS_POS                 2                      /**< Position of the status field in the command response buffer.*/
00032 
00033 #define RPC_BLE_FIELD_LEN                       1                      /**< Optional field length size in bytes. */
00034 #define RPC_BLE_FIELD_PRESENT                   0x01                   /**< Value to indicate that an optional field is encoded in the serialized packet, e.g. white list. */
00035 #define RPC_BLE_FIELD_NOT_PRESENT               0x00                   /**< Value to indicate that an optional field is not encoded in the serialized packet. */
00036 
00037 #define RPC_ERR_CODE_SIZE                       4                      /**< BLE API err_code size in bytes. */
00038 #define BLE_PKT_TYPE_SIZE                       1                      /**< Packet type (@ref ble_rpc_pkt_type_t) field size in bytes. */
00039 #define BLE_OP_CODE_SIZE                        1                      /**< Operation code field size in bytes. */
00040 
00041 #define RPC_BLE_CMD_RESP_PKT_MIN_SIZE           6                      /**< Minimum length of a command response. */
00042 #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. */
00043 
00044 /**@brief The types of packets. */
00045 typedef enum
00046 {
00047     BLE_RPC_PKT_CMD,                                                   /**< Command packet type. */
00048     BLE_RPC_PKT_RESP,                                                  /**< Command Response packet type. */
00049     BLE_RPC_PKT_EVT,                                                   /**< Event packet type. */
00050     BLE_RPC_PKT_TYPE_MAX                                               /**< Upper bound. */
00051 } ble_rpc_pkt_type_t;
00052 
00053 #endif // BLE_RPC_DEFINES_H__
00054 
00055 /** @} */