Serial pour utiliser avec module ESP10 en mode pont
Dependents: souflerie-sp3-wifi-F411re-2 souflerie-sp2-wifi-F411re-2 souflerie-sp1-wifi-F411re-2 Programme_Final_V6
wifiesp8266.h@4:55ab98f52d77, 2021-06-06 (annotated)
- Committer:
- schnf30
- Date:
- Sun Jun 06 18:09:36 2021 +0000
- Revision:
- 4:55ab98f52d77
3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
schnf30 | 4:55ab98f52d77 | 1 | #ifndef _WifiEsp8266_ |
schnf30 | 4:55ab98f52d77 | 2 | #define _WifiEsp8266_ |
schnf30 | 4:55ab98f52d77 | 3 | // taille maximum d'une phrase recue |
schnf30 | 4:55ab98f52d77 | 4 | #define maxdata 100 |
schnf30 | 4:55ab98f52d77 | 5 | #define Baud 921600 |
schnf30 | 4:55ab98f52d77 | 6 | class WifiEsp8266 : public RawSerial |
schnf30 | 4:55ab98f52d77 | 7 | { |
schnf30 | 4:55ab98f52d77 | 8 | public: |
schnf30 | 4:55ab98f52d77 | 9 | WifiEsp8266(PinName Txd, PinName Rxd,float _TimeOut=NULL); // _TimeOute pour chien de garde en s |
schnf30 | 4:55ab98f52d77 | 10 | void receive(); //recoit les data gps et les stocks puis produit les donnees en cas de reception |
schnf30 | 4:55ab98f52d77 | 11 | bool dataready(void); |
schnf30 | 4:55ab98f52d77 | 12 | char * read(void); |
schnf30 | 4:55ab98f52d77 | 13 | private: |
schnf30 | 4:55ab98f52d77 | 14 | // reception phrase Serial |
schnf30 | 4:55ab98f52d77 | 15 | char _DataTmp[maxdata + 1]; // tableau de donnees pour stocker pendant reception |
schnf30 | 4:55ab98f52d77 | 16 | char _Data[maxdata + 1]; // tableau de donnees lorsque toutes les donnees sont recues |
schnf30 | 4:55ab98f52d77 | 17 | int _DataPtr = 0; // position de stockage de la prochaine donnee a recevoir |
schnf30 | 4:55ab98f52d77 | 18 | bool _Canal1Ok = false; |
schnf30 | 4:55ab98f52d77 | 19 | bool _Canal2Ok = false; |
schnf30 | 4:55ab98f52d77 | 20 | Ticker TGarde; |
schnf30 | 4:55ab98f52d77 | 21 | bool _DataReady = false; |
schnf30 | 4:55ab98f52d77 | 22 | float _TimeOut; |
schnf30 | 4:55ab98f52d77 | 23 | void Tevent(void); |
schnf30 | 4:55ab98f52d77 | 24 | }; |
schnf30 | 4:55ab98f52d77 | 25 | #endif |