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: Bluetooth_HC05_LE_TRAME.cpp
- Revision:
- 2:7d02a128e1e3
- Parent:
- 1:7cc085e87bb0
- Child:
- 3:8fd068b00d9c
--- a/Bluetooth_HC05_LE_TRAME.cpp Fri Mar 17 18:14:59 2017 +0000
+++ b/Bluetooth_HC05_LE_TRAME.cpp Sat Mar 18 11:13:44 2017 +0000
@@ -33,9 +33,9 @@
wait(1);
}
-char Bluetooth_HC05_LE_TRAME::recevoir(int longueur) //1 ere tentative
+void Bluetooth_HC05_LE_TRAME::recevoir() //1 ere tentative
{
- //char* recu=NULL;
+ char* recu=NULL;
@@ -47,17 +47,24 @@
///////////////////////////////////////////////OK rematrre apres
if(seriale.readable())
{
- // for(i=0;i<longueur;i++)
- // {
+ for(i=0;i<4;i++)
+ {
buffer[compteur]=seriale.getc();
compteur++;
- // }
+ }
}
- char buffer_copie[compteur];
+ /* char buffer_copie[compteur];
for(i=0;i<compteur;i++)
+ {
buffer_copie[i]=buffer[i];
+ }*/
+
+ for(i=0;i<compteur;i++)
+ {
+ this->buf[i]=buffer[i];
+ }
//recu=buffer;
@@ -68,8 +75,9 @@
// this->resetBuffer();
// char*recu=&buffer_copie[0];
- char recu= buffer_copie[0];
- return(recu);
+
+
+ // return(recu);
}
@@ -94,3 +102,9 @@
ok=1;
return ok;
}
+
+char* Bluetooth_HC05_LE_TRAME::getBuf()
+{
+ return(this->buf);
+}
+