This commit is contained in:
hathach committed 2017-04-12 17:56:28 +07:00
1 parent 482f0e987b
commit 701a407d5e
2 files changed
+9 -5

No files matched your search

@@ -106,7 +106,7 @@ void ancs_notification_callback(AncsNotification_t* notif)
// Get Application Name ( not work yet)
memset(buffer, 0, sizeof(buffer));
n = bleancs.getAppAttribute(app_id, ANCS_APP_ATTR_DISPLAY_NAME, buffer, sizeof(buffer));
Serial.printf("%-15 | ", buffer);
Serial.printf("%-15s | ", buffer);
Serial.println();
@@ -136,8 +136,8 @@ void connect_callback(void)
Serial.println();
bleancs.enableNotification();
Serial.println("| Event | Category (count) | Title | Message | App ID | App Name |");
Serial.println("-------------------------------------------------------------------------------------------------------------");
Serial.println("| Event | Category (count) | Title | Message | App ID | App Name |");
Serial.println("---------------------------------------------------------------------------------------------------------------");
}
}
}
@@ -201,7 +201,6 @@ uint16_t BLEAncs::getAttribute(uint32_t uid, uint8_t attr, void* buffer, uint16_
_evt_bufsize = bufsize;
// Write command using write response
PRINT_BUFFER(&command, cmdlen);
VERIFY( cmdlen == _control.write_resp(&command, cmdlen), 0);
// wait for 1st response's data arrived to parse attribute length
@@ -251,7 +250,12 @@ uint16_t BLEAncs::getAppAttribute(const char* appid, uint8_t attr, void* buffer,
// Write command using write response
PRINT_BUFFER(command, cmdlen);
(void) _control.write_resp(command, cmdlen);
if ( cmdlen != _control.write_resp(command, cmdlen) )
{
rtos_free(command);
return 0;
}
rtos_free(command);
// Phase 1: Get data until Attribute Length is known