新增电脑通过USB发送产品code,然后dongle根据新的code重新发起广播的功能
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
|
||||
#if TCFG_USB_SLAVE_CDC_ENABLE
|
||||
#include "usb/device/cdc.h"
|
||||
#include "usr_usb_jb.h"
|
||||
#endif
|
||||
|
||||
#if (TCFG_USB_DM_MULTIPLEX_WITH_SD_DAT0)
|
||||
@@ -186,6 +187,13 @@ static void usb_cdc_wakeup(struct usb_device_t *usb_device)
|
||||
log_debug("cdc rx hook");
|
||||
rlen = cdc_read_data(usb_id, buf, 64);
|
||||
|
||||
/* 见宝协议:产品码配置帧 55 AA ... */
|
||||
if (rlen > 0) {
|
||||
printf("cdc rx %u\n", rlen);
|
||||
put_buf(buf, rlen);
|
||||
usr_usb_jb_feed(buf, rlen);
|
||||
}
|
||||
|
||||
/* put_buf(buf, rlen);//固件三部测试使用 */
|
||||
/* cdc_write_data(usb_id, buf, rlen);//固件三部测试使用 */
|
||||
|
||||
|
||||
@@ -329,21 +329,9 @@ static void cbk_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *p
|
||||
con_handle = 0;
|
||||
ble_user_cmd_prepare(BLE_CMD_ATT_SEND_INIT, 4, con_handle, 0, 0, 0);
|
||||
set_ble_work_state(BLE_ST_DISCONN);
|
||||
// set_app_connect_type(TYPE_NULL);
|
||||
if (!ble_update_get_ready_jump_flag()) {
|
||||
//extern u8 usr_get_pair_flag();
|
||||
//extern void usr_reconn_adv();
|
||||
if(usr_var.usr_goto_updata==0)
|
||||
{
|
||||
/*if(usr_get_pair_flag())
|
||||
{
|
||||
usr_reconn_adv();
|
||||
}
|
||||
else
|
||||
{
|
||||
bt_ble_adv_enable(1);
|
||||
}*/
|
||||
//extern void usr_ble_adv_init();
|
||||
usr_ble_adv_init();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user