Use this class to exchange data via wifi.
More...
#include <Wifi.h>
Use this class to exchange data via wifi.
- Examples
- project_angle.cpp, project_car.cpp, and project_pendulum.cpp.
Definition at line 18 of file Wifi.h.
◆ Wifi()
Wifi::Wifi |
( |
std::function< void(long)> |
func | ) |
|
Create a Wifi handler.
This detach a thread so it can read and write synchronously without blocking other tasks.
- Parameters
-
func | function to call when receiving data |
Definition at line 12 of file Wifi.cpp.
◆ ~Wifi()
Close the socket if we are still connected.
Definition at line 132 of file Wifi.cpp.
◆ isConnected()
bool Wifi::isConnected |
( |
| ) |
|
Returns the state of the socket.
- Returns
- true if wifi is connected
Definition at line 101 of file Wifi.cpp.
◆ openServer()
void Wifi::openServer |
( |
| ) |
|
◆ updateAngle()
void Wifi::updateAngle |
( |
short |
angle | ) |
|
Send data to the client.
- Parameters
-
Definition at line 92 of file Wifi.cpp.
◆ writeChar()
void Wifi::writeChar |
( |
char |
c | ) |
|
|
private |
Write a char to the socket.
- Parameters
-
Definition at line 109 of file Wifi.cpp.
◆ writeLong()
void Wifi::writeLong |
( |
long |
l | ) |
|
|
private |
Write a long to the socket.
- Parameters
-
Definition at line 125 of file Wifi.cpp.
◆ writeShort()
void Wifi::writeShort |
( |
short |
s | ) |
|
|
private |
Write a short to the socket.
- Parameters
-
Definition at line 117 of file Wifi.cpp.
◆ _func
std::function<void(long)> myRIO::Wifi::_func |
|
private |
Function to call when receiving data.
Definition at line 31 of file Wifi.h.
◆ _socket
◆ _socketThread
std::thread myRIO::Wifi::_socketThread |
|
private |
◆ connected
bool myRIO::Wifi::connected |
|
private |
The documentation for this class was generated from the following files:
- C:/Users/jackb/OneDrive - etu.univ-lyon1.fr/TERi/Eclipse/workspace/APIForRIO/src/Wifi.h
- C:/Users/jackb/OneDrive - etu.univ-lyon1.fr/TERi/Eclipse/workspace/APIForRIO/src/Wifi.cpp