Add extracted tools: CitrineOS, OpenOCPP, ShapeShifter

- CitrineOS core extracted (CSMS OCPP 2.0.1)
- OpenOCPP extracted (firmware OCPP 1.6J/2.0.1)
- ShapeShifter library installed (pip install -e)
- ShapeShifter specification extracted
- EVerest extracted

TODO updated with progress
This commit is contained in:
Eric F
2026-06-08 00:38:27 -04:00
parent 468cfeaa50
commit d398a6ced2
7326 changed files with 1177561 additions and 7 deletions

View File

@@ -0,0 +1,18 @@
add_library(slac_io)
add_library(slac::io ALIAS slac_io)
ev_register_library_target(slac_io)
target_include_directories(slac_io
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
target_sources(slac_io
PRIVATE
src/io.cpp
)
target_link_libraries(slac_io
PUBLIC
slac::slac
)

View File

@@ -0,0 +1,36 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 - 2022 Pionix GmbH and Contributors to EVerest
#ifndef SLAC_IO_HPP
#define SLAC_IO_HPP
#include <condition_variable>
#include <functional>
#include <mutex>
#include <string>
#include <thread>
#include <slac/channel.hpp>
class SlacIO {
public:
using InputHandlerFnType = void(slac::messages::HomeplugMessage&);
void init(const std::string& if_name);
void run(std::function<InputHandlerFnType> callback);
void send(slac::messages::HomeplugMessage& msg);
void quit();
// cannot be const while libslac's SlacChannel::get_mac_addr() isn't const
const uint8_t* get_mac_addr() /* const */;
private:
void loop();
slac::Channel slac_channel;
slac::messages::HomeplugMessage incoming_msg;
std::function<InputHandlerFnType> input_handler;
std::thread loop_thread;
bool running{false};
};
#endif // SLAC_IO_HPP

View File

@@ -0,0 +1,48 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2022 - 2022 Pionix GmbH and Contributors to EVerest
#include <everest/slac/io.hpp>
#include <stdexcept>
#include <thread>
void SlacIO::init(const std::string& if_name) {
if (!slac_channel.open(if_name)) {
throw std::runtime_error(slac_channel.get_error());
}
}
void SlacIO::run(std::function<InputHandlerFnType> callback) {
input_handler = callback;
running = true;
loop_thread = std::thread(&SlacIO::loop, this);
}
void SlacIO::quit() {
if (!running) {
return;
}
running = false;
loop_thread.join();
}
void SlacIO::loop() {
while (running) {
if (slac_channel.read(incoming_msg, 10)) {
input_handler(incoming_msg);
}
}
}
void SlacIO::send(slac::messages::HomeplugMessage& msg) {
// FIXME (aw): handle errors
slac_channel.write(msg, 1);
}
const uint8_t* SlacIO::get_mac_addr() /* const */ {
return slac_channel.get_mac_addr();
}