-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.c
64 lines (57 loc) · 1.15 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* test.c
*
* Created on: 11 janv. 2022
* Author: Clement CARDOT
*/
#include "Bluetooth.h"
#include "ps2Monitor.h"
void toogleBlueLED(void);
void toogleRedLED(void);
void testBluetoothSendChar(void);
void testBluetoothSendString(void);
void testIsBluetoothPaired(void);
/*
* Methode executant tous les tests unitaires
*/
void test(void){
toogleBlueLED();
toogleRedLED();
testIsBluetoothPaired();
testBluetoothSendChar();
testBluetoothSendString();
}
/*
* Changement d'etat de la led bleu (Built-in)
*/
void toogleBlueLED(void){
HAL_GPIO_TogglePin(LED_BLUE_GPIO, LED_BLUE_PIN);
}
/*
* Changement d'etat de la led rouge (PCB)
*/
void toogleRedLED(void){
HAL_GPIO_TogglePin(LED_RED_GPIO, LED_RED_PIN);
}
/*
* Envoi d'un caractere en Bluetooth
*/
void testBluetoothSendChar(void){
uint8_t c = 'T';
sendChar(c);
}
/*
* Envoi d'une chaine de caracteres en Bluetooth
*/
void testBluetoothSendString(void){
uint8_t * c = "est\n";
sendString(c, 4);
}
/*
* Test de lecture de l'etat du HC_05
*/
void testIsBluetoothPaired(void){
if(isBluetoothPaired()){
toogleBlueLED();
}
}