My bad, this is due to the same id... I've solved it.
I do more experiment. It's not only happen on Win7. I use my iphone6 plus and install an App which name is eBeacon. It detect the local name as null.
If I define the local name with the length over 8 bytes in the "BLE_PROFILE_CFG", this shows correct.
I follow the code on the forum to change the local_name dynamically. See the bold part. One is 7 bytes local name, and another one is 15 bytes local name. The 7 bytes local_name can be shown correct on both Win7 and the eBeacon app. But, the 15 bytes local_name can't be shown correct on Win7 and eBeacon.
The code is as follow:
// Read value of the service from GATT DB.
ble_tracen((char *)db_pdu.pdu, db_pdu.len);
if (db_pdu.len != 16)
ble_trace1("\rmicro_inverter bad service UUID len: %d", db_pdu.len);
adv.len = 1 + 1;
adv.val = ADV_FLAGS;
adv.data = LE_LIMITED_DISCOVERABLE | BR_EDR_NOT_SUPPORTED;
adv.len = 16 + 1;
adv.val = ADV_SERVICE_UUID128_COMP;
memcpy(adv.data, db_pdu.pdu, 16);
// name, TODO: the final version should get the address from microcontroller.
UINT8 *bda = emconinfo_getAddr();
//sprintf(bleprofile_p_cfg->local_name, "SMI%02x%02x%02x%02x%02x%02x", bda[0x05], bda[0x04], bda[0x03], bda[0x02], bda[0x01], bda[0x00]);
sprintf(bleprofile_p_cfg->local_name, "SMI%02x%02x", bda[0x01], bda[0x00]);
p_pdu.len = strlen(bleprofile_p_cfg->local_name) + 1;
memcpy(&p_pdu.pdu, bleprofile_p_cfg->local_name, strlen(bleprofile_p_cfg->local_name));
adv.len = strlen(bleprofile_p_cfg->local_name) + 1;
adv.val = ADV_LOCAL_NAME_COMP;
memcpy(adv.data, bleprofile_p_cfg->local_name, adv.len - 1);
Any comment and idea?
Is the goal to change the device name dynamically (To change the device's name dynamically)?
The name needs to be changed in two places per this thread: Re: Unable to change device name
The first one is used during a connection as it allows a client to read the device name value from the GATT database and the second instance is what’s placed in the advertisement packet.
The 2nd link is fail.
mmfae/fran - I get the un-authorized error message when I try to view the 2nd link as well.