This commit is contained in:
parent
4271e8c6ff
commit
6e1a1dc3ed
|
@ -42,19 +42,19 @@
|
|||
*/
|
||||
|
||||
// How often to perform periodic event
|
||||
#define SBP_PERIODIC_EVT_PERIOD (160 * 10 * 5) // (160 = 100ms)
|
||||
#define SBP_PERIODIC_EVT_PERIOD (160 * 10 * 1) // (160 = 100ms)
|
||||
|
||||
// How often to perform read rssi event
|
||||
#define SBP_READ_RSSI_EVT_PERIOD (1600 * 3) // (160 = 100ms)
|
||||
|
||||
// Parameter update delay
|
||||
#define SBP_PARAM_UPDATE_DELAY (1600 * 4)
|
||||
#define SBP_PARAM_UPDATE_DELAY (1600 * 1)
|
||||
|
||||
// PHY update delay
|
||||
#define SBP_PHY_UPDATE_DELAY (1600 * 2)
|
||||
#define SBP_PHY_UPDATE_DELAY (1600 * 1)
|
||||
|
||||
// What is the advertising interval when device is discoverable (units of 625us, 80=50ms)
|
||||
#define DEFAULT_ADVERTISING_INTERVAL (160 * 1)
|
||||
#define DEFAULT_ADVERTISING_INTERVAL (160 * 10)
|
||||
|
||||
// Limited discoverable mode advertises for 30.72s, and then stops
|
||||
// General discoverable mode advertises indefinitely
|
||||
|
@ -492,8 +492,8 @@ static void Peripheral_LinkEstablished(gapRoleEvent_t *pEvent)
|
|||
peripheralConnList.connInterval = event->connInterval;
|
||||
peripheralConnList.connSlaveLatency = event->connLatency;
|
||||
peripheralConnList.connTimeout = event->connTimeout;
|
||||
peripheralMTU = ATT_MTU_SIZE;
|
||||
// peripheralMTU = BLE_BUFF_MAX_LEN;
|
||||
// peripheralMTU = ATT_MTU_SIZE;
|
||||
peripheralMTU = BLE_BUFF_MAX_LEN - 4;
|
||||
// Set timer for periodic event
|
||||
tmos_start_task(Peripheral_TaskID, SBP_PERIODIC_EVT, SBP_PERIODIC_EVT_PERIOD);
|
||||
|
||||
|
@ -748,7 +748,7 @@ static void performPeriodicTask(void)
|
|||
// {
|
||||
// humi = 0;
|
||||
// }
|
||||
// peripheralChar4Notify(&RawData.buf[0], RawData.len);
|
||||
peripheralChar4Notify(&RawData.buf[0], RawData.len);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
@ -776,8 +776,10 @@ static void peripheralChar4Notify(uint8_t *pValue, uint16_t len)
|
|||
tmos_memcpy(noti.pValue, pValue, noti.len);
|
||||
if (simpleProfile_Notify(peripheralConnList.connHandle, ¬i) != SUCCESS)
|
||||
{
|
||||
logError("Noti Err");
|
||||
GATT_bm_free((gattMsg_t *)¬i, ATT_HANDLE_VALUE_NOTI);
|
||||
}
|
||||
logDebug("Noti Success");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -877,6 +879,9 @@ static void simpleProfileChangeCB(uint8_t paramID, uint8_t *pValue, uint16_t len
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
|
||||
// TODO:应用加入广播数据更新部分状态数据
|
||||
// 动态更新广播数据
|
||||
// taskID: 请求更改广播任务的 ID
|
||||
|
@ -888,10 +893,13 @@ void Peripheral_UpdateAdvertData(uint8_t adType, uint8_t dataLen, uint8_t *pAdve
|
|||
GAP_UpdateAdvertisingData(Peripheral_TaskID, adType, dataLen, pAdvertData);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "stdio.h"
|
||||
#include "stdarg.h"
|
||||
|
||||
// TODO:应用加入广播数据更新部分状态数据
|
||||
// TODO:先不弄,后面改广播名,应用加入广播数据更新部分状态数据
|
||||
void Peripheral_SetMacName(void)
|
||||
{
|
||||
uint8_t mac_addr[6];
|
||||
|
@ -931,3 +939,4 @@ void Peripheral_SetMacName(void)
|
|||
// // 更新扫描响应体
|
||||
GAP_UpdateAdvertisingData(Peripheral_TaskID, FALSE, scan_rsp_data, len);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* @Author : stark1898y 1658608470@qq.com
|
||||
* @Date : 2024-12-12 15:54:57
|
||||
* @LastEditors : stark1898y 1658608470@qq.com
|
||||
* @LastEditTime : 2024-12-12 16:47:22
|
||||
* @LastEditTime : 2024-12-16 08:55:00
|
||||
* @FilePath : \BLE_TYQ_CH592F\BSP\src\bsp_flash.c
|
||||
* @Description :
|
||||
*
|
||||
|
@ -44,7 +44,7 @@ void BSP_FLASH_Init(void)
|
|||
EEPROM_ERASE(FLASH_INFO_ADDR, DATA_FLASH_PAGE_SIZE); // 擦除待写区
|
||||
EEPROM_WRITE(FLASH_INFO_WRITE_FLAG_ADDR, &flash_write_flag, FLASH_INFO_WRITE_FLAG_LEN);
|
||||
|
||||
logWarning("First Init flash_write_flag:%d", flash_write_flag);
|
||||
logWarning("First Init flash_write_flag:%04X", flash_write_flag);
|
||||
}
|
||||
logDebug("BSP_FLASH_Init");
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@
|
|||
#define BLE_TX_NUM_EVENT 1
|
||||
#endif
|
||||
#ifndef BLE_TX_POWER
|
||||
#define BLE_TX_POWER LL_TX_POWEER_0_DBM
|
||||
#define BLE_TX_POWER LL_TX_POWEER_4_DBM
|
||||
#endif
|
||||
#ifndef PERIPHERAL_MAX_CONNECTION
|
||||
#define PERIPHERAL_MAX_CONNECTION 1
|
||||
|
|
Loading…
Reference in New Issue