Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: lib.cpp
- Revision:
- 5:562b8d04dfd4
- Parent:
- 4:9fbefd153e3e
- Child:
- 6:d0582711a5d1
--- a/lib.cpp Mon Apr 25 00:52:10 2016 +0000
+++ b/lib.cpp Mon Apr 25 00:56:46 2016 +0000
@@ -82,7 +82,7 @@
for (int i = 0; i < sizeof(CMD)/ sizeof(char); i++) {
android->putc(CMD[i]);
}
-
+
while (!android->readable());
char temp = android->getc();
if (temp == SUCCESS) return true;
@@ -107,7 +107,32 @@
for (int i = 0; i < sizeof(CMD)/ sizeof(char); i++) {
android->putc(CMD[i]);
}
-
+
+ while (!android->readable());
+ char temp = android->getc();
+ if (temp == SUCCESS) return true;
+ else return false;
+}
+
+bool speech_enroll(char *user_id, Serial *android)
+{
+ char CMD[] = {
+ CMD_ENROLL,
+ 0x02,
+ 0x04,
+ 0x01,
+ user_id[0],
+ user_id[1],
+ user_id[2],
+ user_id[3],
+ SPEECH_FID,
+ '\0'
+ };
+
+ for (int i = 0; i < sizeof(CMD)/ sizeof(char); i++) {
+ android->putc(CMD[i]);
+ }
+
while (!android->readable());
char temp = android->getc();
if (temp == SUCCESS) return true;