Hi Chams Akrout,
It might be helpful if you could give us some additional details, such as what Linux Distribution you are using, or how you came to use the particular collection of inputs you are using to the
bluetoothctl command.
In the Linux Distribution I'm using, the
bluetoothctl is in the
bluez package, but AFAIK, although there are manual pages on some of the other bluetooth related commands, there is no manual page or info document on the
bluetoothctl command provided by the Linux Distribution. While it is possible to get the source for the package through the source repository for the Linux Distribution, or through bluez.org then look through the source, and realize that there seem to be some directives such as you are using that are supported by the bluez.org source, a particular Distribution might have chosen to change the behavior of the command.
Just in general terms, if I put the following code in a BASH script within the Linux Distribution I'm using, the "menu gatt"
WILL be passed to the
bluetoothctl command ( or virtually any other command for that matter ) as options. I've actually tested this.
Code:
#!/bin/bash
bluetoothctl <<EOF menu gatt
back
register-service 0xffe0
EOF
AFAIK, the following approach is much more reliable:
Code:
#!/bin/bash
bluetoothctl <<EOF
menu gatt
back
register-service 0xffe0
EOF
Hope this helps.