diff --git a/ESPFirewall/lib/Firewall/src/API.cpp b/ESPFirewall/lib/Firewall/src/API.cpp index 9209823..f049967 100644 --- a/ESPFirewall/lib/Firewall/src/API.cpp +++ b/ESPFirewall/lib/Firewall/src/API.cpp @@ -205,7 +205,7 @@ namespace fw return json_string; } - String API::json_new_attribute(String key, uint8_t value, bool last) + String API::json_new_attribute(String key, uint32_t value, bool last) { return json_new_attribute(key, String(value), last); } @@ -232,8 +232,8 @@ namespace fw serialized_string += json_new_attribute("key", rule_ptr->key); serialized_string += json_new_attribute("source", rule_ptr->source); serialized_string += json_new_attribute("destination", rule_ptr->destination); - serialized_string += json_new_attribute("port_from", rule_ptr->destination); - serialized_string += json_new_attribute("port_to", rule_ptr->destination); + serialized_string += json_new_attribute("port_from", rule_ptr->port_from); + serialized_string += json_new_attribute("port_to", rule_ptr->port_to); serialized_string += json_new_attribute("protocol", protocol_to_string(rule_ptr->protocol)); serialized_string += json_new_attribute("target", target_to_string(rule_ptr->target), true); serialized_string += "}"; diff --git a/ESPFirewall/lib/Firewall/src/API.hpp b/ESPFirewall/lib/Firewall/src/API.hpp index e60404e..f7377ff 100644 --- a/ESPFirewall/lib/Firewall/src/API.hpp +++ b/ESPFirewall/lib/Firewall/src/API.hpp @@ -40,7 +40,7 @@ namespace fw bool request_has_firewall_parameter(); String json_new_attribute(String key, String value, bool last = false); - String json_new_attribute(String key, uint8_t value, bool last = false); + String json_new_attribute(String key, uint32_t value, bool last = false); void json_generic_response(String serialized_string, const uint16_t response_code); void json_message_response(String message, const uint16_t response_code); String construct_json_firewall_rule(firewall_rule_t *);