mirror of https://github.com/arendst/Tasmota.git
Merge pull request #6055 from ascillato/patch-1
Update esp-knx-ip library to latest
This commit is contained in:
commit
a62e355294
|
@ -40,13 +40,14 @@ typedef enum __dpt_3_007
|
|||
|
||||
typedef enum __weekday
|
||||
{
|
||||
DPT_10_001_WEEKDAY_NODAY = 0,
|
||||
DPT_10_001_WEEKDAY_MONDAY = 1,
|
||||
DPT_10_001_WEEKDAY_TUESDAY = 2,
|
||||
DPT_10_001_WEEKDAY_WEDNESDAY = 3,
|
||||
DPT_10_001_WEEKDAY_THURSDAY = 4,
|
||||
DPT_10_001_WEEKDAY_FRIDAY = 5,
|
||||
DPT_10_001_WEEKDAY_SATURDAY = 6,
|
||||
DPT_10_001_WEEKDAY_SUNDAY = 8,
|
||||
DPT_10_001_WEEKDAY_SUNDAY = 7,
|
||||
} weekday_t;
|
||||
|
||||
typedef struct __time_of_day
|
|
@ -185,3 +185,15 @@ void ESPKNXIP::send_4byte_float(address_t const &receiver, knx_command_type_t ct
|
|||
uint8_t buf[] = {0x00, ((uint8_t *)&val)[3], ((uint8_t *)&val)[2], ((uint8_t *)&val)[1], ((uint8_t *)&val)[0]};
|
||||
send(receiver, ct, 5, buf);
|
||||
}
|
||||
|
||||
void ESPKNXIP::send_14byte_string(address_t const &receiver, knx_command_type_t ct, const char *val)
|
||||
{
|
||||
uint8_t buf[14];
|
||||
int len = strlen(val);
|
||||
if (len > 14)
|
||||
{
|
||||
len = 14;
|
||||
}
|
||||
memcpy(buf, val, len);
|
||||
send(receiver, ct, 14, buf);
|
||||
}
|
|
@ -451,6 +451,7 @@ class ESPKNXIP {
|
|||
void send_4byte_int(address_t const &receiver, knx_command_type_t ct, int32_t val);
|
||||
void send_4byte_uint(address_t const &receiver, knx_command_type_t ct, uint32_t val);
|
||||
void send_4byte_float(address_t const &receiver, knx_command_type_t ct, float val);
|
||||
void send_14byte_string(address_t const &receiver, knx_command_type_t ct, const char *val);
|
||||
|
||||
void write_1bit(address_t const &receiver, uint8_t bit) { send_1bit(receiver, KNX_CT_WRITE, bit); }
|
||||
void write_2bit(address_t const &receiver, uint8_t twobit) { send_2bit(receiver, KNX_CT_WRITE, twobit); }
|
||||
|
@ -469,6 +470,7 @@ class ESPKNXIP {
|
|||
void write_4byte_int(address_t const &receiver, int32_t val) { send_4byte_int(receiver, KNX_CT_WRITE, val); }
|
||||
void write_4byte_uint(address_t const &receiver, uint32_t val) { send_4byte_uint(receiver, KNX_CT_WRITE, val); }
|
||||
void write_4byte_float(address_t const &receiver, float val) { send_4byte_float(receiver, KNX_CT_WRITE, val);}
|
||||
void write_14byte_string(address_t const &receiver, const char *val) { send_14byte_string(receiver, KNX_CT_WRITE, val); }
|
||||
|
||||
void answer_1bit(address_t const &receiver, uint8_t bit) { send_1bit(receiver, KNX_CT_ANSWER, bit); }
|
||||
void answer_2bit(address_t const &receiver, uint8_t twobit) { send_2bit(receiver, KNX_CT_ANSWER, twobit); }
|
||||
|
@ -487,6 +489,7 @@ class ESPKNXIP {
|
|||
void answer_4byte_int(address_t const &receiver, int32_t val) { send_4byte_int(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_4byte_uint(address_t const &receiver, uint32_t val) { send_4byte_uint(receiver, KNX_CT_ANSWER, val); }
|
||||
void answer_4byte_float(address_t const &receiver, float val) { send_4byte_float(receiver, KNX_CT_ANSWER, val);}
|
||||
void answer_14byte_string(address_t const &receiver, const char *val) { send_14byte_string(receiver, KNX_CT_ANSWER, val); }
|
||||
|
||||
bool data_to_bool(uint8_t *data);
|
||||
int8_t data_to_1byte_int(uint8_t *data);
|
|
@ -31,14 +31,14 @@ void setup() {
|
|||
pinMode(LED_PIN, OUTPUT);
|
||||
Serial.begin(115200);
|
||||
|
||||
callback_id_t temp_cb = knx.callback_register("Read Temperature", temp_cb);
|
||||
callback_id_t hum_cb =knx.callback_register("Read Humidity", hum_cb);
|
||||
callback_id_t pres_cb =knx.callback_register("Read Pressure", pres_cb);
|
||||
callback_id_t temp_cb_id = knx.callback_register("Read Temperature", temp_cb);
|
||||
callback_id_t hum_cb_id =knx.callback_register("Read Humidity", hum_cb);
|
||||
callback_id_t pres_cb_id =knx.callback_register("Read Pressure", pres_cb);
|
||||
|
||||
// Assign callbacks to group addresses (2/1/1, 2/1/2, 2/1/3)
|
||||
knx.callback_assign(temp_cb, knx.GA_to_address(2, 1, 1));
|
||||
knx.callback_assign(hum_cb, knx.GA_to_address(2, 1, 2));
|
||||
knx.callback_assign(pres_cb, knx.GA_to_address(2, 1, 3));
|
||||
knx.callback_assign(temp_cb_id, knx.GA_to_address(2, 1, 1));
|
||||
knx.callback_assign(hum_cb_id, knx.GA_to_address(2, 1, 2));
|
||||
knx.callback_assign(pres_cb_id, knx.GA_to_address(2, 1, 3));
|
||||
|
||||
// Set physical address (1.1.1)
|
||||
knx.physical_address_set(knx.PA_to_address(1, 1, 1));
|
|
@ -1,5 +1,5 @@
|
|||
name=ESP KNX IP Library
|
||||
version=0.5.1
|
||||
version=0.5.2
|
||||
author=Nico Weichbrodt <envy>
|
||||
maintainer=Nico Weichbrodt <envy>
|
||||
sentence=ESP8266 library for KNX/IP communication.
|
Loading…
Reference in New Issue