Nordic stack and drivers for the mbed BLE API Modified for HRM1017 for library 0.1.0
Fork of nRF51822 by
ble_racp.h
00001 /* Copyright (c) 2012 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 /** @file 00013 * 00014 * @defgroup ble_sdk_lib_racp Record Access Control Point 00015 * @{ 00016 * @ingroup ble_sdk_lib 00017 * @brief Record Access Control Point library. 00018 */ 00019 00020 #ifndef BLE_RACP_H__ 00021 #define BLE_RACP_H__ 00022 00023 #include <stdint.h> 00024 #include <stdbool.h> 00025 #include "ble.h" 00026 #include "ble_types.h" 00027 #include "ble.h" 00028 00029 /**@brief Record Access Control Point opcodes. */ 00030 #define RACP_OPCODE_RESERVED 0 /**< Record Access Control Point opcode - Reserved for future use. */ 00031 #define RACP_OPCODE_REPORT_RECS 1 /**< Record Access Control Point opcode - Report stored records. */ 00032 #define RACP_OPCODE_DELETE_RECS 2 /**< Record Access Control Point opcode - Delete stored records. */ 00033 #define RACP_OPCODE_ABORT_OPERATION 3 /**< Record Access Control Point opcode - Abort operation. */ 00034 #define RACP_OPCODE_REPORT_NUM_RECS 4 /**< Record Access Control Point opcode - Report number of stored records. */ 00035 #define RACP_OPCODE_NUM_RECS_RESPONSE 5 /**< Record Access Control Point opcode - Number of stored records response. */ 00036 #define RACP_OPCODE_RESPONSE_CODE 6 /**< Record Access Control Point opcode - Response code. */ 00037 00038 /**@brief Record Access Control Point operators. */ 00039 #define RACP_OPERATOR_NULL 0 /**< Record Access Control Point operator - Null. */ 00040 #define RACP_OPERATOR_ALL 1 /**< Record Access Control Point operator - All records. */ 00041 #define RACP_OPERATOR_LESS_OR_EQUAL 2 /**< Record Access Control Point operator - Less than or equal to. */ 00042 #define RACP_OPERATOR_GREATER_OR_EQUAL 3 /**< Record Access Control Point operator - Greater than or equal to. */ 00043 #define RACP_OPERATOR_RANGE 4 /**< Record Access Control Point operator - Within range of (inclusive). */ 00044 #define RACP_OPERATOR_FIRST 5 /**< Record Access Control Point operator - First record (i.e. oldest record). */ 00045 #define RACP_OPERATOR_LAST 6 /**< Record Access Control Point operator - Last record (i.e. most recent record). */ 00046 #define RACP_OPERATOR_RFU_START 7 /**< Record Access Control Point operator - Start of Reserved for Future Use area. */ 00047 00048 /**@brief Record Access Control Point response codes. */ 00049 #define RACP_RESPONSE_RESERVED 0 /**< Record Access Control Point response code - Reserved for future use. */ 00050 #define RACP_RESPONSE_SUCCESS 1 /**< Record Access Control Point response code - Successful operation. */ 00051 #define RACP_RESPONSE_OPCODE_UNSUPPORTED 2 /**< Record Access Control Point response code - Unsupported op code received. */ 00052 #define RACP_RESPONSE_INVALID_OPERATOR 3 /**< Record Access Control Point response code - Operator not valid for service. */ 00053 #define RACP_RESPONSE_OPERATOR_UNSUPPORTED 4 /**< Record Access Control Point response code - Unsupported operator. */ 00054 #define RACP_RESPONSE_INVALID_OPERAND 5 /**< Record Access Control Point response code - Operand not valid for service. */ 00055 #define RACP_RESPONSE_NO_RECORDS_FOUND 6 /**< Record Access Control Point response code - No matching records found. */ 00056 #define RACP_RESPONSE_ABORT_FAILED 7 /**< Record Access Control Point response code - Abort could not be completed. */ 00057 #define RACP_RESPONSE_PROCEDURE_NOT_DONE 8 /**< Record Access Control Point response code - Procedure could not be completed. */ 00058 #define RACP_RESPONSE_OPERAND_UNSUPPORTED 9 /**< Record Access Control Point response code - Unsupported operand. */ 00059 00060 /**@brief Record Access Control Point value structure. */ 00061 typedef struct 00062 { 00063 uint8_t opcode; /**< Op Code. */ 00064 uint8_t operator; /**< Operator. */ 00065 uint8_t operand_len; /**< Length of the operand. */ 00066 uint8_t * p_operand; /**< Pointer to the operand. */ 00067 } ble_racp_value_t; 00068 00069 /**@brief Function for decoding a Record Access Control Point write. 00070 * 00071 * @details This call decodes a write to the Record Access Control Point. 00072 * 00073 * @param[in] data_len Length of data in received write. 00074 * @param[in] p_data Pointer to received data. 00075 * @param[out] p_racp_val Pointer to decoded Record Access Control Point write. 00076 * @note This does not do a data copy. It assumes the data pointed to by 00077 * p_data is persistant until no longer needed. 00078 */ 00079 void ble_racp_decode(uint8_t data_len, uint8_t * p_data, ble_racp_value_t * p_racp_val); 00080 00081 /**@brief Function for encoding a Record Access Control Point response. 00082 * 00083 * @details This call encodes a response from the Record Access Control Point response. 00084 * 00085 * @param[in] p_racp_val Pointer to Record Access Control Point to encode. 00086 * @param[out] p_data Pointer to where encoded data is written. 00087 * NOTE! It is calling routines respsonsibility to make sure. 00088 * 00089 * @return Length of encoded data. 00090 */ 00091 uint8_t ble_racp_encode(const ble_racp_value_t * p_racp_val, uint8_t * p_data); 00092 00093 #endif // BLE_RACP_H__ 00094 00095 /** @} */ 00096 00097 /** @endcond */
Generated on Tue Jul 12 2022 14:11:55 by 1.7.2