hciconfig list commands (patch)

From: Richard Neill <hidden>
Date: 2013-08-27 12:11:49

Dear All,

I'd like to offer a small patch to tools/hciconfig.c (and the man page).

Currently, running the command "hciconfig hci0 commands" creates a list 
of supported codes and their names in this format[1]. It's rather tricky 
to interpret this format, when trying to discover the command code for a 
particular named action, because both lists are very long, and run 
consecutively rather than concurrently.

My patch adds an extra command ""hciconfig hci0 commands_list", which 
hopefully makes this clearer, emitting output in the format of [2].

I hope this is helpful :-)

If it's necessary to have a legal declaration, then I hereby state for 
the record that I, Richard Neill, wrote the attached code, and I release 
it under the GPL 2+.


[1] output of "hciconfig hci0 commands"
------------------------
Commands: Octet 0  = 0xff (Bit 0 1 2 3 4 5 6 7)
           Octet 1  = 0xff (Bit 0 1 2 3 4 5 6 7)
....
'Inquiry' 'Inquiry Cancel' 'Periodic Inquiry Mode'
'Exit Periodic Inquiry Mode' 'Create Connection' 'Disconnect'
'Add SCO Connection' 'Cancel Create Connection'
'Accept Connection Request' 'Reject Connection Request'
....
------------------------


[2] output of "hciconfig hci0 commands_list"
-------------------------
Byte:   Octet:  Bit:    Command:
0x00     0       0      'Inquiry'
0x01     0       1      'Inquiry Cancel'
0x02     0       2      'Periodic Inquiry Mode'
0x03     0       3      'Exit Periodic Inquiry Mode'
0x04     0       4      'Create Connection'
0x05     0       5      'Disconnect'
0x06     0       6      'Add SCO Connection'
0x07     0       7      'Cancel Create Connection'
....
-------------------------


Best wishes,

Richard


P.S. This is my contribution to bluez, so I hope I'm sending the right 
format to the right place.  If I could do this better, I'd welcome 
feedback off-list.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help