many updates..

new sensors.. display.. led.. drawing.. stuff..
This commit is contained in:
kazu
2019-01-17 23:12:01 +01:00
parent 90e9fee101
commit 5cb02880b3
30 changed files with 5305 additions and 97 deletions

View File

@@ -13,17 +13,17 @@
ip_addr_t addr;
/** empty ctor */
explicit IP() {
explicit IP4() {
addr.addr = 0;
}
/** ctor with IP-string */
explicit IP(const char* ipStr) {
explicit IP4(const char* ipStr) {
set(ipStr);
}
/** ctor with ip_addr_t */
explicit IP(ip_addr addr) : addr(addr) {
explicit IP4(ip_addr addr) : addr(addr) {
;
}

View File

@@ -46,7 +46,7 @@ public:
}
bool send(const IP ip, const Port port, const void* data, const uint16_t dataLen) {
bool send(const IP4 ip, const Port port, const void* data, const uint16_t dataLen) {
debugMod1(NAME, "sending packet to remote port %d", port);
@@ -65,9 +65,21 @@ public:
/** set the callback to call whenever a packet is received */
void setRecvCallback(UDPCallback callback) {
debugMod(NAME, "setRecvCallback()");
espconn_regist_recvcb(con, callback);
}
/** get the IP address of the most recent packet's sender */
IP4 getSenderIP() {
remot_info* rem;
espconn_get_connection_info(con, &rem, 0);
ip_addr_t* _ip = (ip_addr_t*) rem->remote_ip;
return IP4(*_ip);
//const uint16_t port = rem->remote_port;
}
private:
/** initialize the UDP "connection" */