Y SI / lib_Transmission

Dependents:   lib_Transmission_Serial_example 2022_TICE_Electrolyse lib_Transmission_TCP_example

Embed: (wiki syntax)

« Back to documentation index

Transmission Class Reference

Transmission Class Reference

Transmission class. More...

#include <lib_Transmission.h>

Public Types

enum  enum_trans_delivery
 

enumerator of the different possible delivery of the transmission library

More...
enum  enum_trans_status
 

enumerator of the different ethernet connexion status of the transmission library

More...

Public Member Functions

 Transmission (#if MBED_MAJOR_VERSION > 5 UnbufferedSerial *serial,#else Serial *serial,#endif USBCDC *usb, EthernetInterface *eth, string(*processing)(string)=NULL, void(*ethup)(void)=NULL, bool caseIgnore=true)
 make new Transmission instance
 Transmission (#if MBED_MAJOR_VERSION > 5 UnbufferedSerial *serial,#else Serial *serial,#endif USBCDC *usb, string(*processing)(string)=NULL, bool caseIgnore=true)
 make new Transmission instance
 Transmission (#if MBED_MAJOR_VERSION > 5 UnbufferedSerial *serial,#else Serial *serial,#endif EthernetInterface *eth, string(*processing)(string)=NULL, void(*ethup)(void)=NULL, bool caseIgnore=true)
 make new Transmission instance
 Transmission (USBCDC *usb, EthernetInterface *eth, string(*processing)(string)=NULL, void(*ethup)(void)=NULL, bool caseIgnore=true)
 make new Transmission instance
 Transmission (#if MBED_MAJOR_VERSION > 5 UnbufferedSerial *serial,#else Serial *serial,#endif string(*processing)(string)=NULL, bool caseIgnore=true)
 make new Transmission instance
 Transmission (EthernetInterface *eth, string(*processing)(string)=NULL, void(*ethup)(void)=NULL, bool caseIgnore=true)
 make new Transmission instance
 Transmission (USBCDC *usb, string(*processing)(string)=NULL, bool caseIgnore=true)
 make new Transmission instance
string ip (const bool set, const char *ip="", const uint16_t port=80, const char *mask="255.255.255.0", const char *gateway="192.168.1.1", const uint16_t timeout=100)
 Configure the TCP connection.
string ip (string ip="")
 Return ip config.
string client (void)
 Return client config.
enum_trans_status recv (void)
 scans the reception buffers of transmission TCP and USB
nsapi_error_t send (const string &buffer="", const enum_trans_delivery &delivery=ANY_DELIVERY)
 send the buffer to the specified transmission delivery
string get (const string &buffer, const string &server, const int &port=80)
 send a request to a server at the specified port
bool smtp (string mail, string from="", string subject="", string data="", const char *server=TRANSMISSION_SMTP_SERVER)
 send an email to an smtp server
time_t ntp (const char *server=TRANSMISSION_NTP_SERVER)
 time request to an ntp server

Detailed Description

Transmission class.

Definition at line 60 of file lib_Transmission.h.


Member Enumeration Documentation

enumerator of the different possible delivery of the transmission library

Definition at line 65 of file lib_Transmission.h.

enumerator of the different ethernet connexion status of the transmission library

Definition at line 69 of file lib_Transmission.h.


Constructor & Destructor Documentation

Transmission ( #if  MBED_MAJOR_VERSION,
5 UnbufferedSerial *  serial,
#else Serial *  serial,
#endif USBCDC *  usb,
EthernetInterface *  eth,
string(*)(string)  processing = NULL,
void(*)(void)  ethup = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 3 of file lib_Transmission.cpp.

Transmission ( #if  MBED_MAJOR_VERSION,
5 UnbufferedSerial *  serial,
#else Serial *  serial,
#endif USBCDC *  usb,
string(*)(string)  processing = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 21 of file lib_Transmission.cpp.

Transmission ( #if  MBED_MAJOR_VERSION,
5 UnbufferedSerial *  serial,
#else Serial *  serial,
#endif EthernetInterface *  eth,
string(*)(string)  processing = NULL,
void(*)(void)  ethup = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 37 of file lib_Transmission.cpp.

Transmission ( USBCDC *  usb,
EthernetInterface *  eth,
string(*)(string)  processing = NULL,
void(*)(void)  ethup = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 69 of file lib_Transmission.cpp.

Transmission ( #if  MBED_MAJOR_VERSION,
5 UnbufferedSerial *  serial,
#else Serial *  serial,
#endif string(*)(string)  processing = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 54 of file lib_Transmission.cpp.

Transmission ( EthernetInterface *  eth,
string(*)(string)  processing = NULL,
void(*)(void)  ethup = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 81 of file lib_Transmission.cpp.

Transmission ( USBCDC *  usb,
string(*)(string)  processing = NULL,
bool  caseIgnore = true 
)

make new Transmission instance

Parameters:

Definition at line 92 of file lib_Transmission.cpp.


Member Function Documentation

string client ( void   )

Return client config.

Returns:
ip:port config

Definition at line 142 of file lib_Transmission.cpp.

string get ( const string &  buffer,
const string &  server,
const int &  port = 80 
)

send a request to a server at the specified port

Parameters:
requestsent to server
serverip
serverport
Returns:
server response

Definition at line 349 of file lib_Transmission.cpp.

string ip ( string  ip = "" )

Return ip config.

Parameters:
ip=""If the specified ip is the one configured gives the complete ip configuration
Returns:
ip config

Definition at line 99 of file lib_Transmission.cpp.

string ip ( const bool  set,
const char *  ip = "",
const uint16_t  port = 80,
const char *  mask = "255.255.255.0",
const char *  gateway = "192.168.1.1",
const uint16_t  timeout = 100 
)

Configure the TCP connection.

Parameters:
setenable for the tcp connection
Returns:
MAC adress

Definition at line 116 of file lib_Transmission.cpp.

time_t ntp ( const char *  server = TRANSMISSION_NTP_SERVER )

time request to an ntp server

Parameters:
server="129.175.34.43"this is an ip from an ntp server
Returns:
time

Definition at line 405 of file lib_Transmission.cpp.

scans the reception buffers of transmission TCP and USB

Returns:
enumerator of the different ethernet connexion status of the transmission library

Definition at line 267 of file lib_Transmission.cpp.

nsapi_error_t send ( const string &  buffer = "",
const enum_trans_delivery delivery = ANY_DELIVERY 
)

send the buffer to the specified transmission delivery

Parameters:
buffersent over transmission
deliveryof the transmission
Returns:

Definition at line 324 of file lib_Transmission.cpp.

bool smtp ( string  mail,
string  from = "",
string  subject = "",
string  data = "",
const char *  server = TRANSMISSION_SMTP_SERVER 
)

send an email to an smtp server

Parameters:
mailis the recipient's email
from=""this is the sender's email
subject=""this is the subject of the email
data=""this is the content of the email
server="129.175.212.70"this is an ip from an smtp server
Returns:
indicates if the smtp transaction was successful

Definition at line 369 of file lib_Transmission.cpp.