//-------------------------------------------------------
const char ble_name_string[] = “69n_ble”;
static int make_set_adv_data(u8 *info, u8 len)
{
u8 offset = 0;
u8 *buf = (void *)adv_data;
u8 *tag_buf = (void )info;
u8 tag_len = len;
/
#if 0 //BLE广播使用EDR的蓝牙名字,防止连接时蓝牙名字变成693_ble蓝牙名字最多只能31-21=10字节。
u8 *edr_name = bt_get_local_name();
offset += make_eir_packet_data(&buf[offset], offset, HCI_EIR_DATATYPE_COMPLETE_LOCAL_NAME, (void *)edr_name, strlen(edr_name));
#else
offset += make_eir_packet_data(&buf[offset], offset, HCI_EIR_DATATYPE_COMPLETE_LOCAL_NAME, (void *)ble_name_string, strlen(ble_name_string));
#endif
*/
offset += make_eir_packet_data(&buf[offset], offset, HCI_EIR_DATATYPE_MANUFACTURER_SPECIFIC_DATA, (void *)tag_buf, tag_len);
if (offset > ADV_RSP_PACKET_MAX) {
ble_puts("***adv_data overflow!!!!!!\n");
return -1;
}
ble_printf("ADV data(%d):", offset);
ble_put_buf(buf, offset);
adv_data_len = offset;
return 0;
}