Skip to content

Commit

Permalink
Apple Notification Center Service - iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ldab authored and jakkra committed Nov 17, 2023
1 parent b7bf0b0 commit 713a3e5
Show file tree
Hide file tree
Showing 8 changed files with 618 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Build firmware for iOS
working-directory: ZSWatch
run: |
west build app --build-dir ${{ matrix.board }}_${{ matrix.built_type }}_ios -p -b ${{ matrix.board }} -- -DOVERLAY_CONFIG=boards/${{ matrix.built_type }}.conf -DCONFIG_BLE_USES_AMS="y"
west build app --build-dir ${{ matrix.board }}_${{ matrix.built_type }}_ios -p -b ${{ matrix.board }} -- -DOVERLAY_CONFIG=boards/${{ matrix.built_type }}.conf -DCONFIG_BLE_USES_IOS="y"
cd ${{ matrix.board }}_${{ matrix.built_type }}/zephyr
mv zephyr.hex ${{ matrix.board }}_${{ matrix.built_type }}.hex || true
Expand Down
3 changes: 2 additions & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ target_sources(app PRIVATE src/ble/ble_aoa.c)
target_sources(app PRIVATE src/ble/ble_comm.c)
target_sources(app PRIVATE src/ble/ble_transport.c)
target_sources(app PRIVATE src/ble/zsw_gatt_sensor_server.c)
target_sources_ifdef(CONFIG_BLE_USES_AMS app PRIVATE src/ble/ble_ams.c)
target_sources_ifdef(CONFIG_BLE_USES_IOS app PRIVATE src/ble/ble_ams.c)
target_sources_ifdef(CONFIG_BLE_USES_IOS app PRIVATE src/ble/ble_ancs.c)

target_sources(app PRIVATE src/sensors/zsw_imu.c)
target_sources(app PRIVATE src/sensors/zsw_pressure_sensor.c)
Expand Down
6 changes: 4 additions & 2 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,12 @@ menu "ZSWatch"

config BLE_USES_GADGETBRIDGE
prompt "Smartphone interaction and notifications uses Gadgetbridge"
config BLE_USES_AMS
prompt "Smartphone uses Apple Media Service Client"
config BLE_USES_IOS
prompt "Smartphone uses Apple Services Client"
select BT_GATTP
select BT_GATT_DM
select BT_AMS_CLIENT
select BT_ANCS_CLIENT
endchoice

endmenu
Expand Down
6 changes: 3 additions & 3 deletions app/src/applications/music_control/music_control_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <zsw_clock.h>
#include <zephyr/zbus/zbus.h>

#ifdef CONFIG_BLE_USES_AMS
#ifdef CONFIG_BLE_USES_IOS
#include "ble/ble_ams.h"
#endif

Expand Down Expand Up @@ -85,7 +85,7 @@ static void on_music_ui_evt_music(music_control_ui_evt_type_t evt_type)
ble_comm_send(buf, msg_len);
}

#elif defined(CONFIG_BLE_USES_AMS)
#elif defined(CONFIG_BLE_USES_IOS)

switch (evt_type) {
case MUSIC_CONTROL_UI_CLOSE:
Expand All @@ -105,7 +105,7 @@ static void on_music_ui_evt_music(music_control_ui_evt_type_t evt_type)
break;
}

#endif // CONFIG_BLE_USES_AMS
#endif // CONFIG_BLE_USES_IOS
}

static void zbus_ble_comm_data_callback(const struct zbus_channel *chan)
Expand Down
Loading

0 comments on commit 713a3e5

Please sign in to comment.