客户侧能力:RTC、开机锁键与 BLE 协议收敛
1、新增 usr_periph RTC,DEVICEINFO 自动对时;对外精简为 get_time(sys_time*),开发板 RTC 时钟改用 LRC 2、iokey 开机锁键改为公开 start/stop 接口,板级宏 TCFG_IOKEY_BOOT_LOCK_ENABLE 可关闭 3、对齐模组 BLE 收发/组包与公开 API,更新 libusr_le_code.a;Release 包命名调整为 JBao_JL7016_SOC_SDK_Vx.x.x
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
#include "chgbox_box.h"
|
||||
#endif
|
||||
|
||||
/* usr_le_code 库钩子:由静态库导出,供 RCSP BLE 栈回调,非应用层公开 API */
|
||||
extern void usr_le_data_recieve(u8* data,u16 len);
|
||||
extern void usr_ble_adv_init();
|
||||
#if 1
|
||||
@@ -526,19 +527,15 @@ static int att_write_callback(hci_con_handle_t connection_handle, uint16_t att_h
|
||||
|
||||
void usr_ble_send_data(u8* data,u16 len)
|
||||
{
|
||||
/* CCC 未写时 ATT 发数会失败(常见 app_send_fail:-93),等主机使能通知再发 */
|
||||
if (get_ble_work_state() != BLE_ST_NOTIFY_IDICATE) {
|
||||
log_info("ble send skip, wait CCC");
|
||||
return;
|
||||
}
|
||||
if (app_send_user_data_check(len))
|
||||
{
|
||||
app_send_user_data(ATT_CHARACTERISTIC_15f1e601_a277_43fc_a484_dd39ef8a9100_01_VALUE_HANDLE, data, len, ATT_OP_AUTO_READ_CCC);
|
||||
}
|
||||
//printf("send rsp:");
|
||||
// printf_buf(data,len);
|
||||
printf("\n");
|
||||
for(u8 i=0;i<len;i++)
|
||||
{
|
||||
printf("%c",data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
static int app_send_user_data(u16 handle, u8 *data, u16 len, u8 handle_type)
|
||||
{
|
||||
@@ -961,6 +958,16 @@ u16 usr_get_conn_service()
|
||||
{
|
||||
return con_handle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 主机是否已写 CCC,允许 GATT notify/indicate
|
||||
* @return 1=可发数(BLE_ST_NOTIFY_IDICATE),0=还不行
|
||||
*/
|
||||
u8 usr_ble_is_notify_ready(void)
|
||||
{
|
||||
return (get_ble_work_state() == BLE_ST_NOTIFY_IDICATE) ? 1 : 0;
|
||||
}
|
||||
|
||||
void ble_app_disconnect(void)
|
||||
{
|
||||
ble_disconnect(NULL);
|
||||
|
||||
Reference in New Issue
Block a user