Skip to content

Commit a954e58

Browse files
authored
Minor cleanup
1 parent cc7dd5e commit a954e58

File tree

1 file changed

+14
-13
lines changed
  • libraries/Bluefruit52Lib/examples/Peripheral/ancs

1 file changed

+14
-13
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/ancs/ancs.ino

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,27 @@ void loop()
7777
// If service is not yet discovered
7878
if ( !bleancs.discovered() ) return;
7979

80-
// Your handling code here
80+
// Your code here
8181
}
8282

8383
void connect_callback(void)
8484
{
8585
Serial.println("Connected");
8686

87-
Serial.print("Dicovering DIS ... ");
87+
Serial.print("Discovering DIS ... ");
8888
if ( bleClientDis.discover( Bluefruit.connHandle()) )
8989
{
90-
Serial.println("Found it");
90+
Serial.println("Discovered");
9191

92-
// read and print out Manufacturer
92+
// Read and print Manufacturer string
9393
memset(buffer, 0, sizeof(buffer));
9494
if ( bleClientDis.getManufacturer(buffer, sizeof(buffer)) )
9595
{
9696
Serial.print("Manufacturer: ");
9797
Serial.println(buffer);
9898
}
9999

100-
// read and print out Model Number
100+
// Read and print Model Number string
101101
memset(buffer, 0, sizeof(buffer));
102102
if ( bleClientDis.getModel(buffer, sizeof(buffer)) )
103103
{
@@ -111,14 +111,14 @@ void connect_callback(void)
111111
Serial.print("Discovering ANCS ... ");
112112
if ( bleancs.discover( Bluefruit.connHandle() ) )
113113
{
114-
Serial.println("Found it");
114+
Serial.println("Discovered");
115115

116116
// 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 ... ");
118118
if ( Bluefruit.requestPairing() )
119119
{
120-
Serial.println("Done");
121-
Serial.println("Enable Notification");
120+
Serial.println("Done");
121+
Serial.println("Enabling notifications");
122122
Serial.println();
123123
bleancs.enableNotification();
124124

@@ -139,8 +139,9 @@ void ancs_notification_callback(AncsNotification_t* notif)
139139
Serial.print(" | ");
140140

141141
// 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.
144145
// U+202D is E2-80-AD, U+202C is E2-80-AC in UTF-8
145146
memset(buffer, 0, sizeof(buffer));
146147
bleancs.getAttribute(notif->uid, ANCS_ATTR_TITLE, buffer, sizeof(buffer));
@@ -151,7 +152,7 @@ void ancs_notification_callback(AncsNotification_t* notif)
151152
bleancs.getAttribute(notif->uid, ANCS_ATTR_MESSAGE, buffer, sizeof(buffer));
152153
Serial.printf("%-15s | ", buffer);
153154

154-
// Get App ID and store to app_id
155+
// Get App ID and store in the app_id variable
155156
char app_id[64] = { 0 };
156157
memset(buffer, 0, sizeof(buffer));
157158
bleancs.getAttribute(notif->uid, ANCS_ATTR_APP_IDENTIFIER, buffer, sizeof(buffer));
@@ -165,7 +166,7 @@ void ancs_notification_callback(AncsNotification_t* notif)
165166

166167
Serial.println();
167168

168-
// Automatically accept incoming call using perform Action
169+
// Automatically accept incoming calls using 'performAction'
169170
if ( notif->categoryID == ANCS_CAT_INCOMING_CALL && notif->eventID == ANCS_EVT_NOTIFICATION_ADDED)
170171
{
171172
Serial.println("Incoming call accepted");

0 commit comments

Comments
 (0)