I need to setup my Linux laptop as a BLE peripheral to advertise service with specified device name and service UUID. I can achieve this with the following set of commands,
sudo hciconfig 0 reset
sudo hcitool -i hci0 cmd 0x08 0x0008 15 02 01 1a 11 07 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 00 00 00 00 00 00 00 00 00 00
sudo btmgmt -i hci0 le on
sudo btmgmt -i hci0 connectable on
sudo btmgmt -i hci0 name MYNAME
sudo btmgmt -i hci0 advertising on
sudo btmgmt -i hci0 power on
(Note that btmgmt was built from bluez5.37)
It works well and my iPhone can scan and discover the peripheral with name "MYNAME" and service UUID 504f4e4d-4c4b-4a49-4847-464544434241.
My question is, I need to replace the above btmgmt commands with hciconfig and/or hcitool, is it possible? And if yes, how to set the parameters for each command?
Thanks in advance.