@@ -77,27 +77,27 @@ void loop()
77
77
// If service is not yet discovered
78
78
if ( !bleancs.discovered () ) return ;
79
79
80
- // Your handling code here
80
+ // Your code here
81
81
}
82
82
83
83
void connect_callback (void )
84
84
{
85
85
Serial.println (" Connected" );
86
86
87
- Serial.print (" Dicovering DIS ... " );
87
+ Serial.print (" Discovering DIS ... " );
88
88
if ( bleClientDis.discover ( Bluefruit.connHandle ()) )
89
89
{
90
- Serial.println (" Found it " );
90
+ Serial.println (" Discovered " );
91
91
92
- // read and print out Manufacturer
92
+ // Read and print Manufacturer string
93
93
memset (buffer, 0 , sizeof (buffer));
94
94
if ( bleClientDis.getManufacturer (buffer, sizeof (buffer)) )
95
95
{
96
96
Serial.print (" Manufacturer: " );
97
97
Serial.println (buffer);
98
98
}
99
99
100
- // read and print out Model Number
100
+ // Read and print Model Number string
101
101
memset (buffer, 0 , sizeof (buffer));
102
102
if ( bleClientDis.getModel (buffer, sizeof (buffer)) )
103
103
{
@@ -111,14 +111,14 @@ void connect_callback(void)
111
111
Serial.print (" Discovering ANCS ... " );
112
112
if ( bleancs.discover ( Bluefruit.connHandle () ) )
113
113
{
114
- Serial.println (" Found it " );
114
+ Serial.println (" Discovered " );
115
115
116
116
// ANCS requires pairing to work, it makes sense to request security here as well
117
- Serial.print (" Attempt to PAIR with iOS, please press PAIR on your phone ... " );
117
+ Serial.print (" Attempting to PAIR with the iOS device , please press PAIR on your phone ... " );
118
118
if ( Bluefruit.requestPairing () )
119
119
{
120
- Serial.println (" Done" );
121
- Serial.println (" Enable Notification " );
120
+ Serial.println (" Done" );
121
+ Serial.println (" Enabling notifications " );
122
122
Serial.println ();
123
123
bleancs.enableNotification ();
124
124
@@ -139,8 +139,9 @@ void ancs_notification_callback(AncsNotification_t* notif)
139
139
Serial.print (" | " );
140
140
141
141
// Get notification Title
142
- // iDevice often include Unicode "Bidirection Text Control" in the Title.
143
- // Mostly are U+202D as beginning and U+202C as ending. You may want to remove them
142
+ // iDevice often includes Unicode "Bidirection Text Control" in the Title.
143
+ // Most strings have U+202D at the beginning and U+202C at the end. You may
144
+ // want to remove them.
144
145
// U+202D is E2-80-AD, U+202C is E2-80-AC in UTF-8
145
146
memset (buffer, 0 , sizeof (buffer));
146
147
bleancs.getAttribute (notif->uid , ANCS_ATTR_TITLE, buffer, sizeof (buffer));
@@ -151,7 +152,7 @@ void ancs_notification_callback(AncsNotification_t* notif)
151
152
bleancs.getAttribute (notif->uid , ANCS_ATTR_MESSAGE, buffer, sizeof (buffer));
152
153
Serial.printf (" %-15s | " , buffer);
153
154
154
- // Get App ID and store to app_id
155
+ // Get App ID and store in the app_id variable
155
156
char app_id[64 ] = { 0 };
156
157
memset (buffer, 0 , sizeof (buffer));
157
158
bleancs.getAttribute (notif->uid , ANCS_ATTR_APP_IDENTIFIER, buffer, sizeof (buffer));
@@ -165,7 +166,7 @@ void ancs_notification_callback(AncsNotification_t* notif)
165
166
166
167
Serial.println ();
167
168
168
- // Automatically accept incoming call using perform Action
169
+ // Automatically accept incoming calls using 'performAction'
169
170
if ( notif->categoryID == ANCS_CAT_INCOMING_CALL && notif->eventID == ANCS_EVT_NOTIFICATION_ADDED)
170
171
{
171
172
Serial.println (" Incoming call accepted" );
0 commit comments