I think the main problem is that you are setting the advert report twice, and what's most likely happening is that the second advert report is overwriting the first one. You need to call the hcitool cmd only once as follows:-
hcitool -i hci0 cmd 0x08 0x0008 12 02 01 06 05 02 FF 01 FF 02 08 FF 00 11 22 33 44 55 66
BLE data in adverts is decoded as follows (based on the Assigned Numbers Document):-
- 1st byte = length (n bytes)
- 2nd byte = Types
- n-1 bytes = actual data
So the data above is decoded as:
12 - 18 (length of full advert report)
02 - Length of next advert report entry (2 bytes)
01 - Type: Flags
06 - 02 && 04 LE General Discoverable && BR/EDR Not supported
05 - Length of the next advert report entry (5 bytes)
02 - Type: Complete list of 16-bit UUIDs
FF 01 FF 02 - The UUIDs 0xFF01 and 0xFF02 will be included in the advert report
08 - Length of the next advert report entry
FF - Type: Manufacturer data
00 11 22 33 44 55 66 - The actual manufacturer data
That being said, I would recommend that you avoid using the hcitool command as it is deprecated and has many limitations compared to the newer bluez commands. Instead, you can use the btmgmt tool (if it is available on your system) to send out adverts that contain both the UUID and the manufacturer data. To do this, you can use the following command:-
sudo btmgmt add-adv -u FF01 -u FF02 -d 02010608FF00112233445566 1
The line above adds UUIDs 0xFF01, 0xFF02, and the manufacturer data 00112233445566 to the advertising report. The full list of btmgmt add-adv options are:-
Usage: add-adv [options] <instance_id>
Options:
-u, --uuid <uuid> Service UUID
-d, --adv-data <data> Advertising Data bytes
-s, --scan-rsp <data> Scan Response Data bytes
-t, --timeout <timeout> Timeout in seconds
-D, --duration <duration> Duration in seconds
-P, --phy <phy> Phy type, Specify 1M/2M/CODED
-c, --connectable "connectable" flag
-g, --general-discov "general-discoverable" flag
-l, --limited-discov "limited-discoverable" flag
-n, --scan-rsp-local-name "local-name" flag
-a, --scan-rsp-appearance "appearance" flag
-m, --managed-flags "managed-flags" flag
-p, --tx-power "tx-power" flag
e.g.:
add-adv -u 180d -u 180f -d 080954657374204C45 1
BLE data in adverts is decoded as follows (based on the Assigned Numbers Document):-
- 1st byte = length (n bytes)
- 2nd byte = Types
- n-1 bytes = actual data
So the meaning of the advert data I added:-
02 - Length (2 bytes)
01 - Type: Flags
06 - Flag - 02 && 04 LE General Discoverable && BR/EDR Not supported
08 - Length (8 bytes)
FF - Type: Manufacturer data
00112233445566 - Actual manufacturer data
Some other useful links:-