From 2293c62ae1b3d41568a281b6ac7e21de81f4068b Mon Sep 17 00:00:00 2001
From: schneider <schneider@blinkenlichts.net>
Date: Tue, 13 Oct 2020 00:28:42 +0200
Subject: [PATCH] feat(ble): Make the adv a bit more Apple friendly

Accessory Design Guidelines for Apple Devices says that TX power should
be included in the advertisement.

Also ask for the current time service in the scan report so the card10
shows up in the system dialog.
---
 epicardium/ble/ble_main.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/epicardium/ble/ble_main.c b/epicardium/ble/ble_main.c
index 30de5536c..6c69a9f44 100644
--- a/epicardium/ble/ble_main.c
+++ b/epicardium/ble/ble_main.c
@@ -178,7 +178,11 @@ static const uint8_t bleAdvDataDisc[] =
   /*! service UUID list */
   17,
   DM_ADV_TYPE_128_UUID_PART,
-  CARD10_UUID_SUFFIX, 0x0, CARD10_UUID_PREFIX
+  CARD10_UUID_SUFFIX, 0x0, CARD10_UUID_PREFIX,
+
+  2,                                      /*! length */
+  DM_ADV_TYPE_TX_POWER,                   /*! AD type */
+  0,                                      /*! tx power */
 };
 
 /*! scan data, discoverable mode */
@@ -187,7 +191,11 @@ uint8_t bleScanDataDisc[] =
   /*! device name */
   14,                                      /*! length */
   DM_ADV_TYPE_LOCAL_NAME,                 /*! AD type */
-  'c','a','r','d','1','0','-','0','0','0','0','0','0'
+  'c','a','r','d','1','0','-','0','0','0','0','0','0',
+
+  3,                                      /*! length */
+  DM_ADV_TYPE_16_SOLICIT,                 /*! AD type */
+  UINT16_TO_BYTES(ATT_UUID_CURRENT_TIME_SERVICE),
 };
 
 /*! advertising data, connectable mode */
-- 
GitLab