Skip to content

Commit

Permalink
fixed last merge
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhu- committed Feb 8, 2025
1 parent f8190e9 commit ee56366
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 126 deletions.
13 changes: 0 additions & 13 deletions include/schedule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,11 @@ class Schedule {
void nextCommand();
void processData(const uint8_t byte);

<<<<<<< HEAD
// const WiFiClient *getClient();

// void setExternalBusRequest(const bool external);
// const bool getExternalBusRequest() const;
// void pokeExternalBusRequest(const bool won);

=======
>>>>>>> master
void resetCounters();
void publishCounters();

private:
ebus::EbusHandler ebusHandler;
<<<<<<< HEAD
// WiFiClient *dummyClient = new WiFiClient();
=======
>>>>>>> master

Command *scheduleCommand = nullptr;

Expand Down
64 changes: 0 additions & 64 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,13 @@ char netmaskValue[STRING_LEN];

char pwm_value[NUMBER_LEN];

<<<<<<< HEAD
#ifdef EBUS_INTERNAL
=======
>>>>>>> master
char ebus_address[NUMBER_LEN];
static char ebus_address_values[][NUMBER_LEN] = {
"00", "10", "30", "70", "F0", "01", "11", "31", "71",
"F1", "03", "13", "33", "73", "F3", "07", "17", "37",
"77", "F7", "0F", "1F", "3F", "7F", "FF"};

char comand_distance[NUMBER_LEN];
<<<<<<< HEAD
// char external_bus_request[STRING_LEN];
#endif
=======
>>>>>>> master

char mqtt_server[STRING_LEN];
char mqtt_user[STRING_LEN];
Expand Down Expand Up @@ -112,13 +103,6 @@ iotwebconf::SelectParameter ebusAddressParam = iotwebconf::SelectParameter(
iotwebconf::NumberParameter commandDistanceParam = iotwebconf::NumberParameter(
"Command distance", "comand_distance", comand_distance, NUMBER_LEN, "1",
"0..60", "min='0' max='60' step='1'");
<<<<<<< HEAD
// iotwebconf::CheckboxParameter externalBusRequestParam =
// iotwebconf::CheckboxParameter("External bus request",
// "external_bus_request",
// external_bus_request, STRING_LEN);
=======
>>>>>>> master
#endif

iotwebconf::ParameterGroup mqttGroup =
Expand Down Expand Up @@ -161,10 +145,6 @@ Track<uint32_t> pwm("ebus/device/ebus/pwm", 0);
#ifdef EBUS_INTERNAL
Track<String> ebusAddress("ebus/device/ebus/ebus_address", 0);
Track<String> commandDistance("ebus/device/ebus/comand_distance", 0);
<<<<<<< HEAD
// Track<String> externalBusRequest("ebus/device/ebus/external_bus_request", 0);
=======
>>>>>>> master
#endif

// ebus/device/wifi
Expand Down Expand Up @@ -316,28 +296,9 @@ void data_process() {
BusType::data d;
if (Bus.read(d)) {
#ifdef EBUS_INTERNAL
<<<<<<< HEAD
// static int statusBusRequest = INFO;

// // push data to schedule
// if (schedule.getExternalBusRequest()) {
// // d._enhanced is perhaps the wrong term - arbitrating seems to fit better
// if (d._enhanced && d._client == schedule.getClient())
// statusBusRequest = d._c;
// }

if (!d._enhanced) {
schedule.processData(d._d);
last_comms = millis();
// if (statusBusRequest != INFO) {
// schedule.stateExternalBusRequest(statusBusRequest == STARTED);
// statusBusRequest = INFO;
// }
=======
if (!d._enhanced) {
schedule.processData(d._d);
last_comms = millis();
>>>>>>> master
}
#endif

Expand Down Expand Up @@ -412,12 +373,6 @@ void saveParamsCallback() {

schedule.setDistance(atoi(comand_distance));
commandDistance = comand_distance;
<<<<<<< HEAD

// schedule.setExternalBusRequest(externalBusRequestParam.isChecked());
// externalBusRequest = schedule.getExternalBusRequest() ? "true" : "false";
=======
>>>>>>> master
#endif

if (mqtt_server[0] != '\0') mqttClient.setServer(mqtt_server, 1883);
Expand Down Expand Up @@ -487,11 +442,6 @@ char* status_string() {
ebus_address);
pos += snprintf(status + pos, sizeof(status), "command_distance: %i\r\n",
atoi(comand_distance));
<<<<<<< HEAD
// pos += snprintf(status + pos, sizeof(status), "external_bus_request: %s\r\n",
// schedule.getExternalBusRequest() ? "true" : "false");
=======
>>>>>>> master
#endif

pos += snprintf(status + pos, sizeof(status), "mqtt_connected: %s\r\n",
Expand Down Expand Up @@ -572,13 +522,7 @@ void handleRoot() {
"user-scalable=no\"/>";
s += "</head><body>";
s += "<a href='/status'>Adapter status</a><br>";
<<<<<<< HEAD
#ifdef EBUS_INTERNAL
s += "<a href='/commands'>Commands</a><br>";
#endif
=======
s += "<a href='/commands'>Commands</a><br>";
>>>>>>> master
s += "<a href='/config'>Configuration</a> - user: admin password: your "
"configured AP mode password or default: ";
s += DEFAULT_APMODE_PASS;
Expand Down Expand Up @@ -658,10 +602,6 @@ void setup() {
#ifdef EBUS_INTERNAL
ebusGroup.addItem(&ebusAddressParam);
ebusGroup.addItem(&commandDistanceParam);
<<<<<<< HEAD
// ebusGroup.addItem(&externalBusRequestParam);
=======
>>>>>>> master
#endif

mqttGroup.addItem(&mqttServerParam);
Expand Down Expand Up @@ -709,10 +649,6 @@ void setup() {
#ifdef EBUS_INTERNAL
schedule.setAddress(uint8_t(std::strtoul(ebus_address, nullptr, 16)));
schedule.setDistance(atoi(comand_distance));
<<<<<<< HEAD
// schedule.setExternalBusRequest(externalBusRequestParam.isChecked());
=======
>>>>>>> master
#endif

while (iotWebConf.getState() != iotwebconf::NetworkState::OnLine) {
Expand Down
49 changes: 0 additions & 49 deletions src/schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ Schedule::Schedule()
: ebusHandler(0xff, &busReadyCallback, &busWriteCallback, &activeCallback,
&passiveCallback, &reactiveCallback) {
ebusHandler.setErrorCallback(errorCallback);
<<<<<<< HEAD
ebusHandler.setMaxLockCounter(3);
ebusHandler.setExternalBusRequest(false);
=======
>>>>>>> master
}

void Schedule::setAddress(const uint8_t source) {
Expand Down Expand Up @@ -139,17 +134,7 @@ void Schedule::nextCommand() {
}

if (command.size() > 0) {
<<<<<<< HEAD
if (ebusHandler.enque(command)) {
// if (ebusHandler.getExternalBusRequest()) {
// WiFiClient *client = dummyClient;
// uint8_t address = ebusHandler.getAddress();
// setArbitrationClient(client, address);
// }
}
=======
ebusHandler.enque(command);
>>>>>>> master
}
}
}
Expand All @@ -158,23 +143,6 @@ void Schedule::nextCommand() {

void Schedule::processData(const uint8_t byte) { ebusHandler.run(byte); }

<<<<<<< HEAD
// const WiFiClient *Schedule::getClient() { return dummyClient; }

// void Schedule::setExternalBusRequest(const bool external) {
// ebusHandler.setExternalBusRequest(external);
// }

// const bool Schedule::getExternalBusRequest() const {
// ebusHandler.getExternalBusRequest();
// }

// void Schedule::pokeExternalBusRequest(const bool won) {
// ebusHandler.pokeExternalBusRequest(won);
// }

=======
>>>>>>> master
void Schedule::resetCounters() { ebusHandler.resetCounters(); }

void Schedule::publishCounters() {
Expand Down Expand Up @@ -323,22 +291,6 @@ void Schedule::publishSend(const std::vector<uint8_t> &master,
std::string topic = "ebus/";
std::string payload;
if (master[2] == 0x07 && master[3] == 0x04) {
<<<<<<< HEAD
topic += "nodes/" + ebus::Sequence::to_string(master);
std::string t;
t += "Address: 0x" +
ebus::Sequence::to_string(ebus::Sequence::range(master, 1, 1));
t += " Manufacturer: 0x" +
ebus::Sequence::to_string(ebus::Sequence::range(slave, 1, 1));
t += " Type: " + ebus::byte_2_string(ebus::Sequence::range(slave, 2, 5));
t +=
" SW: " + ebus::Sequence::to_string(ebus::Sequence::range(slave, 7, 1));
t += "." + ebus::Sequence::to_string(ebus::Sequence::range(slave, 8, 1));
t +=
" HW: " + ebus::Sequence::to_string(ebus::Sequence::range(slave, 9, 1));
t += "." + ebus::Sequence::to_string(ebus::Sequence::range(slave, 10, 1));
payload = t;
=======
topic += "nodes/" + ebus::Sequence::to_string(master[1]);
payload += "MF=";
payload += ebus::Sequence::to_string(ebus::Sequence::range(slave, 1, 1));
Expand All @@ -348,7 +300,6 @@ void Schedule::publishSend(const std::vector<uint8_t> &master,
payload += ebus::Sequence::to_string(ebus::Sequence::range(slave, 7, 2));
payload += ";HW=";
payload += ebus::Sequence::to_string(ebus::Sequence::range(slave, 9, 2));
>>>>>>> master
} else {
topic += "sent/" + ebus::Sequence::to_string(master);
payload = ebus::Sequence::to_string(slave);
Expand Down

0 comments on commit ee56366

Please sign in to comment.