Commit Graph

24341 Commits

Author SHA1 Message Date
Szymon Janc
6c91d28459 client: Print Address type in show and info commands 2017-12-19 12:59:19 +01:00
Szymon Janc
4e3c8e9a95 device: Add support for AddressType property 2017-12-19 12:59:19 +01:00
Szymon Janc
cb40fbe0f5 adapter: Add support for AddressType property 2017-12-19 12:59:19 +01:00
Szymon Janc
2a225e92de Add AddressType property for Adapter1 and Device1 interfaces
This provides information about address type being used.  It is needed
for L2CAP sockets and PTS testing purposes.
2017-12-19 12:59:19 +01:00
Steve Brown
557d6368f9 mesh: meshctl: Add Company ID parameter to pub-set and pub-get
Add a CID parameter to both commands similar to bind.
Correct the prior assumption that a model id > 0xffff
was a vendor model.

pub-set 0100 c000 1 0 0 1000
03 0001 00c0 01 00 ff 00 00 0010

pub-set 0100 c000 1 0 0 1000 1
03 0001 00c0 01 00 ff 00 00 0100 0010
2017-12-18 13:15:15 +01:00
Steve Brown
fa5084a183 mesh: meshctl: Add get/set relay
Sets the relay state in node 0100 to 1

[config: Target = 0100]# relay-set 1 0 0

Node 0100 Relay state: 0x01 count: 0 steps: 0

Fetches the relay state of node 0100

[config: Target = 0100]# relay-get

Node 0100 Relay state: 0x01 count: 0 steps: 0
2017-12-18 13:15:11 +01:00
Steve Brown
0a8d9c69ab mesh: meshctl: Add get/set identity
Setting identity will cause connectable identity
beacons to be transmitted. The connect command
has an option to connect in this mode.

Sets the identity state to 1 in node 0100 on network
0000.

[config: Target = 0100]# ident-set 0 1
Network index 0x0000 has Node Identity state 0x01 Success

Fetched the identity state from node 0100

[config: Target = 0100]# ident-get 0
Network index 0x0000 has Node Identity state 0x01 Success
2017-12-18 13:15:07 +01:00
Steve Brown
f832f66f77 mesh: meshctl: Add set/get proxy
Set the current proxy state of node 0100
Setting the proxy state to 0 will disconnect
the GATT proxy connection.

[config: Target = 0100]# proxy-set 1

Node 0100 Proxy state: 0x01

Get the current proxy state of element 0100

[config: Target = 0100]# proxy-get

Node 0100 Proxy state: 0x01
2017-12-18 13:15:03 +01:00
Steve Brown
1a53ed0ca4 mesh: meshctl: Add get publish
Get the publish address for model 1001 in element 0100

[config: Target = 0100]# pub-get 0100 1001

Set publication for node 0100 status: Success
Publication address: 0xc000
Period: 0 ms
Retransmit count: 0
Retransmit Interval Steps: 0
2017-12-18 13:14:59 +01:00
Steve Brown
8087cd3db6 mesh: meshctl: Add get app keys
List application keys of model 1000 in element 0100.

[config: Target = 0100]# app-get 0100 1000

Model App Key list for node 0100 length: 7 status: Success
Element Addr:   0100
Model ID:       1000
Model App Key:  0001
2017-12-18 13:14:53 +01:00
Steve Brown
d6f74e4a06 mesh: meshctl: Add set heartbeat publish
Sets heartbeat for node 0100

[config: Target = 0100]# hb-set 0100 0 0 0 0

Set heartbeat for node 0100 status: Success
Destination:    0100
Count:          00
Period:         00
TTL:            ff
Features:       0000
Net_Idx:        0000
2017-12-18 13:14:49 +01:00
Steve Brown
61ca29dff5 mesh: meshctl: Add add/get subscribe
Adds a subscription for group address c000 to
model 1000 in element 0100.

[config: Target = 0100]# sub-add 0100 c000 1000

Subscription changed for node 0100 status: Success
ModelId 1000
Element Addr:   0100
Subscr Addr:    c000

Gets the current subscription list for model 1000
on element 0100.

[config: Target = 0100]# sub-get 0100 1000

Subscription list for node 0100 length: 7 status: Success
Element Addr:   0100
Model ID:       1000
Subscr Addr:    c000
2017-12-18 13:14:42 +01:00
Steve Brown
37aafbbf0e mesh: meshctl: Change command names to <cmd>-<get/set>
Fix lines over 80 chars
Move cmd_default()
Add parameter to pub-set to control retransmit count
2017-12-18 13:14:23 +01:00
Luiz Augusto von Dentz
a157235d66 client: Only set the discovery filter when necessary
Only set the discovery filter when the user wants execute the scan
command.
2017-12-16 16:53:50 +01:00
Luiz Augusto von Dentz
093768cd10 client: Add generator for scan:clear
This adds tab generator for scan:clear:

[bluetooth]# clear
duplicate-data  pathloss        rssi            transport       uuids
2017-12-16 16:50:05 +01:00
Luiz Augusto von Dentz
b80e11bf5c client: Make scan:clear clear individual fields
This reintroduces the option to clear individual fields which was
removed when redesining the commands which now read the fields when
no arguments are provided.
2017-12-16 16:50:04 +01:00
Luiz Augusto von Dentz
94c0774c31 client: Group discovery filter variables into a struct
This should be easier to read and maintain.
2017-12-16 16:50:03 +01:00
Luiz Augusto von Dentz
902ff0e049 client: Fix command scan:clear
Command clear shall clear all filters including DuplicateData.
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
3d15298157 client: Rename set-filter-clear to clear
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters.
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
cd2dcedfc9 client: Rename set-filter-duplicate-data to duplicate-data
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# duplicate-data on
SetDiscoveryFilter success
[bluetooth]# duplicate-data
DuplicateData: on
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
745918dfe2 client: Rename set-filter-transport to transport
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# transport le
SetDiscoveryFilter success
[bluetooth]# transport
Transport: le
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
5ed59502c2 client: Rename set-filter-pathloss to pathloss
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# pathloss 0
SetDiscoveryFilter success
[bluetooth]# pathloss
Pathloss: 0
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
4a6a055681 client: Rename set-filter-rssi to rssi
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# rssi 0
SetDiscoveryFilter success
[bluetooth]# rssi
RSSI: 0
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
e1021f7e48 client: Rename set-filter-uuids to uuids
All commands under scan submenu are related to set-filter so remove its
portion from it and make the command return the current value if no
parameters:

[bluetooth]# uuids 0x1820
SetDiscoveryFilter success
[bluetooth]# uuids
	UUID: Internet Protocol Support (0x1820)

Note that to filter all UUIDs user must now use "all" instead of empty
list.
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
419cd859d7 shared/shell: Fix parsing of optional parameters
Optional parameters uses "[]" delimiters.
2017-12-14 16:31:23 -02:00
Luiz Augusto von Dentz
b548233f33 monitor: Detect string format
User may enter UUID in string format other then 128 bits.
2017-12-14 16:31:23 -02:00
Szymon Janc
b1cf1ca02d tools/btpclient: Add implemented GAP commands to supported commands
Those bits should be set so that remote BTP side knows which commands
are implemented by IUT.
2017-12-14 13:49:47 +01:00
Szymon Janc
31c97a2a06 tools/btpclient: Add support for reseting adapter
For now this means only removing all bonded devices.
2017-12-14 10:08:32 +01:00
Szymon Janc
b285313db3 tools/btpclient: Store devices per adapter
This make it easier to handle devices from specified adapter.
2017-12-14 10:08:32 +01:00
Szymon Janc
064334439a tools/btpclient: Add support for configuring adapter settings
This allows to configure Powered, Discoverable and Pairable options.
2017-12-14 10:08:32 +01:00
Szymon Janc
59c5cbb6f9 tools/btpclient: Add support for tracking mutable adapter settings 2017-12-14 10:08:32 +01:00
Szymon Janc
1dade00811 tools/btpclient: Get initial values for adapter setttings 2017-12-14 10:08:32 +01:00
Szymon Janc
10e3523e6c tools/btpclient: Add initial support for read controller info command 2017-12-14 10:08:32 +01:00
Szymon Janc
05ef0292b6 tools/btpclient: Add initial support for GAP service
This allows to get list of supported commands and present adapters.
2017-12-14 10:08:32 +01:00
Szymon Janc
68ca50a98b shared/btp: Add definitions for GAP service 2017-12-14 10:08:32 +01:00
Szymon Janc
f68235b2c0 tools/btpclient: Add initial code
This adds initial code for BTP client tool that allows for automated
(binary protocol ) control of BlueZ stack. Currently this tool depends
only on Embedded Linux Library and requires master branch of ELL.
When 0.3 is released dependencies will be bumped.

Initial code allows to connect D-Bus client, discover objects and keep
proxies for it. It also implements basics for BTP core service.
2017-12-14 10:08:32 +01:00
Szymon Janc
b8cd86c3e2 shared/btp: Add initial code for library
This allows to connect to BTP socket, process message one-by-one (next
message is processed only after reply to previous was sent), reply and
send notifications.

Currently it is very simple and push most of error checking to user.
Could be extended in future if needed.
2017-12-14 10:08:32 +01:00
Szymon Janc
34553c1f74 client: Fix printing of array properties
ServiceData Key: 00001234-0000-1000-8000-00805f9b34fb
        ServiceData Value:
"3D     RSSI: -76
        TxPower: -7
2017-12-14 09:22:22 +01:00
Luiz Augusto von Dentz
9d7d70ee98 mesh: Add description for submenus
This adds proper descriptions for each submenu.
2017-12-13 10:08:55 -02:00
Luiz Augusto von Dentz
8c60a31651 client: Add description for submenus
This adds proper descriptions for each submenu.
2017-12-13 10:08:38 -02:00
Luiz Augusto von Dentz
fb661f7aa7 shared/shell: Add submenu description
This adds a field for submenu description.
2017-12-12 09:57:36 -02:00
Steve Brown
813b8e6737 mesh: Segmentation fails in gatt.c:pipe_write()
If the first command output in a new connection exceeds 20 bytes,
mesh_gatt_write sets the SAR to FIRST as the write_mtu is initially 0
and the default is GATT_MTU-3 (20).

When pipe_write gets called, a new larger write_mtu has been set, but
the SAR is still set to FIRST. It's assumed that data->gatt_len >
max_len. However, it's not which causes lots of bogus output.
2017-12-12 09:50:46 -02:00
Luiz Augusto von Dentz
5deaad18c2 shell: Add exists callback
This adds a callback to check if the menu exists at runtime.
2017-12-11 11:01:58 -02:00
ERAMOTO Masaya
c7a7849c8c shared/shell: Fix auto-completion of invalid commands
bt_shell always complements the invalid commands, which are the menu/back
command.
2017-12-11 10:16:04 -02:00
ERAMOTO Masaya
957d48aff5 shared/shell: Create command_isskipped() 2017-12-11 10:16:04 -02:00
ERAMOTO Masaya
4740e022ec toosl/bluetooth-player: Remove extra commands
Removes the output of redundant commands in bluetooth-player since the
previous patch ("shared/shell: Fix hidden default menu if no submenu")
made bluetooth-player output the default menu.
2017-12-11 10:16:04 -02:00
ERAMOTO Masaya
5b3a4b9f56 shared/shell: Fix hidden default menu if no submenu
Also fixes the output of the default menu in the help command of obexctl.
2017-12-11 10:16:04 -02:00
Luiz Augusto von Dentz
e199cd9bca mesh: Fix crash while reading input parameters
read_input_parameters skips the command argument thus arg[0] shall be
considerer the fist argument.
2017-12-11 11:19:16 +02:00
Luiz Augusto von Dentz
d1f9544681 mesh: Remove cmd_scan
cmd_scan is only used internally by discover-unprovisioned.
2017-12-08 13:06:21 +02:00
Luiz Augusto von Dentz
f11a25d42d mesh: Rework set_scan_filter_uuids parameters
set_scan_filter_uuids is not a command handler which means it doesn't
need to take argc and argv instead just pass the filter array.
2017-12-08 13:06:20 +02:00