Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: lib_Transmission_Serial_example 2022_TICE_Electrolyse lib_Transmission_TCP_example
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
| enum enum_trans_delivery |
enumerator of the different possible delivery of the transmission library
Definition at line 65 of file lib_Transmission.h.
| enum enum_trans_status |
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 |
||
| ) |
| Transmission | ( | #if | MBED_MAJOR_VERSION, |
| 5 UnbufferedSerial * | serial, | ||
| #else Serial * | serial, | ||
| #endif USBCDC * | usb, | ||
| string(*)(string) | processing = NULL, |
||
| bool | caseIgnore = true |
||
| ) |
| 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 |
||
| ) |
| Transmission | ( | USBCDC * | usb, |
| EthernetInterface * | eth, | ||
| string(*)(string) | processing = NULL, |
||
| void(*)(void) | ethup = NULL, |
||
| bool | caseIgnore = true |
||
| ) |
| Transmission | ( | #if | MBED_MAJOR_VERSION, |
| 5 UnbufferedSerial * | serial, | ||
| #else Serial * | serial, | ||
| #endif string(*)(string) | processing = NULL, |
||
| bool | caseIgnore = true |
||
| ) |
| Transmission | ( | EthernetInterface * | eth, |
| string(*)(string) | processing = NULL, |
||
| void(*)(void) | ethup = NULL, |
||
| bool | caseIgnore = true |
||
| ) |
| Transmission | ( | USBCDC * | usb, |
| string(*)(string) | processing = NULL, |
||
| bool | caseIgnore = true |
||
| ) |
Member Function Documentation
| string client | ( | void | ) |
| string get | ( | const string & | buffer, |
| const string & | server, | ||
| const int & | port = 80 |
||
| ) |
send a request to a server at the specified port
- Parameters:
-
request sent to server server ip server port
- 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:
-
set enable 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.
| Transmission::enum_trans_status recv | ( | void | ) |
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:
-
buffer sent over transmission delivery of 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:
-
mail is 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.
Generated on Wed Jul 13 2022 20:40:22 by
1.7.2