Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [pull_request]

jobs:
ci:
runs-on: ubuntu-latest
name: CI for Pull Request
steps:
- name: Checkout the source code
uses: actions/checkout@v3
with:
path: src/src

- name: CI
uses: tedd-an/bzcafe@main
with:
task: ci
base_folder: src
space: user
github_token: ${{ secrets.ACTION_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
patchwork_token: ${{ secrets.PATCHWORK_TOKEN }}
patchwork_user: ${{ secrets.PATCHWORK_USER }}

26 changes: 26 additions & 0 deletions .github/workflows/code_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Code Scan

on:
schedule:
- cron: "40 7 * * FRI"

jobs:
code-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout the source
uses: actions/checkout@v2
with:
fetch-depth: 0
path: src
- name: Code Scan
uses: BluezTestBot/action-code-scan@main
with:
src_path: src
github_token: ${{ secrets.GITHUB_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: scan_report
path: scan_report.tar.gz

43 changes: 43 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Sync

on:
schedule:
- cron: "*/30 * * * *"

jobs:
sync_repo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: master

- name: Sync Repo
uses: tedd-an/bzcafe@main
with:
task: sync
upstream_repo: 'https://git.kernel.org/pub/scm/bluetooth/bluez.git'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup PR
uses: tedd-an/bzcafe@main
with:
task: cleanup
github_token: ${{ secrets.ACTION_TOKEN }}

sync_patchwork:
needs: sync_repo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Sync Patchwork
uses: tedd-an/bzcafe@main
with:
task: patchwork
space: user
github_token: ${{ secrets.ACTION_TOKEN }}
email_token: ${{ secrets.EMAIL_TOKEN }}
patchwork_token: ${{ secrets.PATCHWORK_TOKEN }}
patchwork_user: ${{ secrets.PATCHWORK_USER }}

5 changes: 4 additions & 1 deletion src/adapter.c
Original file line number Diff line number Diff line change
Expand Up @@ -5634,8 +5634,11 @@ static void add_device_complete(uint8_t status, uint16_t length,
if (btd_opts.device_privacy) {
uint32_t flags = btd_device_get_current_flags(dev);

/* Set Device Privacy Mode has not set the flag yet. */
/* Set Device Privacy Mode if it has not set the flag yet. */
if (!(flags & DEVICE_FLAG_DEVICE_PRIVACY)) {
/* Include the pending flags, or they may get overwritten. */
flags |= btd_device_get_pending_flags(dev);

adapter_set_device_flags(adapter, dev, flags |
DEVICE_FLAG_DEVICE_PRIVACY,
set_device_privacy_complete,
Expand Down
19 changes: 15 additions & 4 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,10 +1548,13 @@ void device_set_wake_support(struct btd_device *device, bool wake_support)
if (device->wake_override == WAKE_FLAG_DEFAULT)
device_set_wake_override(device, wake_support);

/* Set wake_allowed according to the override value. */
device_set_wake_allowed(device,
device->wake_override == WAKE_FLAG_ENABLED,
-1U);
/* Set wake_allowed according to the override value.
* Limit this to bonded device to avoid trying to set it
* to new devices that are simply in range. */
if (device_is_bonded(device, device->bdaddr_type))
device_set_wake_allowed(device,
device->wake_override == WAKE_FLAG_ENABLED,
-1U);
}

static bool device_get_wake_allowed(struct btd_device *device)
Expand Down Expand Up @@ -1628,6 +1631,10 @@ void device_set_wake_allowed(struct btd_device *device, bool wake_allowed,
device->pending_wake_allowed = wake_allowed;

flags = device->current_flags;

/* Include the pending flags, or they may get overwritten. */
flags |= device->pending_flags;

if (wake_allowed)
flags |= DEVICE_FLAG_REMOTE_WAKEUP;
else
Expand Down Expand Up @@ -6694,6 +6701,10 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,

device_auth_req_free(device);

/* Enable the wake_allowed property if required */
if (device->wake_override == WAKE_FLAG_ENABLED)
device_set_wake_allowed(device, true, -1U);

/* If we're already paired nothing more is needed */
if (state->paired)
return;
Expand Down