Skip to content

Commit

Permalink
update WASM integration Connection interface
Browse files Browse the repository at this point in the history
  • Loading branch information
matth-x committed Nov 5, 2023
1 parent b6872bf commit b83bc49
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/net_wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ class WasmOcppConnection : public Connection {

public:
WasmOcppConnection(
const char *backend_url_default,
const char *charge_box_id_default,
const char *auth_key_default) {
const char *backend_url_factory,
const char *charge_box_id_factory,
const char *auth_key_factory) {

setting_backend_url_str = declareConfiguration<const char*>(
MO_CONFIG_EXT_PREFIX "BackendUrl", backend_url_factory, CONFIGURATION_VOLATILE, true, true);
Expand Down Expand Up @@ -207,12 +207,12 @@ class WasmOcppConnection : public Connection {
maintainWsConn();
}

bool sendTXT(std::string &out) override {
bool sendTXT(const char *msg, size_t length) override {
if (!websocket || !isConnectionOpen()) {
return false;
}

if (auto ret = emscripten_websocket_send_utf8_text(websocket, out.c_str()) < 0) {
if (auto ret = emscripten_websocket_send_utf8_text(websocket, msg) < 0) {
MO_DBG_ERR("emscripten_websocket_send_utf8_text: %i", ret);
return false;
}
Expand Down

0 comments on commit b83bc49

Please sign in to comment.