Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of X_NUCLEO_IDB0XA1 by
bluenrg_l2cap_aci.c
00001 /******************** (C) COPYRIGHT 2013 STMicroelectronics ******************** 00002 * File Name : bluenrg_hci.c 00003 * Author : AMS - HEA&RF BU 00004 * Version : V1.0.0 00005 * Date : 4-Oct-2013 00006 * Description : File with HCI commands for BlueNRG FW6.0 and above. 00007 ******************************************************************************** 00008 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 00009 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 00010 * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 00012 * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 00013 * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 00014 *******************************************************************************/ 00015 00016 #include "ble_hal_types.h" 00017 #include "ble_osal.h" 00018 #include "ble_status.h" 00019 #include "ble_hal.h" 00020 #include "ble_osal.h" 00021 #include "ble_hci_const.h" 00022 #include "bluenrg_aci_const.h" 00023 #include "bluenrg_hal_aci.h" 00024 #include "bluenrg_gap.h" 00025 00026 #define MIN(a,b) ((a) < (b) )? (a) : (b) 00027 #define MAX(a,b) ((a) > (b) )? (a) : (b) 00028 00029 tBleStatus aci_l2cap_connection_parameter_update_request(uint16_t conn_handle, uint16_t interval_min, 00030 uint16_t interval_max, uint16_t slave_latency, 00031 uint16_t timeout_multiplier) 00032 { 00033 struct hci_request rq; 00034 uint8_t status; 00035 l2cap_conn_param_update_req_cp cp; 00036 00037 cp.conn_handle = htobs(conn_handle); 00038 cp.interval_min = htobs(interval_min); 00039 cp.interval_max = htobs(interval_max); 00040 cp.slave_latency = htobs(slave_latency); 00041 cp.timeout_multiplier = htobs(timeout_multiplier); 00042 00043 Osal_MemSet(&rq, 0, sizeof(rq)); 00044 rq.ogf = OGF_VENDOR_CMD; 00045 rq.ocf = OCF_L2CAP_CONN_PARAM_UPDATE_REQ; 00046 rq.cparam = &cp; 00047 rq.clen = L2CAP_CONN_PARAM_UPDATE_REQ_CP_SIZE; 00048 rq.event = EVT_CMD_STATUS; 00049 rq.rparam = &status; 00050 rq.rlen = 1; 00051 00052 if (hci_send_req(&rq, FALSE) < 0) 00053 return BLE_STATUS_TIMEOUT; 00054 00055 return status; 00056 } 00057 00058 tBleStatus aci_l2cap_connection_parameter_update_response_IDB05A1(uint16_t conn_handle, uint16_t interval_min, 00059 uint16_t interval_max, uint16_t slave_latency, 00060 uint16_t timeout_multiplier, uint16_t min_ce_length, uint16_t max_ce_length, 00061 uint8_t id, uint8_t accept) 00062 { 00063 struct hci_request rq; 00064 uint8_t status; 00065 l2cap_conn_param_update_resp_cp_IDB05A1 cp; 00066 00067 cp.conn_handle = htobs(conn_handle); 00068 cp.interval_min = htobs(interval_min); 00069 cp.interval_max = htobs(interval_max); 00070 cp.slave_latency = htobs(slave_latency); 00071 cp.timeout_multiplier = htobs(timeout_multiplier); 00072 cp.min_ce_length = htobs(min_ce_length); 00073 cp.max_ce_length = htobs(max_ce_length); 00074 cp.id = id; 00075 cp.accept = accept; 00076 00077 Osal_MemSet(&rq, 0, sizeof(rq)); 00078 rq.ogf = OGF_VENDOR_CMD; 00079 rq.ocf = OCF_L2CAP_CONN_PARAM_UPDATE_RESP; 00080 rq.cparam = &cp; 00081 rq.clen = sizeof(cp); 00082 rq.rparam = &status; 00083 rq.rlen = 1; 00084 00085 if (hci_send_req(&rq, FALSE) < 0) 00086 return BLE_STATUS_TIMEOUT; 00087 00088 return status; 00089 } 00090 tBleStatus aci_l2cap_connection_parameter_update_response_IDB04A1(uint16_t conn_handle, uint16_t interval_min, 00091 uint16_t interval_max, uint16_t slave_latency, 00092 uint16_t timeout_multiplier, uint8_t id, uint8_t accept) 00093 { 00094 struct hci_request rq; 00095 uint8_t status; 00096 l2cap_conn_param_update_resp_cp_IDB04A1 cp; 00097 00098 cp.conn_handle = htobs(conn_handle); 00099 cp.interval_min = htobs(interval_min); 00100 cp.interval_max = htobs(interval_max); 00101 cp.slave_latency = htobs(slave_latency); 00102 cp.timeout_multiplier = htobs(timeout_multiplier); 00103 cp.id = id; 00104 cp.accept = accept; 00105 00106 Osal_MemSet(&rq, 0, sizeof(rq)); 00107 rq.ogf = OGF_VENDOR_CMD; 00108 rq.ocf = OCF_L2CAP_CONN_PARAM_UPDATE_RESP; 00109 rq.cparam = &cp; 00110 rq.clen = sizeof(cp); 00111 rq.rparam = &status; 00112 rq.rlen = 1; 00113 00114 if (hci_send_req(&rq, FALSE) < 0) 00115 return BLE_STATUS_TIMEOUT; 00116 00117 return status; 00118 }
Generated on Thu Jul 14 2022 09:39:26 by
1.7.2
