While runnig a BLE android App I am getting mAdvertiseFlags = -1 in the adblog for a given Mac ID of a wearbale_X , what does -1 means?Sometime mAdvertiseFlags becomes 4. For some other wearbale_Y I get mAdvertiseFlags =6 continously .
Asked
Active
Viewed 339 times
1 Answers
0
Advertising flags indicate the discoverable mode and capability of the device.
-1
means that the mAdvertisementFlags
was not yet. In other words, there are no advertisement flags.
Source: ScanRecord source code:
/**
* Returns the advertising flags indicating the discoverable mode and capability of the device.
* Returns -1 if the flag field is not set.
*/
public int getAdvertiseFlags() {
return mAdvertiseFlags;
}

Tim
- 41,901
- 18
- 127
- 145
-
who sets it?The firmware in my wearable and not the Android?If it is -1 that means my wearable is not in discover-able mode or not advertising? – Raulp Jan 11 '17 at 10:36
-
@Raulp seems so, yes. `mAdvertiseFlags` is set in `ScanRecord.parseFromBytes()`, while parsing a scanned advertisement – Tim Jan 11 '17 at 10:38
-
`-1` has no other meaning than "there were no special flags set". It is advertising, and it is discoverable, because otherwise you wouldn't be able to see it. – Tim Jan 11 '17 at 10:39
-
Yes true even if it is -1 it means it is advertising but I think not the intended data.I checked the logs with both mAdvertiseFlags = -1 and 4 and found that with mAdvertiseFlags = 4 it advertises values like : mServiceUuids,mServiceData which is null in case of mServiceData = -1.So it is aligned with the section you pasted that with -1 No device capability will be Known via its service Id or Service data(as it is null while in case = "4"it is not and has a valid status good enough for finding the capability of the device).What are your comments? – Raulp Jan 11 '17 at 10:44
-
Sorry, can't tell you more, the exact causes of flag values are not documented – Tim Jan 11 '17 at 11:07