my fork
inc/bluenrg_l2cap_aci.h@4:987b201ec4b1, 2015-04-08 (annotated)
- Committer:
- filartrix
- Date:
- Wed Apr 08 14:17:20 2015 +0000
- Revision:
- 4:987b201ec4b1
first
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
filartrix | 4:987b201ec4b1 | 1 | /******************** (C) COPYRIGHT 2014 STMicroelectronics ******************** |
filartrix | 4:987b201ec4b1 | 2 | * File Name : bluenrg_l2cap_aci.h |
filartrix | 4:987b201ec4b1 | 3 | * Author : AMS - HEA&RF BU |
filartrix | 4:987b201ec4b1 | 4 | * Version : V1.0.0 |
filartrix | 4:987b201ec4b1 | 5 | * Date : 26-Jun-2014 |
filartrix | 4:987b201ec4b1 | 6 | * Description : Header file with L2CAP commands for BlueNRG FW6.3. |
filartrix | 4:987b201ec4b1 | 7 | ******************************************************************************** |
filartrix | 4:987b201ec4b1 | 8 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS |
filartrix | 4:987b201ec4b1 | 9 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. |
filartrix | 4:987b201ec4b1 | 10 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, |
filartrix | 4:987b201ec4b1 | 11 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE |
filartrix | 4:987b201ec4b1 | 12 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING |
filartrix | 4:987b201ec4b1 | 13 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. |
filartrix | 4:987b201ec4b1 | 14 | *******************************************************************************/ |
filartrix | 4:987b201ec4b1 | 15 | |
filartrix | 4:987b201ec4b1 | 16 | #ifndef __BLUENRG_L2CAP_ACI_H__ |
filartrix | 4:987b201ec4b1 | 17 | #define __BLUENRG_L2CAP_ACI_H__ |
filartrix | 4:987b201ec4b1 | 18 | |
filartrix | 4:987b201ec4b1 | 19 | /** |
filartrix | 4:987b201ec4b1 | 20 | *@defgroup L2CAP_Functions L2CAP functions |
filartrix | 4:987b201ec4b1 | 21 | *@brief API for L2CAP layer. |
filartrix | 4:987b201ec4b1 | 22 | *@{ |
filartrix | 4:987b201ec4b1 | 23 | */ |
filartrix | 4:987b201ec4b1 | 24 | |
filartrix | 4:987b201ec4b1 | 25 | /** |
filartrix | 4:987b201ec4b1 | 26 | * @brief Send an L2CAP Connection Parameter Update request from the slave to the master. |
filartrix | 4:987b201ec4b1 | 27 | * @note An @ref EVT_BLUE_L2CAP_CONN_UPD_RESP event will be raised when the master will respond to the request |
filartrix | 4:987b201ec4b1 | 28 | * (accepts or rejects). |
filartrix | 4:987b201ec4b1 | 29 | * @param conn_handle Connection handle on which the connection parameter update request has to be sent. |
filartrix | 4:987b201ec4b1 | 30 | * @param interval_min Defines minimum value for the connection event interval in the following manner: |
filartrix | 4:987b201ec4b1 | 31 | * connIntervalMin = interval_min x 1.25ms |
filartrix | 4:987b201ec4b1 | 32 | * @param interval_max Defines maximum value for the connection event interval in the following manner: |
filartrix | 4:987b201ec4b1 | 33 | * connIntervalMax = interval_max x 1.25ms |
filartrix | 4:987b201ec4b1 | 34 | * @param slave_latency Defines the slave latency parameter (number of connection events that can be skipped). |
filartrix | 4:987b201ec4b1 | 35 | * @param timeout_multiplier Defines connection timeout parameter in the following manner: |
filartrix | 4:987b201ec4b1 | 36 | * timeout_multiplier x 10ms. |
filartrix | 4:987b201ec4b1 | 37 | * @return Value indicating success or error code. |
filartrix | 4:987b201ec4b1 | 38 | */ |
filartrix | 4:987b201ec4b1 | 39 | tBleStatus aci_l2cap_connection_parameter_update_request(uint16_t conn_handle, uint16_t interval_min, |
filartrix | 4:987b201ec4b1 | 40 | uint16_t interval_max, uint16_t slave_latency, |
filartrix | 4:987b201ec4b1 | 41 | uint16_t timeout_multiplier); |
filartrix | 4:987b201ec4b1 | 42 | /** |
filartrix | 4:987b201ec4b1 | 43 | * @brief Accept or reject a connection update. |
filartrix | 4:987b201ec4b1 | 44 | * @note This command should be sent in response to a @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event from the controller. |
filartrix | 4:987b201ec4b1 | 45 | * The accept parameter has to be set if the connection parameters given in the event are acceptable. |
filartrix | 4:987b201ec4b1 | 46 | * @param conn_handle Handle received in @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event. |
filartrix | 4:987b201ec4b1 | 47 | * @param interval_min |
filartrix | 4:987b201ec4b1 | 48 | * @param interval_max |
filartrix | 4:987b201ec4b1 | 49 | * @param slave_latency |
filartrix | 4:987b201ec4b1 | 50 | * @param timeout_multiplier |
filartrix | 4:987b201ec4b1 | 51 | * @param id |
filartrix | 4:987b201ec4b1 | 52 | * @param accept |
filartrix | 4:987b201ec4b1 | 53 | * @return |
filartrix | 4:987b201ec4b1 | 54 | */ |
filartrix | 4:987b201ec4b1 | 55 | tBleStatus aci_l2cap_connection_parameter_update_response(uint16_t conn_handle, uint16_t interval_min, |
filartrix | 4:987b201ec4b1 | 56 | uint16_t interval_max, uint16_t slave_latency, |
filartrix | 4:987b201ec4b1 | 57 | uint16_t timeout_multiplier, uint8_t id, uint8_t accept); |
filartrix | 4:987b201ec4b1 | 58 | |
filartrix | 4:987b201ec4b1 | 59 | /** |
filartrix | 4:987b201ec4b1 | 60 | * @} |
filartrix | 4:987b201ec4b1 | 61 | */ |
filartrix | 4:987b201ec4b1 | 62 | |
filartrix | 4:987b201ec4b1 | 63 | /** |
filartrix | 4:987b201ec4b1 | 64 | * @defgroup L2CAP_Events L2CAP events |
filartrix | 4:987b201ec4b1 | 65 | * @{ |
filartrix | 4:987b201ec4b1 | 66 | */ |
filartrix | 4:987b201ec4b1 | 67 | |
filartrix | 4:987b201ec4b1 | 68 | /** |
filartrix | 4:987b201ec4b1 | 69 | * This event is generated when the master responds to the L2CAP connection update request packet. |
filartrix | 4:987b201ec4b1 | 70 | * For more info see CONNECTION PARAMETER UPDATE RESPONSE in Bluetooth Core v4.0 spec. |
filartrix | 4:987b201ec4b1 | 71 | */ |
filartrix | 4:987b201ec4b1 | 72 | #define EVT_BLUE_L2CAP_CONN_UPD_RESP (0x0800) |
filartrix | 4:987b201ec4b1 | 73 | typedef __packed struct _evt_l2cap_conn_upd_resp{ |
filartrix | 4:987b201ec4b1 | 74 | uint16_t conn_handle; |
filartrix | 4:987b201ec4b1 | 75 | uint8_t resp_len; |
filartrix | 4:987b201ec4b1 | 76 | uint8_t code; /**< It will always be 0x13 */ |
filartrix | 4:987b201ec4b1 | 77 | uint8_t identifier; |
filartrix | 4:987b201ec4b1 | 78 | uint16_t l2cap_length; |
filartrix | 4:987b201ec4b1 | 79 | uint16_t result; |
filartrix | 4:987b201ec4b1 | 80 | } PACKED evt_l2cap_conn_upd_resp; |
filartrix | 4:987b201ec4b1 | 81 | |
filartrix | 4:987b201ec4b1 | 82 | /** |
filartrix | 4:987b201ec4b1 | 83 | * This event is generated when the master does not respond to the connection update request |
filartrix | 4:987b201ec4b1 | 84 | * within 30 seconds. |
filartrix | 4:987b201ec4b1 | 85 | */ |
filartrix | 4:987b201ec4b1 | 86 | #define EVT_BLUE_L2CAP_PROCEDURE_TIMEOUT (0x0801) |
filartrix | 4:987b201ec4b1 | 87 | |
filartrix | 4:987b201ec4b1 | 88 | /** |
filartrix | 4:987b201ec4b1 | 89 | * The event is given by the L2CAP layer when a connection update request is received from the slave. |
filartrix | 4:987b201ec4b1 | 90 | * The application has to respond by calling aci_l2cap_connection_parameter_update_response(). |
filartrix | 4:987b201ec4b1 | 91 | */ |
filartrix | 4:987b201ec4b1 | 92 | #define EVT_BLUE_L2CAP_CONN_UPD_REQ (0x0802) |
filartrix | 4:987b201ec4b1 | 93 | typedef __packed struct _evt_l2cap_conn_upd_req{ |
filartrix | 4:987b201ec4b1 | 94 | uint16_t conn_handle; |
filartrix | 4:987b201ec4b1 | 95 | uint8_t resp_len; |
filartrix | 4:987b201ec4b1 | 96 | uint8_t code; /**< It will always be 0x12 */ |
filartrix | 4:987b201ec4b1 | 97 | uint8_t identifier; |
filartrix | 4:987b201ec4b1 | 98 | uint16_t l2cap_length; |
filartrix | 4:987b201ec4b1 | 99 | uint16_t interval_min; |
filartrix | 4:987b201ec4b1 | 100 | uint16_t interval_max; |
filartrix | 4:987b201ec4b1 | 101 | uint16_t slave_latency; |
filartrix | 4:987b201ec4b1 | 102 | uint16_t timeout_mult; |
filartrix | 4:987b201ec4b1 | 103 | } PACKED evt_l2cap_conn_upd_req; |
filartrix | 4:987b201ec4b1 | 104 | |
filartrix | 4:987b201ec4b1 | 105 | /** |
filartrix | 4:987b201ec4b1 | 106 | * @} |
filartrix | 4:987b201ec4b1 | 107 | */ |
filartrix | 4:987b201ec4b1 | 108 | |
filartrix | 4:987b201ec4b1 | 109 | |
filartrix | 4:987b201ec4b1 | 110 | #endif /* __BLUENRG_L2CAP_ACI_H__ */ |
filartrix | 4:987b201ec4b1 | 111 |