| 1d1577c9 |
mesh: Add size checks for every opcode in config server
This adds missing size checks for the incoming config server messages. |
Inga Stotland |
5 years ago |
1 file, +37, -9 |
| ab9dd910 |
mesh: Use static array to hold config server response
This eliminates dynamic allocation for long responses and local
arrays for short responses. Instead, aclear text response from
config server is written into a static buffer and then encoded
into dynamically allocated messafe buffer to use in actual
transmission. |
Inga Stotland |
5 years ago |
1 file, +16, -37 |
| 192fb067 |
mesh: Fix node composition change detection
This fixes a bug that caused disallowed composition changes from being
detected and rejected. The only fields that are allowed to freely change
are CID, PID, VID and CRPL. |
Brian Gix |
5 years ago |
1 file, +1, -1 |
| b7002801 |
adapter: Remove timer for removing temporary devices
Now that each temporary device object can cleanup after it has detected
that it has disappeared it is no longer necessary to keep this logic as
well in the adapter. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +0, -30 |
| def01de0 |
device: Add timer for removing temporary devices
This adds a timer for how long to keep temporary devices, it is updated
everytime the device is seen so devices will be removed even during an
active discovery session which means the discovering for a long period
will no longer just grow without removing devices that disappeared. |
Luiz Augusto von Dentz |
5 years ago |
4 files, +53, -0 |
| df7d3fa5 |
audio/avrcp: Always update transport volume regardless of player
`Volume` is a special property that not only exists on players but also
on the transport (see org.bluez.MediaTransport1). A player is not
attached when the controller does not support FEATURE_CATEGORY_1, which
is common on headphones without media browsing capabilities.
On such audio devices (headphones, in-ears and the like) Absolute Volume
is not available unless an external player is registered
(org.bluez.Media1.RegisterPlayer) and the device sends a volume event
back after that to set a2dp->volume in transport.c to a valid value
(causing volume_exists to finally return true).
This [1] mail thread denoting the same issue has a solution to at least
request capabilities from the controller, but the proposed player object
is not created on category 2 devices. Any notifications received on
AVRCP_EVENT_VOLUME_CHANGED (avrcp_volume_changed) that is subsequently
registered, or handling the result of avrcp_set_volume in
avrcp_handle_set_volume will be ignored unless said player is present.
This issue is not addressed by adding a fake player but instead dealing
with the fact that volume is "special" and available on the transport
regardless of the existence of a player. This is confirmed in
avrcp_get_capabilities_resp as well which requires a player to register
any event except AVRCP_EVENT_VOLUME_CHANGED.
The applied solution moves media_transport_update_device_volume out of
the player and into avrcp_volume_changed/avrcp_handle_set_volume where
it is unconditionally called. These functions are the only users of
avrcp_player->set_volume. |
Marijn Suijten |
5 years ago |
2 files, +8, -20 |
| 3ec6f74d |
adapter: Fix not cleanup temporary devices
When an adapter is powered down or unplugged remove its temporary
devices immediatelly as the application will no longer be able to
connect to them. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +5, -5 |
| a20362a1 |
tools/mesh: Get rid of "unreliable opcodes" in models
This removes an old notion of unreliable opcodes in models , i.e.,
a correctly formatted acknowledged message always gets a response. |
Inga Stotland |
5 years ago |
6 files, +5, -8 |
| 7e42aa7a |
mesh: Get rid of "unreliable opcodes" in config server
This removes an old notion of unreliable opcodes in config server
model , i.e., a correctly formatted acknowledged message always
gets a response. |
Inga Stotland |
5 years ago |
2 files, +11, -22 |
| 014418ca |
mesh: Add Composition page storage to node.json
Mesh supports multiple Composition Pages, although only one is defined
in the current specification. This change allows saving and retrieval of
any pages, numbered 0-255. |
Brian Gix |
5 years ago |
5 files, +320, -32 |
| 615d8233 |
client: Add support for the Roles property.
This adds support for reading the Roles property through bluetootctl's
show option.
[bluetooth]# show
...
Roles: central
Roles: peripheral
Roles: central-peripheral |
Alain Michaud |
5 years ago |
1 file, +1, -0 |
| f76ca728 |
adapter: add support for the Roles property
This patch adds support for the Roles property as defined in
adapter-api.txt. |
Alain Michaud |
5 years ago |
1 file, +91, -0 |
| 73936fd2 |
input: Make HID devices support wake
HID devices can wake the host from a suspended state. Mark the profiles
to support wake when they are accepted. If the device hasn't already
been configured with a Wake Allowed configuration, it will default to
yes when the profile is accepted. |
Abhishek Pandit-Subedi |
5 years ago |
2 files, +2, -0 |
| fb08822b |
doc/device-api: Add WakeAllowed
Add documentation for WakeAllowed, which allows a device to wake the
system from suspend. |
Abhishek Pandit-Subedi |
5 years ago |
1 file, +5, -0 |
| d4c2c8a4 |
client: Display wake allowed property with info
Display whether the device is configured as wake allowed when queried
with cmd_info. |
Abhishek Pandit-Subedi |
5 years ago |
1 file, +1, -0 |
| eaeb0d61 |
device: Support marking a device with wake allowed
If a device is allowed to wake the host system from suspend, it should
be marked as wake allowed. We add support for a new property that is
sent to the kernel via set device flags mgmt op. We also add the dbus
endpoint to allow the wake allowed setting to be controlled.
In order for wake allowed to be set, the profile must also support wake.
This setting isn't exposed to the user but must be set by profiles that
intend to support wake from suspend.
If a device is connecting for the first time, it will be marked
WakeAllowed if the profile supports it. On subsequent reloads of bluez,
the stored setting "WakeAllowed" will be used to override any other
setting. |
Abhishek Pandit-Subedi |
5 years ago |
5 files, +317, -1 |
| 08d9f2ee |
monitor: Decode device flags mgmt ops and event
Add support for Get Device Flags and Set Device Flags mgmt operations
and Device Flags Changed mgmt event.
Sample trace:
@ MGMT Command: Set Device Flags (0x0050) plen 11 {0x0002} [hci0]
LE Address: CD:F3:CD:13:C5:91 (Static)
Current Flags: 0x00000000
@ MGMT Event: Device Flags Changed (0x002a) plen 15 {0x0001} [hci0]
LE Address: CD:F3:CD:13:C5:91 (Static)
Supported Flags: 0x00000001
Remote Wakeup
Current Flags: 0x00000000
@ MGMT Event: Device Flags Changed (0x002a) plen 15 {0x0004} [hci0]
LE Address: CD:F3:CD:13:C5:91 (Static)
Supported Flags: 0x00000001
Remote Wakeup
Current Flags: 0x00000000
@ MGMT Event: Device Flags Changed (0x002a) plen 15 {0x0003} [hci0]
LE Address: CD:F3:CD:13:C5:91 (Static)
Supported Flags: 0x00000001
Remote Wakeup
Current Flags: 0x00000000
@ MGMT Event: Command Complete (0x0001) plen 10 {0x0002} [hci0]
Set Device Flags (0x0050) plen 7
Status: Success (0x00)
LE Address: CD:F3:CD:13:C5:91 (Static) |
Abhishek Pandit-Subedi |
5 years ago |
1 file, +70, -0 |
| f369b95f |
mgmt: Add mgmt op and events for device flags
Add Get Device Flags, Set Device Flags and Device Flags Changed. |
Abhishek Pandit-Subedi |
5 years ago |
1 file, +31, -0 |
| bce45016 |
mesh: Fix Seg Fault - App unattached IVIndex chg
Object path to node interfaces do not exist unless the owning
application is attached. This caused a Segmentation fault if IVIndex
change was signaled.
Crash output:
mesh/pb-adv.c:send_adv_segs() size: 01, CRC: 3e
mesh/pb-adv.c:pb_adv_packet() Link closed notification: 00
mesh/net.c:update_iv_ivu_state() iv_upd_state = IV_UPD_NORMAL
Program received signal SIGSEGV, Segmentation fault.
0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
(gdb) backtrace
0 0xb6fbc1dc in strlen () from /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so
1 0x00448488 in l_str_hash (p=0x0) at ell/hashmap.c:168
2 0x00448980 in l_hashmap_lookup (hashmap=0x46b550, key=key@entry=0x0) at ell/hashmap.c:487
3 0x00444704 in _dbus_object_tree_property_changed (dbus=0x469438, path=0x0, interface_name=0x44bb74 "org.bluez.mesh.Node1", property_name=0x44aa18 "IVIndex") at ell/dbus-service.c:1196
4 0x0044545c in l_dbus_property_changed (dbus=<optimized out>, path=<optimized out>, interface=<optimized out>, property=<optimized out>) at ell/dbus-service.c:1804
5 0x0041805c in node_property_changed (node=<optimized out>, property=<optimized out>) at mesh/node.c:2392
6 0x0040c690 in update_iv_ivu_state (ivu=false, iv_index=0, net=0x46e240) at mesh/net.c:2569
7 process_beacon (net_ptr=0x46e240, user_data=0xbefff1e4) at mesh/net.c:2610
8 0x00431edc in l_queue_foreach (queue=<optimized out>, function=0x40c468 <process_beacon>, user_data=user_data@entry=0xbefff1e4) at ell/queue.c:441
9 0x0040a848 in beacon_recv (user_data=<optimized out>, info=<optimized out>, data=<optimized out>, len=<optimized out>) at mesh/net.c:2647
10 0x00431edc in l_queue_foreach (queue=<optimized out>, function=0x408bec <process_rx_callbacks>, function@entry=0x15463acd, user_data=user_data@entry=0xbefff230) at ell/queue.c:441
11 0x00409ec0 in process_rx (len=<optimized out>, data=0xbefff297 "+\001", addr=0xbefff258 "\260\362B", instant=4646248, rssi=-78 '\262', pvt=<optimized out>) at mesh/mesh-io-generic.c:121
12 event_adv_report (io=0x46c3c8, size=<optimized out>, buf=0xbefff255) at mesh/mesh-io-generic.c:159
13 event_callback (buf=<optimized out>, size=<optimized out>, user_data=0x46c3c8) at mesh/mesh-io- generic.c:172
14 0x0042ff58 in queue_foreach (queue=0x46d370, function=0x42f2b0 <process_notify>, user_data=user_data@entry= 0xbefff289) at src/shared/queue.c:219
15 0x0042f674 in process_event (size=<optimized out>, data=0xbefff283, hci=0x46c3d8) at src/shared/hci.c:258
16 io_read_callback (io=<optimized out>, user_data=0x46c3d8) at src/shared/hci.c:286
17 0x00432600 in io_callback (fd=<optimized out>, events=1, user_data=0x46d318) at ell/io.c:126
18 0x0043348c in l_main_iterate (timeout=<optimized out>) at ell/main.c:470
19 0x00433554 in l_main_run () at ell/main.c:520
20 l_main_run () at ell/main.c:502
21 0x004337b4 in l_main_run_with_signal (callback=<optimized out>, user_data=0x0) at ell/main.c:642
22 0x00404e90 in main (argc=<optimized out>, argv=<optimized out>) at mesh/main.c:269
(gdb) |
Brian Gix |
5 years ago |
1 file, +1, -1 |
| 841b7ebe |
client: Add battery percentage to info command
This adds the Battery Percentage to the info command based on
org.bluez.Battery1 API. Example usage:
[bluetooth]# info XX:XX:XX:XX:XX:XX
Device XX:XX:XX:XX:XX:XX (random)
Name: ...
Alias: ...
...
Modalias: ...
Battery Percentage: 0x64 (100) |
Sonny Sasaka |
5 years ago |
1 file, +46, -3 |
| 17d73f1d |
unit/test-gatt: Fix test /TP/GAR/CL/BI-16-C/auto
Test has been using Read Blob Response (0x0d) opcode instead of the
expected Read Response (0x0b) to Read Resquest (0x0a). |
Luiz Augusto von Dentz |
5 years ago |
1 file, +1, -1 |
| 8689322d |
shared/gatt-client: Fix not return error to callback
If a CCC request has been cancelled the pdu given to the callback will
be NULL which was not translated to a proper error. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +1, -1 |
| 15101b16 |
test/test-mesh: Add options to "Models" property
This adds options dictionary to "Models" property to stay
in sync with mesh-api changes. |
Inga Stotland |
5 years ago |
1 file, +12, -9 |
| 36dbc338 |
tools/mesh-cfgclient: Add options to "Models" property
This adds options dictionary to "Models" property to stay
in sync with mesh-api changes. |
Inga Stotland |
5 years ago |
1 file, +19, -6 |
| e803b548 |
mesh: Check app model settings of pub/sub support
This adds handling of new options dictionary included with
"Models" and "VendorModels" properties on org.bluez.mesh.Element1
interface.
Supported (optional) dictionary entries:
"Publish" - indicates whether the model supports publication mechanism.
If not present, publication is enabled.
"Subscribe" - indicates whether the model supports subscription mechanism.
If not present, subscriptions are enabled.
If a config message related to subscription state is received for a model
that does not support subscription mechanism, an error code 0x08,
("Not A Subscribe Model") is sent in response.
If a config message related to publication state is received for a model
that does not support publication mechanism, an error code 0x07
("Invalid Publish Parameters") is sent in response. |
Inga Stotland |
5 years ago |
5 files, +309, -47 |
| 807886eb |
doc/mesh-api: Add dictionary to model properties
This changes the signature of "Models" and "VendorModels" properties
on org.bluez.mesh.Element1 interface to contain a dictionary with
model options.
Models: signature change "aq" -> "a(qa{sv})"
VendorModels: signature change "a(qq)" -> "a(qqa{sv})"
Currently, the defined keywords for the options dictionary are
"Publish" - indicates whether the model supports publication mechanism.
If not present, publication is enabled.
"Subscribe" - indicates whether the model supports subscription mechanism.
If not present, subscriptions are enabled.
The dictionary allowed to be empty. |
Inga Stotland |
5 years ago |
1 file, +34, -6 |
| 650defa0 |
scanparam: Use configured values when available
This patch updates the scan parameter service to use the configured scan
parameters when available rather than the hardcoded kernel defaults. |
Alain Michaud |
5 years ago |
1 file, +11, -4 |
| 7a35c12a |
gobex: Fix segfault caused by interrupted transfer
When a obex transfer is interrupted by a peer in the middle, the response
G_OBEX_RSP_FORBIDDEN comes and the transfer is freed in transfer_complete.
However gobex is still ref'ed and gobex->io continues to be writable,
so write_data() and then g_obex_abort() are called. When the abort response
comes, struct obc_transfer is already freed, which leads to the crash.
Backtrace :
__GI___pthread_mutex_lock (mutex=0x65732f74) at pthread_mutex_lock.c:67
0xecc6eeda in dbus_connection_get_object_path_data () from libdbus-1.so.3
0x000457d4 in g_dbus_emit_property_changed_full () at gdbus/object.c:1794
0x00045868 in g_dbus_emit_property_changed () at gdbus/object.c:1832
0x000367f0 in transfer_set_status () at obexd/client/transfer.c:211
0x0003681e in transfer_set_status () at obexd/client/transfer.c:206
xfer_complete () at obexd/client/transfer.c:672
0x00022df6 in transfer_complete () at gobex/gobex-transfer.c:103
0x00022f44 in transfer_abort_response () at gobex/gobex-transfer.c:124
0x00020a0e in handle_response () at gobex/gobex.c:1128
0x00020dde in incoming_data () at gobex/gobex.c:1373
This commit introduces g_obex_drop_tx_queue(), which will be called if
a transfer error detected. After the tx queue is dropped, obex shuts
down gracefully. |
Denis Grigorev |
5 years ago |
3 files, +16, -0 |
| 96c140c2 |
mesh: Clean up config model publication set
No functioal changes. Make code more readable, plus style fixes. |
Inga Stotland |
5 years ago |
1 file, +37, -40 |
| c178cf8d |
a2dp: Fix typo in endpoint_setconf_ind
This patch simply fixes a typo in endpoint_setconf_ind. |
Alain Michaud |
5 years ago |
1 file, +1, -1 |
| 2579cb5a |
avdtp: Fix possible unbalance ref count
It has been reported that under some unknown circuntances the reference
number of AVDTP sessions can go bellow 0 (loop around) causing a crash:
bluetoothd[5633]: profiles/audio/avdtp.c:avdtp_ref() 0x56a882b8a500: ref=-2101995743
bluetoothd[5633]: profiles/audio/a2dp.c:discover_cb() err (nil)
WARNING crash_reporter[10707]: [user] Received crash notification for bluetoothd[5633] |
Luiz Augusto von Dentz |
5 years ago |
1 file, +15, -9 |
| 84ee3a8f |
shared/gatt-client: Fix freeing instance while processing notification
If CCC fails to be programmed the callback would be run without taking
a reference which may lead to freeing the client instance while there
are still notification to be processed.
To fix this handling of both success and failure to program the CCC will
now take a reference to the client, also in case of failure instead of
attempting to program the CCC once again the code now notify all the
queued requests which is consistent with how the success case is
handled. |
Luiz Augusto von Dentz |
5 years ago |
1 file, +20, -26 |
| 9469ea03 |
src/shared: update uuid16_table to latest
Update the table of 16-bit UUID to manufacturer name string to the
latest from this url:
https://www.bluetooth.com/specifications/assigned-numbers/16-bit-uuids-for-members/
I used this script to convert to the bluez format:
https://github.com/noahp/bt-sig-16-bit-uuids |
Noah Pendleton |
5 years ago |
1 file, +273, -84 |
| b7992c3c |
mesh: Fix memory leak when queuing OB pkts rapidly
If a new packet for outbound delivery is queued during the last
transmission of the only other packet being sent, the prior
packet got forgotten and leaked. This fix correctly deletes the prior
packet, but also makes sure it is given the proper oportunity for
transmission. |
Brian Gix |
5 years ago |
1 file, +14, -10 |
| e462e1c4 |
tools/mesh-cfgclient: add list of blacklisted addresses
This adds a concept of "blacklisted" addresses. that a provisioner is
not allowed to assign to newly added mesh nodes.
An address may be "blacklisted" is a node has been removed from the network
(e.g., after node reset procedure). This ensures that the addresses are not
reused for provisioning new nodes to prevent a potential communication
problem due to saved RPL entries associated with these addresses in the
rest of the mesh network. The address is "cleared", when IV index updates
at least twice. |
Inga Stotland |
5 years ago |
5 files, +252, -10 |
| c9790544 |
tools/mesh-cfgclient: get/set IV index
This adds keeping track of IV index changes.
The updates are detected by observing PropertiesChanged signal
on local node's object path and reading "IvIndex" property |
Inga Stotland |
5 years ago |
3 files, +65, -2 |
| af07ca69 |
mesh: Emit PropertiesChanged when IV Index changes
This adds emitting of PropertiesChanged signal whenever the
mesh IV index is updated to indicate that the vlaues of "IvIndex"
property has been modified. |
Inga Stotland |
5 years ago |
3 files, +12, -0 |
| 3391fb4a |
checkpatch: Add configuration for checkpatch
This patch adds a configuration with basic rules for checkpatch. |
Tedd Ho-Jeong An |
5 years ago |
1 file, +14, -0 |
| c29241fe |
midi: Fix random empty timestamp_high value
The timestamp_high value is assigned from the monotonic time but there
is a chance that the value becomes zero because it reads the value
between bit8 and bit13.
This patch makes sure the timestamp_high value get a non-zero value. |
Tedd Ho-Jeong An |
5 years ago |
1 file, +7, -2 |
| b53fef50 |
midi: Fix SysEx parser in MIDI plugin
The SysEx end of message parser didn't consider the fact that
timestampsLow are in the stream and it might have the EOX (F7)
byte as well.
Fix that by always assuming the first system message byte is
the timestampLow.
Future work would involve support other type of system message
bytes, such as real-time. |
Tedd Ho-Jeong An |
5 years ago |
1 file, +31, -7 |
| 3cc6624d |
btmgmt: Add command "add" into "monitor" btmgmt submenu
This patch introduces a new command ‘add’ within "monitor" submenu to
allow users to add advertisement monitor filters and get back monitor
handlers. An event handler is also added to handle kernel issued
MGMT_EV_ADV_MONITOR_ADDED events. The command will work with the new
MGMT opcode MGMT_OP_ADD_ADV_MONITOR. This patch only adds support for
adding pattern based filters.
Tested on Atlas Chromebook with a sample stdout below:
[mgmt]# add -p 0:1:c504 1:a:9a55beef
Advertisement monitor with handle:0x0005 added
[mgmt]# add -p 0:1:xxxx
Failed to parse monitor patterns.
Usage: add <-p|-h> [options...]
Monitor Types:
-p <ad_type:offset:pattern>... Pattern Monitor
e.g.:
add -p 0:1:c504 1:a:9a55beef |
Michael Sun |
5 years ago |
1 file, +124, -0 |
| fbc85a50 |
btmgmt: Add command "remove" into "monitor" btmgmt submenu
This patch introduces a new btmgmt command ‘remove’ wihtin "monitor"
submenu to allow users to remove previously added filters along with a
event handler to handle kernel issued MGMT_EV_ADV_MONITOR_REMOVED
event. The command will work with the new
MGMT opcode MGMT_OP_REMOVE_ADV_MONITOR.
Tested on Atlas Chromebook with a sample stdout below:
[mgmt]# remove 1
Advertisement monitor with handle: 0x0001 removed
[mgmt]# remove 1234
Could not remove advertisement monitor with status 0x11 (Invalid Index) |
Michael Sun |
5 years ago |
1 file, +56, -0 |
| 3f96e817 |
btmgmt: Add "monitor" btmgmt submenu and command "features"
This patch introduces a new submenu "monitor" along with command
‘features’ to help user query for supported advertisement features. The
command will work with the new MGMT opcode
MGMT_OP_READ_ADV_MONITOR_FEATURES.
Tested on Atlas Chromebook with a sample stdout below:
[mgmt]# features
Supported features:
None
Enabled features:
None
Max number of handles: 32
Max number of patterns: 16
Handles list with 2 items:
0x0001
0x0002 |
Michael Sun |
5 years ago |
1 file, +88, -0 |
| c3410029 |
mesh: Replace BeaconFlags with just IvUpdate
To import nodes, applications need just IvIndex and IvUpdate. KeyRefresh
phase in under provisioner's control, so we don't need to expose it.
Moreover, BeaconFlags property dealt just with the primary net key, and
each subnet key is refreshed separately. |
Michał Lowas-Rzechonek |
5 years ago |
2 files, +12, -8 |
| fd353235 |
mesh: Add deferral of Attach() and Leave() if busy
We require the successful return of JoinComplete() method before
handling subsequent Attach() or Leave() method calls. To simplify the
construction of Applications, we will accept one of these calls up to 1
second prior to receiving the final return status of JoinComplete,
which tells us that the Application is ready to use the node.
If the node is still not ready after the deferral, Attach and/or Leave
will fail. |
Brian Gix |
5 years ago |
1 file, +52, -2 |
| fd265a81 |
main: adding missing connection parameter entries
This patch adds the missing connection parameter entries for loading
connection parameters from main.conf |
Alain Michaud |
5 years ago |
1 file, +16, -0 |
| 4e7e142b |
lib: Correct the string for a mgmt op
This corrects the string of MGMT_OP_ADD_ADV_PATTERNS_MONITOR to match
mgmt-api.txt. |
Miao-chen Chou |
5 years ago |
1 file, +1, -1 |
| 5ad9a639 |
main: Add configurable le autoconnect timeout value
This patch adds support for a configurable le autoconnect timer. |
Alain Michaud |
5 years ago |
5 files, +16, -0 |
| 0a10b4f9 |
main: Fix logical error when loading controller params
Fix logical error when loading configuration parameters from the
config file. Without this patch, the maximum allowable value is always
used. |
Alain Michaud |
5 years ago |
1 file, +4, -3 |
| 4527a8ad |
mesh: Rename IVUpdate import flag to IvUpdate
Name change for consistency with "IvIndex" property. |
Michał Lowas-Rzechonek |
5 years ago |
2 files, +2, -2 |