mirror of https://github.com/arendst/Tasmota.git
Merge pull request #17094 from s-hadinger/berry_udp_stop
Berry add ``udp->stop()`` method
This commit is contained in:
commit
1162c36fb2
|
@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
|
||||||
- WS2812 and Light Art-Net DMX control over UDP port 6454 (#17059)
|
- WS2812 and Light Art-Net DMX control over UDP port 6454 (#17059)
|
||||||
- Command ``SwitchMode 16`` sending only MQTT message on inverted switch change (#17028)
|
- Command ``SwitchMode 16`` sending only MQTT message on inverted switch change (#17028)
|
||||||
- Support for HMC5883L 3-Axis Digital Compass sensor by Andreas Achtzehn (#17069)
|
- Support for HMC5883L 3-Axis Digital Compass sensor by Andreas Achtzehn (#17069)
|
||||||
|
- Berry add ``udp->stop()`` method
|
||||||
|
|
||||||
### Breaking Changed
|
### Breaking Changed
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ extern "C" {
|
||||||
return be_call_c_func(vm, (void*) &be_udp_deinit_ntv, "=.p", "");
|
return be_call_c_func(vm, (void*) &be_udp_deinit_ntv, "=.p", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
// udp.begin(address:string, port:int) -> nil
|
// udp.begin(address:string, port:int) -> bool
|
||||||
int32_t be_udp_begin_ntv(WiFiUDP *udp, const char *host, int32_t port) {
|
int32_t be_udp_begin_ntv(WiFiUDP *udp, const char *host, int32_t port) {
|
||||||
IPAddress addr((uint32_t)0);
|
IPAddress addr((uint32_t)0);
|
||||||
// if no host or host is "" then we defult to INADDR_ANY (0.0.0.0)
|
// if no host or host is "" then we defult to INADDR_ANY (0.0.0.0)
|
||||||
|
@ -50,6 +50,14 @@ extern "C" {
|
||||||
return be_call_c_func(vm, (void*) &be_udp_begin_ntv, "b", ".si");
|
return be_call_c_func(vm, (void*) &be_udp_begin_ntv, "b", ".si");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// udp.stop() -> nil
|
||||||
|
void be_udp_stop_ntv(WiFiUDP *udp) {
|
||||||
|
udp->stop();
|
||||||
|
}
|
||||||
|
int32_t be_udp_stop(struct bvm *vm) {
|
||||||
|
return be_call_c_func(vm, (void*) &be_udp_stop_ntv, "b", ".");
|
||||||
|
}
|
||||||
|
|
||||||
// udp.begin_multicast(address:string, port:int) -> nil
|
// udp.begin_multicast(address:string, port:int) -> nil
|
||||||
int32_t be_udp_begin_mcast_ntv(WiFiUDP *udp, const char *host, int32_t port) {
|
int32_t be_udp_begin_mcast_ntv(WiFiUDP *udp, const char *host, int32_t port) {
|
||||||
IPAddress addr((uint32_t)0);
|
IPAddress addr((uint32_t)0);
|
||||||
|
@ -159,6 +167,7 @@ class be_class_udp (scope: global, name: udp) {
|
||||||
begin, func(be_udp_begin)
|
begin, func(be_udp_begin)
|
||||||
begin_multicast, func(be_udp_begin_mcast)
|
begin_multicast, func(be_udp_begin_mcast)
|
||||||
read, func(be_udp_read)
|
read, func(be_udp_read)
|
||||||
|
stop, func(be_udp_stop)
|
||||||
}
|
}
|
||||||
@const_object_info_end */
|
@const_object_info_end */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue