bluetooth control motor

Dependents:   BLE_LED_IDB0XA1_demo MOTOR_BLE_V2 Motor_Ble_v1 Motor_Ble_v10223 ... more

Fork of X_NUCLEO_IDB0XA1 by ST

Committer:
Wolfgang Betz
Date:
Wed Oct 07 08:39:04 2015 +0200
Revision:
132:51056160fa4a
Child:
229:9981f62cdb1a
Andrea's version as of mail from 10/06/2015 05:56 PM

From: Andrea PALMIERI <andrea.palmieri@st.com>
To: Wolfgang BETZ <wolfgang.betz@st.com>, Rohit Grover <rohit.grover@arm.com>,
Antonio VILEI <antonio.vilei@st.com>, Mihail Stoyanov
<Mihail.Stoyanov@arm.com>
CC: Nicola CAPOVILLA <nicola.capovilla@st.com>, Silvio Lucio OLIVA
<silvio.oliva@st.com>, "jonathan.austin@arm.com" <jonathan.austin@arm.com>
Content-Class: urn:content-classes:message
Date: Tue, 6 Oct 2015 17:56:34 +0200
Subject: RE: Arduino Compatibility of X-NUCLEO-IDB04A1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 132:51056160fa4a 1 /******************** (C) COPYRIGHT 2014 STMicroelectronics ********************
Wolfgang Betz 132:51056160fa4a 2 * File Name : bluenrg_l2cap_aci.h
Wolfgang Betz 132:51056160fa4a 3 * Author : AMS - HEA&RF BU
Wolfgang Betz 132:51056160fa4a 4 * Version : V1.0.0
Wolfgang Betz 132:51056160fa4a 5 * Date : 26-Jun-2014
Wolfgang Betz 132:51056160fa4a 6 * Description : Header file with L2CAP commands for BlueNRG FW6.3.
Wolfgang Betz 132:51056160fa4a 7 ********************************************************************************
Wolfgang Betz 132:51056160fa4a 8 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
Wolfgang Betz 132:51056160fa4a 9 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
Wolfgang Betz 132:51056160fa4a 10 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
Wolfgang Betz 132:51056160fa4a 11 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
Wolfgang Betz 132:51056160fa4a 12 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
Wolfgang Betz 132:51056160fa4a 13 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
Wolfgang Betz 132:51056160fa4a 14 *******************************************************************************/
Wolfgang Betz 132:51056160fa4a 15
Wolfgang Betz 132:51056160fa4a 16 #ifndef __BLUENRG_L2CAP_ACI_H__
Wolfgang Betz 132:51056160fa4a 17 #define __BLUENRG_L2CAP_ACI_H__
Wolfgang Betz 132:51056160fa4a 18
Wolfgang Betz 132:51056160fa4a 19 /**
Wolfgang Betz 132:51056160fa4a 20 *@addtogroup L2CAP L2CAP
Wolfgang Betz 132:51056160fa4a 21 *@brief L2CAP layer.
Wolfgang Betz 132:51056160fa4a 22 *@{
Wolfgang Betz 132:51056160fa4a 23 */
Wolfgang Betz 132:51056160fa4a 24
Wolfgang Betz 132:51056160fa4a 25 /**
Wolfgang Betz 132:51056160fa4a 26 *@defgroup L2CAP_Functions L2CAP functions
Wolfgang Betz 132:51056160fa4a 27 *@brief API for L2CAP layer.
Wolfgang Betz 132:51056160fa4a 28 *@{
Wolfgang Betz 132:51056160fa4a 29 */
Wolfgang Betz 132:51056160fa4a 30
Wolfgang Betz 132:51056160fa4a 31 /**
Wolfgang Betz 132:51056160fa4a 32 * @brief Send an L2CAP Connection Parameter Update request from the slave to the master.
Wolfgang Betz 132:51056160fa4a 33 * @note An @ref EVT_BLUE_L2CAP_CONN_UPD_RESP event will be raised when the master will respond to the request
Wolfgang Betz 132:51056160fa4a 34 * (accepts or rejects).
Wolfgang Betz 132:51056160fa4a 35 * @param conn_handle Connection handle on which the connection parameter update request has to be sent.
Wolfgang Betz 132:51056160fa4a 36 * @param interval_min Defines minimum value for the connection event interval in the following manner:
Wolfgang Betz 132:51056160fa4a 37 * connIntervalMin = interval_min x 1.25ms
Wolfgang Betz 132:51056160fa4a 38 * @param interval_max Defines maximum value for the connection event interval in the following manner:
Wolfgang Betz 132:51056160fa4a 39 * connIntervalMax = interval_max x 1.25ms
Wolfgang Betz 132:51056160fa4a 40 * @param slave_latency Defines the slave latency parameter (number of connection events that can be skipped).
Wolfgang Betz 132:51056160fa4a 41 * @param timeout_multiplier Defines connection timeout parameter in the following manner:
Wolfgang Betz 132:51056160fa4a 42 * timeout_multiplier x 10ms.
Wolfgang Betz 132:51056160fa4a 43 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 44 */
Wolfgang Betz 132:51056160fa4a 45 tBleStatus aci_l2cap_connection_parameter_update_request(uint16_t conn_handle, uint16_t interval_min,
Wolfgang Betz 132:51056160fa4a 46 uint16_t interval_max, uint16_t slave_latency,
Wolfgang Betz 132:51056160fa4a 47 uint16_t timeout_multiplier);
Wolfgang Betz 132:51056160fa4a 48 /**
Wolfgang Betz 132:51056160fa4a 49 * @brief Accept or reject a connection update.
Wolfgang Betz 132:51056160fa4a 50 * @note This command should be sent in response to a @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event from the controller.
Wolfgang Betz 132:51056160fa4a 51 * The accept parameter has to be set if the connection parameters given in the event are acceptable.
Wolfgang Betz 132:51056160fa4a 52 * @param conn_handle Handle received in @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event.
Wolfgang Betz 132:51056160fa4a 53 * @param interval_min The connection interval parameter as received in the l2cap connection update request event
Wolfgang Betz 132:51056160fa4a 54 * @param interval_max The maximum connection interval parameter as received in the l2cap connection update request event.
Wolfgang Betz 132:51056160fa4a 55 * @param slave_latency The slave latency parameter as received in the l2cap connection update request event.
Wolfgang Betz 132:51056160fa4a 56 * @param timeout_multiplier The supervision connection timeout parameter as received in the l2cap connection update request event.
Wolfgang Betz 132:51056160fa4a 57 * @param min_ce_length Minimum length of connection event needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 58 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 59 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 60 * @param max_ce_length Maximum length of connection event needed for the LE connection.\n
Wolfgang Betz 132:51056160fa4a 61 * Range: 0x0000 - 0xFFFF\n
Wolfgang Betz 132:51056160fa4a 62 * Time = N x 0.625 msec.
Wolfgang Betz 132:51056160fa4a 63 * @param id Identifier received in @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event.
Wolfgang Betz 132:51056160fa4a 64 * @param accept @arg 0x00: The connection update parameters are not acceptable.
Wolfgang Betz 132:51056160fa4a 65 * @arg 0x01: The connection update parameters are acceptable.
Wolfgang Betz 132:51056160fa4a 66 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 67 */
Wolfgang Betz 132:51056160fa4a 68 tBleStatus aci_l2cap_connection_parameter_update_response_IDB05A1(uint16_t conn_handle, uint16_t interval_min,
Wolfgang Betz 132:51056160fa4a 69 uint16_t interval_max, uint16_t slave_latency,
Wolfgang Betz 132:51056160fa4a 70 uint16_t timeout_multiplier, uint16_t min_ce_length, uint16_t max_ce_length,
Wolfgang Betz 132:51056160fa4a 71 uint8_t id, uint8_t accept);
Wolfgang Betz 132:51056160fa4a 72 /**
Wolfgang Betz 132:51056160fa4a 73 * @brief Accept or reject a connection update.
Wolfgang Betz 132:51056160fa4a 74 * @note This command should be sent in response to a @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event from the controller.
Wolfgang Betz 132:51056160fa4a 75 * The accept parameter has to be set if the connection parameters given in the event are acceptable.
Wolfgang Betz 132:51056160fa4a 76 * @param conn_handle Handle received in @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event.
Wolfgang Betz 132:51056160fa4a 77 * @param interval_min The connection interval parameter as received in the l2cap connection update request event
Wolfgang Betz 132:51056160fa4a 78 * @param interval_max The maximum connection interval parameter as received in the l2cap connection update request event.
Wolfgang Betz 132:51056160fa4a 79 * @param slave_latency The slave latency parameter as received in the l2cap connection update request event.
Wolfgang Betz 132:51056160fa4a 80 * @param timeout_multiplier The supervision connection timeout parameter as received in the l2cap connection update request event.
Wolfgang Betz 132:51056160fa4a 81 * @param id Identifier received in @ref EVT_BLUE_L2CAP_CONN_UPD_REQ event.
Wolfgang Betz 132:51056160fa4a 82 * @param accept @arg 0x00: The connection update parameters are not acceptable.
Wolfgang Betz 132:51056160fa4a 83 * @arg 0x01: The connection update parameters are acceptable.
Wolfgang Betz 132:51056160fa4a 84 * @return Value indicating success or error code.
Wolfgang Betz 132:51056160fa4a 85 */
Wolfgang Betz 132:51056160fa4a 86 tBleStatus aci_l2cap_connection_parameter_update_response_IDB04A1(uint16_t conn_handle, uint16_t interval_min,
Wolfgang Betz 132:51056160fa4a 87 uint16_t interval_max, uint16_t slave_latency,
Wolfgang Betz 132:51056160fa4a 88 uint16_t timeout_multiplier, uint8_t id, uint8_t accept);
Wolfgang Betz 132:51056160fa4a 89
Wolfgang Betz 132:51056160fa4a 90 /**
Wolfgang Betz 132:51056160fa4a 91 * @}
Wolfgang Betz 132:51056160fa4a 92 */
Wolfgang Betz 132:51056160fa4a 93
Wolfgang Betz 132:51056160fa4a 94 /**
Wolfgang Betz 132:51056160fa4a 95 * @defgroup L2CAP_Events L2CAP events
Wolfgang Betz 132:51056160fa4a 96 * @{
Wolfgang Betz 132:51056160fa4a 97 */
Wolfgang Betz 132:51056160fa4a 98
Wolfgang Betz 132:51056160fa4a 99 /**
Wolfgang Betz 132:51056160fa4a 100 * This event is generated when the master responds to the L2CAP connection update request packet.
Wolfgang Betz 132:51056160fa4a 101 * For more info see CONNECTION PARAMETER UPDATE RESPONSE and COMMAND REJECT in Bluetooth Core v4.0 spec.
Wolfgang Betz 132:51056160fa4a 102 */
Wolfgang Betz 132:51056160fa4a 103 #define EVT_BLUE_L2CAP_CONN_UPD_RESP (0x0800)
Wolfgang Betz 132:51056160fa4a 104 typedef __packed struct _evt_l2cap_conn_upd_resp{
Wolfgang Betz 132:51056160fa4a 105 uint16_t conn_handle; /**< The connection handle related to the event. */
Wolfgang Betz 132:51056160fa4a 106 uint8_t event_data_length; /**< Length of following data. */
Wolfgang Betz 132:51056160fa4a 107 /**
Wolfgang Betz 132:51056160fa4a 108 * @li 0x13 in case of valid L2CAP Connection Parameter Update Response packet.
Wolfgang Betz 132:51056160fa4a 109 * @li 0x01 in case of Command Reject.
Wolfgang Betz 132:51056160fa4a 110 */
Wolfgang Betz 132:51056160fa4a 111 uint8_t code;
Wolfgang Betz 132:51056160fa4a 112 uint8_t identifier; /**< Identifier of the response. It is equal to the request. */
Wolfgang Betz 132:51056160fa4a 113 uint16_t l2cap_length; /**< Length of following data. It should always be 2 */
Wolfgang Betz 132:51056160fa4a 114 /**
Wolfgang Betz 132:51056160fa4a 115 * Result code (parameters accepted or rejected) in case of Connection Parameter Update
Wolfgang Betz 132:51056160fa4a 116 * Response (code=0x13) or reason code for rejection in case of Command Reject (code=0x01).
Wolfgang Betz 132:51056160fa4a 117 */
Wolfgang Betz 132:51056160fa4a 118 uint16_t result;
Wolfgang Betz 132:51056160fa4a 119 } PACKED evt_l2cap_conn_upd_resp;
Wolfgang Betz 132:51056160fa4a 120
Wolfgang Betz 132:51056160fa4a 121 /**
Wolfgang Betz 132:51056160fa4a 122 * This event is generated when the master does not respond to the connection update request
Wolfgang Betz 132:51056160fa4a 123 * within 30 seconds.
Wolfgang Betz 132:51056160fa4a 124 */
Wolfgang Betz 132:51056160fa4a 125 #define EVT_BLUE_L2CAP_PROCEDURE_TIMEOUT (0x0801)
Wolfgang Betz 132:51056160fa4a 126
Wolfgang Betz 132:51056160fa4a 127 /**
Wolfgang Betz 132:51056160fa4a 128 * The event is given by the L2CAP layer when a connection update request is received from the slave.
Wolfgang Betz 132:51056160fa4a 129 * The application has to respond by calling aci_l2cap_connection_parameter_update_response().
Wolfgang Betz 132:51056160fa4a 130 */
Wolfgang Betz 132:51056160fa4a 131 #define EVT_BLUE_L2CAP_CONN_UPD_REQ (0x0802)
Wolfgang Betz 132:51056160fa4a 132 typedef __packed struct _evt_l2cap_conn_upd_req{
Wolfgang Betz 132:51056160fa4a 133 /**
Wolfgang Betz 132:51056160fa4a 134 * Handle of the connection for which the connection update request has been received.
Wolfgang Betz 132:51056160fa4a 135 * The same handle has to be returned while responding to the event with the command
Wolfgang Betz 132:51056160fa4a 136 * aci_l2cap_connection_parameter_update_response().
Wolfgang Betz 132:51056160fa4a 137 */
Wolfgang Betz 132:51056160fa4a 138 uint16_t conn_handle;
Wolfgang Betz 132:51056160fa4a 139 uint8_t event_data_length; /**< Length of following data. */
Wolfgang Betz 132:51056160fa4a 140 /**
Wolfgang Betz 132:51056160fa4a 141 * This is the identifier which associates the request to the
Wolfgang Betz 132:51056160fa4a 142 * response. The same identifier has to be returned by the upper
Wolfgang Betz 132:51056160fa4a 143 * layer in the command aci_l2cap_connection_parameter_update_response().
Wolfgang Betz 132:51056160fa4a 144 */
Wolfgang Betz 132:51056160fa4a 145 uint8_t identifier;
Wolfgang Betz 132:51056160fa4a 146 uint16_t l2cap_length; /**< Length of the L2CAP connection update request. */
Wolfgang Betz 132:51056160fa4a 147 uint16_t interval_min; /**< Value as defined in Bluetooth 4.0 spec, Volume 3, Part A 4.20. */
Wolfgang Betz 132:51056160fa4a 148 uint16_t interval_max; /**< Value as defined in Bluetooth 4.0 spec, Volume 3, Part A 4.20. */
Wolfgang Betz 132:51056160fa4a 149 uint16_t slave_latency; /**< Value as defined in Bluetooth 4.0 spec, Volume 3, Part A 4.20. */
Wolfgang Betz 132:51056160fa4a 150 uint16_t timeout_mult; /**< Value as defined in Bluetooth 4.0 spec, Volume 3, Part A 4.20. */
Wolfgang Betz 132:51056160fa4a 151 } PACKED evt_l2cap_conn_upd_req;
Wolfgang Betz 132:51056160fa4a 152
Wolfgang Betz 132:51056160fa4a 153 /**
Wolfgang Betz 132:51056160fa4a 154 * @}
Wolfgang Betz 132:51056160fa4a 155 */
Wolfgang Betz 132:51056160fa4a 156
Wolfgang Betz 132:51056160fa4a 157 /**
Wolfgang Betz 132:51056160fa4a 158 * @}
Wolfgang Betz 132:51056160fa4a 159 */
Wolfgang Betz 132:51056160fa4a 160
Wolfgang Betz 132:51056160fa4a 161
Wolfgang Betz 132:51056160fa4a 162 #endif /* __BLUENRG_L2CAP_ACI_H__ */