 |
Groom
1.1
BTS SNIR LaSalle Avignon 2021
|
Aller à la documentation de ce fichier.
20 qDebug() << Q_FUNC_INFO;
32 qDebug() << Q_FUNC_INFO;
58 else qDebug() << Q_FUNC_INFO <<
"Pas de bluetooh !";
75 qDebug() << Q_FUNC_INFO;
106 socketBluetooth =
new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
112 qDebug() << Q_FUNC_INFO << device.name() << device.address().toString();
113 QBluetoothAddress adresse = QBluetoothAddress(device.address());
114 QBluetoothUuid uuid = QBluetoothUuid(QBluetoothUuid::SerialPort);
187 qDebug() << Q_FUNC_INFO;
198 qDebug() << Q_FUNC_INFO << device.name() << device.address().toString();
201 qDebug() << Q_FUNC_INFO <<
"Module Groom trouvé !";
205 emit
groomDetecte(device.name(), device.address().toString());
239 qDebug() << Q_FUNC_INFO << trames;
241 for(
int i = 0; i < trames.count(); ++i)
245 qDebug() << Q_FUNC_INFO << trames[i];
272 qDebug() << Q_FUNC_INFO << trame;
293 QString trame =
"$CMD;" + QString::number(etatGroom) +
";" + QString::number(etatSonnette) +
";" + QString::number(etatPresence) +
"\r\n";
294 qDebug() << Q_FUNC_INFO << trame;
312 QString trame =
"$MSGPERSO;" + messageOccupant +
"\r\n";
313 qDebug() << Q_FUNC_INFO << trame;
339 qDebug() << Q_FUNC_INFO << trame;
340 QStringList champs = trame.split(
";");
341 qDebug() << Q_FUNC_INFO << champs;
#define ENTETE_TRAME
Valeur d'entête de la trame.
QString fabriquerTrame(EtatGroom etatGroom, EtatSonnette etatSonnette, EtatPresence etatPresence)
Méthode de fabrication de la trame "CMD".
QString trameReception
Chaine de caractères de la trame de reception.
void connexionGroom(QString nomPeripherique, QString adressePeripherique)
EtatSonnette
Définit les différents états du mode Sonnette.
QString nomPeripheriqueBluetooth
Nom du périphérique local.
bool estConnecte()
Méthode pour valider la connexion ou non.
void terminerRecherche()
Slot de fin de recherche bluetooth.
QString adressePeripheriqueGroom
Adresse MAC du périphérique distant.
void socketConnected()
Slot de connexion au socket.
QBluetoothDeviceInfo groom
Le module Bluetooth GROOM.
void deconnecter()
Slot de déconnexion bluetooth.
bool peripheriqueGroomTrouve
Booléen si periphérique trouvé ou non.
void deviceDiscovered(const QBluetoothDeviceInfo &device)
Slot d'affichage de périphériques.
#define TRAME_ETAT
Valeur état de la connexion bluetooth (trame alive)
QBluetoothDeviceDiscoveryAgent * discoveryAgent
Pointeur vers la classe QBluetoothDeviceDiscoveryAgent de détection de périphériques.
#define ENTETE_NOM_PERIPHERIQUE
Valeur de l'entête du nom du périphérique "groom-1".
void socketDisconnected()
Slot de déconnexion au socket.
CommunicationGroom(QObject *parent=nullptr)
Déclaration du constructeur.
QString nomPeripheriqueGroom
Nom du périphérique distant.
void connecter()
Slot de connexion bluetooth.
#define TYPE_TRAME
Valeur du type de trame.
EtatGroom
Définit les différents états du groom.
void recevoir()
Slot de reception de trame.
void groomDetecte(QString nomPeripherique, QString adressePeripherique)
~CommunicationGroom()
Déclaration du destructeur.
QStringList traiterTrameReception(QString trame)
Méthode de traitement de trame de l'état de l'occupant.
void rechercher()
Méthode de recherche bluetooth.
QBluetoothLocalDevice peripheriqueBluetooth
L'interface Bluetooth du dongle PC.
void actualiserEtats(int Groom, int Sonnette, int Presence, int ModeSonnette, int ModePresence)
EtatPresence
Définit les différents états du mode Détecteur de présence.
void envoyer(QString trame)
Méthode d'envoi de trame.
#define FIN_TRAME
Valeur de fin de la trame.
QBluetoothSocket * socketBluetooth
La socket de communication Bluetooth (client)
void initialiserBluetooth()
Méthode inititialisation du bluetooth.
QString fabriquerTrameMessageOccupant(QString messageOccupant)
Méthode de fabrication de la trame "MSGPERSO".
Déclaration de la classe CommunicationGroom.
void deconnexionGroom(QString nomPeripherique, QString adressePeripherique)