Commit Graph

27 Commits

Author SHA1 Message Date
Vinit Mehta
60d60166e4 mgmt: Fix crash after pair command
After pair command, if the user doesn't provide any input on bluetoothctl
CLI interface after receiving the prompt(yes/no) below crash is observed:

dbus[782]: arguments to dbus_message_get_no_reply() were incorrect,
assertion "message != NULL" failed in file
/usr/src/debug/dbus/1.14.10-r0/dbus/dbus-message.c line 3250.
This is normally a bug in some application using the D-Bus library.
/usr/lib/libc.so.6(+0x27534) [0xffffa1b67534]
/usr/lib/libc.so.6(__libc_start_main+0x9c) [0xffffa1b6760c]
bluetoothctl(+0x188f0) [0xaaaac9c088f0]
Aborted (core dumped)
2024-01-03 15:59:23 -05:00
Luiz Augusto von Dentz
35c706f398 client: Add agent auto argument support
This adds "auto" capability which behaves like "on" but instead of
asking user to confirm/autorize it automatically accepts, which is
not secure to be used thus a warning is printed when user selects it.

Usage:

  [bluetoothctl]# agent auto
  Warning: setting auto response is not secure, it bypass user
  confirmation/authorization, it shall only be used for test automation.

  or

  client/bluetoothctl -a auto
2023-08-23 13:49:00 -07:00
Tedd Ho-Jeong An
f22f166d6e client: Add SPDX License Identifier
This patch adds SPDX License Identifier and removes the license text.

-------------------------------------
       License            COUNT
-------------------------------------
 GPL-2.0-or-later     :      11

License: GPL-2.0-or-later
   client/adv_monitor.c
   client/adv_monitor.h
   client/advertising.h
   client/display.c
   client/main.c
   client/display.h
   client/agent.h
   client/gatt.c
   client/agent.c
   client/advertising.c
   client/gatt.h
2020-09-21 16:19:33 -07:00
Luiz Augusto von Dentz
936ad5ef7b client: Quit when done with command
This ensures that the commands don't stay hanging since bt_shell no
longer quits immediatelly after executing a command.
2018-02-28 16:17:13 +02:00
ERAMOTO Masaya
5e7ad41d08 shared/shell: Fix no version output with option
bluetoothctl does output the following error message with the option
-v/--version.

  $ bluetoothctl --version
  Unknown option --version
2017-12-05 16:18:57 -02:00
Luiz Augusto von Dentz
70b8b754f8 client: Make use of bt_shell
Use bt_shell instead of readline directly.
2017-11-17 16:00:19 +02:00
Luiz Augusto von Dentz
c144863767 client: Use rl_prompt_input to prompt agent input
This uses rl_prompt_input to ask user input instead of maintaining its
own handling in agent.c lets display.c handle all user prompt requests.
2017-08-23 15:22:17 +03:00
Marcel Holtmann
734a1eeeba client: Fix includes for gdbus.h header 2015-02-28 22:21:46 -08:00
Luiz Augusto von Dentz
fc8ac15d63 client: Fix not releasing agent if bluetoothd exit without calling Release
If AgentManager1 disappear the agent should auto release itself
otherwise next time AgentManager1 appears bluetoothctl wont register
the agent again.
2014-04-29 11:38:32 +03:00
Alex Deymo
342f1aa194 client: Agent's RequestPasskey implementation
Implements the uint32 RequestPasskey(object device) method.
2013-03-25 12:57:11 +02:00
Alex Deymo
4b30052265 client: Agent's DisplayPasskey implementation
Implements the DisplayPasskey(object device, uint32 passkey, uint16 entered)
method.
2013-03-25 12:57:03 +02:00
Alex Deymo
d52e8994b5 client: Agent's DisplayPincode implementation
Implements the DisplayPinCode(object device, string pincode) method.
2013-03-25 12:56:55 +02:00
Alex Deymo
82e49df634 client: Right prompt management on agent input
Registering an agent shares the user input interface with the normal console
command interface. The way it is implemented (using rl_message, rl_save_prompt
and rl_restore_prompt) conflicts with the rl_printf calls that may appear
while waiting for user input, loosing the [bluetooth]# prompt.
This patch fixes this and makes clear if the expected input is a command or an
agent reply changing the color and text of the prompt.
2013-03-25 12:54:48 +02:00
Marcel Holtmann
a3155051a0 client: Add support for requesting default agent 2012-12-20 03:43:38 +01:00
Marcel Holtmann
bfcf49e534 client: Add support for handling service authorizations 2012-12-20 03:36:13 +01:00
Marcel Holtmann
3a3074accb client: Add support for providing agent capability 2012-12-18 17:39:56 +01:00
Marcel Holtmann
731a3f1624 client: Add support for request authorization callbacks 2012-12-18 17:23:19 +01:00
Marcel Holtmann
e2871fd827 client: Handle legacy pairing and input of PIN codes 2012-12-18 17:06:12 +01:00
Marcel Holtmann
72faf3c1d9 client: Always print messages with checking readline state 2012-12-18 15:03:58 +01:00
Marcel Holtmann
70ce4002b1 client: Restore command prompt when agent finishes 2012-12-18 05:29:11 +01:00
Marcel Holtmann
84faeb47be client: Handle accepting/rejecting confirmation requests 2012-12-18 05:18:40 +01:00
Marcel Holtmann
5557e7b453 client: Add support for handling passkey confirmation 2012-12-18 04:20:40 +01:00
Marcel Holtmann
dae938bcbd client: Use printing helper for agent messages 2012-12-18 04:20:02 +01:00
Marcel Holtmann
fddb94f0e8 client: Print message when agent gets released by manager 2012-12-15 03:04:28 +01:00
Marcel Holtmann
f3fcb85b20 client: Add support for registering agent handling 2012-12-15 02:16:39 +01:00
Marcel Holtmann
0ab621bb86 client: Use constants for agent path and interface strings 2012-12-15 01:33:54 +01:00
Marcel Holtmann
d8d4b4f0c0 client: Add support for handling agent object registration 2012-12-15 00:20:25 +01:00