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.
Revision 4:f597583e8b55, committed 2017-03-19
- Comitter:
- aure
- Date:
- Sun Mar 19 11:08:54 2017 +0000
- Parent:
- 3:8fd068b00d9c
- Commit message:
- vrapide
Changed in this revision
| Bluetooth_HC05_LE_TRAME.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Bluetooth_HC05_LE_TRAME.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Bluetooth_HC05_LE_TRAME.cpp Sat Mar 18 14:41:07 2017 +0000
+++ b/Bluetooth_HC05_LE_TRAME.cpp Sun Mar 19 11:08:54 2017 +0000
@@ -35,14 +35,14 @@
void Bluetooth_HC05_LE_TRAME::recevoir() //1 ere tentative
{
- char* recu=NULL;
+ //char* recu=NULL;
int i=0;
- int compteur=0;
- char buffer[20];
+ int compteur=0;
+ char buffer[20];
///////////////////////////////////////////////OK rematrre apres
if(seriale.readable())
@@ -50,22 +50,23 @@
for(i=0;i<longueur_trame;i++)
{
buffer[compteur]=seriale.getc();
- compteur++;
+ // this->buf[i]=buffer[i]; //rajouter
+ // this->buf[i]=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];
+ //buffer_copie[i]=buffer[i];
+ this->buf[i]=buffer[i];
}
+
+
+
//recu=buffer;
//strcpy(recu,buffer_copie);
@@ -108,3 +109,8 @@
return(this->buf);
}
+int Bluetooth_HC05_LE_TRAME::getLongueurTrame()
+{
+ return(longueur_trame);
+}
+
--- a/Bluetooth_HC05_LE_TRAME.h Sat Mar 18 14:41:07 2017 +0000
+++ b/Bluetooth_HC05_LE_TRAME.h Sun Mar 19 11:08:54 2017 +0000
@@ -28,6 +28,7 @@
char * getBuf();
void resetBuffer();
int donneesRecue();
+ int getLongueurTrame();