liaison bluetooth entre gros robot -> panneau ou gros robot -> petit robot
Fork of liaison_Bluetooth by
Diff: LiaisonBluetooth.cpp
- Revision:
- 8:4b5a472a8f94
- Parent:
- 7:543d5548dbb9
- Child:
- 9:f69c70d1bd2d
- Child:
- 10:f5ad5e892d20
diff -r 543d5548dbb9 -r 4b5a472a8f94 LiaisonBluetooth.cpp --- a/LiaisonBluetooth.cpp Fri Apr 13 13:00:25 2018 +0000 +++ b/LiaisonBluetooth.cpp Fri Apr 13 13:04:27 2018 +0000 @@ -71,32 +71,21 @@ void LiaisonBluetooth::envoyer(char idenfitiant, int longueur_data, char *data) { - if (m_state && m_bluetooth->writeable()) { - m_bluetooth->putc(MARQUEUR_DEBUT_TRAME); - } else { m_pc->printf("MARQUEUR_DEBUT_TRAME\n"); } - - if (m_state && m_bluetooth->writeable()) { - m_bluetooth->putc(idenfitiant); - } else { m_pc->printf("idenfitiant\n"); } + m_bluetooth->putc(MARQUEUR_DEBUT_TRAME); + m_bluetooth->putc(idenfitiant); //char *longueur_buffer = convertir_int_en_4char(longueur_data); char str[4]; sprintf(str,"%d", longueur_data); for (int i = 0 ; i < 4 ; i++) { - if (m_state && m_bluetooth->writeable()) { - m_bluetooth->putc(str[i]); - } else { m_pc->printf("longueur_data %d\n", i); } + m_bluetooth->putc(str[i]); } for (int i = 0 ; i < longueur_data ; i++) { - if (m_state && m_bluetooth->writeable()) { - m_bluetooth->putc(data[i]); - } else { m_pc->printf("data %d\n", i); } + m_bluetooth->putc(data[i]); } - if (m_state && m_bluetooth->writeable()) { - m_bluetooth->putc(MARQUEUR_FIN_TRAME); - } else { m_pc->printf("MARQUEUR_FIN_TRAME\n"); } + m_bluetooth->putc(MARQUEUR_FIN_TRAME); }