[FL-2156] Switch to smaller radio stack. (#923)
* Switch to smaller radio stack. BleGlue: update params to match new stack. Update scripts * Git: set eol to lf
This commit is contained in:
@@ -139,7 +139,7 @@
|
||||
/**
|
||||
* Maximum supported ATT_MTU size
|
||||
*/
|
||||
#define CFG_BLE_MAX_ATT_MTU (489)
|
||||
#define CFG_BLE_MAX_ATT_MTU (256+128+16+8+4+2)
|
||||
|
||||
/**
|
||||
* Size of the storage area for Attribute values
|
||||
@@ -211,14 +211,36 @@
|
||||
#define CFG_BLE_VITERBI_MODE 1
|
||||
|
||||
/**
|
||||
* LL Only Mode
|
||||
* 1 : LL Only
|
||||
* 0 : LL + Host
|
||||
* BLE stack Options flags to be configured with:
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3
|
||||
* which are used to set following configuration bits:
|
||||
* (bit 0): 1: LL only
|
||||
* 0: LL + host
|
||||
* (bit 1): 1: no service change desc.
|
||||
* 0: with service change desc.
|
||||
* (bit 2): 1: device name Read-Only
|
||||
* 0: device name R/W
|
||||
* (bit 3): 1: extended advertizing supported [NOT SUPPORTED]
|
||||
* 0: extended advertizing not supported [NOT SUPPORTED]
|
||||
* (bit 4): 1: CS Algo #2 supported
|
||||
* 0: CS Algo #2 not supported
|
||||
* (bit 7): 1: LE Power Class 1
|
||||
* 0: LE Power Class 2-3
|
||||
* other bits: reserved (shall be set to 0)
|
||||
*/
|
||||
#define CFG_BLE_LL_ONLY 0
|
||||
/******************************************************************************
|
||||
* Transport Layer
|
||||
******************************************************************************/
|
||||
#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3)
|
||||
|
||||
/**
|
||||
* Queue length of BLE Event
|
||||
* This parameter defines the number of asynchronous events that can be stored in the HCI layer before
|
||||
|
@@ -67,24 +67,28 @@ bool ble_app_init() {
|
||||
SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet = {
|
||||
.Header = {{0,0,0}}, // Header unused
|
||||
.Param = {
|
||||
0, // pBleBufferAddress not used
|
||||
0, // BleBufferSize not used
|
||||
CFG_BLE_NUM_GATT_ATTRIBUTES,
|
||||
CFG_BLE_NUM_GATT_SERVICES,
|
||||
CFG_BLE_ATT_VALUE_ARRAY_SIZE,
|
||||
CFG_BLE_NUM_LINK,
|
||||
CFG_BLE_DATA_LENGTH_EXTENSION,
|
||||
CFG_BLE_PREPARE_WRITE_LIST_SIZE,
|
||||
CFG_BLE_MBLOCK_COUNT,
|
||||
CFG_BLE_MAX_ATT_MTU,
|
||||
CFG_BLE_SLAVE_SCA,
|
||||
CFG_BLE_MASTER_SCA,
|
||||
CFG_BLE_LSE_SOURCE,
|
||||
CFG_BLE_MAX_CONN_EVENT_LENGTH,
|
||||
CFG_BLE_HSE_STARTUP_TIME,
|
||||
CFG_BLE_VITERBI_MODE,
|
||||
CFG_BLE_LL_ONLY,
|
||||
0,
|
||||
.pBleBufferAddress = 0, // pBleBufferAddress not used
|
||||
.BleBufferSize = 0, // BleBufferSize not used
|
||||
.NumAttrRecord = CFG_BLE_NUM_GATT_ATTRIBUTES,
|
||||
.NumAttrServ = CFG_BLE_NUM_GATT_SERVICES,
|
||||
.AttrValueArrSize = CFG_BLE_ATT_VALUE_ARRAY_SIZE,
|
||||
.NumOfLinks = CFG_BLE_NUM_LINK,
|
||||
.ExtendedPacketLengthEnable = CFG_BLE_DATA_LENGTH_EXTENSION,
|
||||
.PrWriteListSize = CFG_BLE_PREPARE_WRITE_LIST_SIZE,
|
||||
.MblockCount = CFG_BLE_MBLOCK_COUNT,
|
||||
.AttMtu = CFG_BLE_MAX_ATT_MTU,
|
||||
.SlaveSca = CFG_BLE_SLAVE_SCA,
|
||||
.MasterSca = CFG_BLE_MASTER_SCA,
|
||||
.LsSource = CFG_BLE_LSE_SOURCE,
|
||||
.MaxConnEventLength = CFG_BLE_MAX_CONN_EVENT_LENGTH,
|
||||
.HsStartupTime = CFG_BLE_HSE_STARTUP_TIME,
|
||||
.ViterbiEnable = CFG_BLE_VITERBI_MODE,
|
||||
.Options = CFG_BLE_OPTIONS,
|
||||
.HwVersion = 0,
|
||||
.max_coc_initiator_nbr = 32,
|
||||
.min_tx_power = 0,
|
||||
.max_tx_power = 0,
|
||||
.rx_model_config = 1,
|
||||
}
|
||||
};
|
||||
status = SHCI_C2_BLE_Init(&ble_init_cmd_packet);
|
||||
|
@@ -139,7 +139,7 @@
|
||||
/**
|
||||
* Maximum supported ATT_MTU size
|
||||
*/
|
||||
#define CFG_BLE_MAX_ATT_MTU (489)
|
||||
#define CFG_BLE_MAX_ATT_MTU (256+128+16+8+4+2)
|
||||
|
||||
/**
|
||||
* Size of the storage area for Attribute values
|
||||
@@ -211,14 +211,36 @@
|
||||
#define CFG_BLE_VITERBI_MODE 1
|
||||
|
||||
/**
|
||||
* LL Only Mode
|
||||
* 1 : LL Only
|
||||
* 0 : LL + Host
|
||||
* BLE stack Options flags to be configured with:
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_LL_ONLY
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_LL_HOST
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_NO_SVC_CHANGE_DESC
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RO
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_EXT_ADV
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_CS_ALGO2
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_1
|
||||
* - SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3
|
||||
* which are used to set following configuration bits:
|
||||
* (bit 0): 1: LL only
|
||||
* 0: LL + host
|
||||
* (bit 1): 1: no service change desc.
|
||||
* 0: with service change desc.
|
||||
* (bit 2): 1: device name Read-Only
|
||||
* 0: device name R/W
|
||||
* (bit 3): 1: extended advertizing supported [NOT SUPPORTED]
|
||||
* 0: extended advertizing not supported [NOT SUPPORTED]
|
||||
* (bit 4): 1: CS Algo #2 supported
|
||||
* 0: CS Algo #2 not supported
|
||||
* (bit 7): 1: LE Power Class 1
|
||||
* 0: LE Power Class 2-3
|
||||
* other bits: reserved (shall be set to 0)
|
||||
*/
|
||||
#define CFG_BLE_LL_ONLY 0
|
||||
/******************************************************************************
|
||||
* Transport Layer
|
||||
******************************************************************************/
|
||||
#define CFG_BLE_OPTIONS (SHCI_C2_BLE_INIT_OPTIONS_LL_HOST | SHCI_C2_BLE_INIT_OPTIONS_WITH_SVC_CHANGE_DESC | SHCI_C2_BLE_INIT_OPTIONS_DEVICE_NAME_RW | SHCI_C2_BLE_INIT_OPTIONS_NO_EXT_ADV | SHCI_C2_BLE_INIT_OPTIONS_NO_CS_ALGO2 | SHCI_C2_BLE_INIT_OPTIONS_POWER_CLASS_2_3)
|
||||
|
||||
/**
|
||||
* Queue length of BLE Event
|
||||
* This parameter defines the number of asynchronous events that can be stored in the HCI layer before
|
||||
|
@@ -67,24 +67,28 @@ bool ble_app_init() {
|
||||
SHCI_C2_Ble_Init_Cmd_Packet_t ble_init_cmd_packet = {
|
||||
.Header = {{0,0,0}}, // Header unused
|
||||
.Param = {
|
||||
0, // pBleBufferAddress not used
|
||||
0, // BleBufferSize not used
|
||||
CFG_BLE_NUM_GATT_ATTRIBUTES,
|
||||
CFG_BLE_NUM_GATT_SERVICES,
|
||||
CFG_BLE_ATT_VALUE_ARRAY_SIZE,
|
||||
CFG_BLE_NUM_LINK,
|
||||
CFG_BLE_DATA_LENGTH_EXTENSION,
|
||||
CFG_BLE_PREPARE_WRITE_LIST_SIZE,
|
||||
CFG_BLE_MBLOCK_COUNT,
|
||||
CFG_BLE_MAX_ATT_MTU,
|
||||
CFG_BLE_SLAVE_SCA,
|
||||
CFG_BLE_MASTER_SCA,
|
||||
CFG_BLE_LSE_SOURCE,
|
||||
CFG_BLE_MAX_CONN_EVENT_LENGTH,
|
||||
CFG_BLE_HSE_STARTUP_TIME,
|
||||
CFG_BLE_VITERBI_MODE,
|
||||
CFG_BLE_LL_ONLY,
|
||||
0,
|
||||
.pBleBufferAddress = 0, // pBleBufferAddress not used
|
||||
.BleBufferSize = 0, // BleBufferSize not used
|
||||
.NumAttrRecord = CFG_BLE_NUM_GATT_ATTRIBUTES,
|
||||
.NumAttrServ = CFG_BLE_NUM_GATT_SERVICES,
|
||||
.AttrValueArrSize = CFG_BLE_ATT_VALUE_ARRAY_SIZE,
|
||||
.NumOfLinks = CFG_BLE_NUM_LINK,
|
||||
.ExtendedPacketLengthEnable = CFG_BLE_DATA_LENGTH_EXTENSION,
|
||||
.PrWriteListSize = CFG_BLE_PREPARE_WRITE_LIST_SIZE,
|
||||
.MblockCount = CFG_BLE_MBLOCK_COUNT,
|
||||
.AttMtu = CFG_BLE_MAX_ATT_MTU,
|
||||
.SlaveSca = CFG_BLE_SLAVE_SCA,
|
||||
.MasterSca = CFG_BLE_MASTER_SCA,
|
||||
.LsSource = CFG_BLE_LSE_SOURCE,
|
||||
.MaxConnEventLength = CFG_BLE_MAX_CONN_EVENT_LENGTH,
|
||||
.HsStartupTime = CFG_BLE_HSE_STARTUP_TIME,
|
||||
.ViterbiEnable = CFG_BLE_VITERBI_MODE,
|
||||
.Options = CFG_BLE_OPTIONS,
|
||||
.HwVersion = 0,
|
||||
.max_coc_initiator_nbr = 32,
|
||||
.min_tx_power = 0,
|
||||
.max_tx_power = 0,
|
||||
.rx_model_config = 1,
|
||||
}
|
||||
};
|
||||
status = SHCI_C2_BLE_Init(&ble_init_cmd_packet);
|
||||
|
Reference in New Issue
Block a user