Skip to content

Commit c2c4a87

Browse files
hhvrcclaude
andcommitted
wip: merge develop and fix span migration for Arduino 3.0
Merge develop into feat/arduino-3.0. Replace remaining tcb::span with std::span, add missing WiFi.h include. Build not yet clean — remaining issues: Serial namespace rename (SerialCmds), USBSerial API, and CaptivePortalConfig struct changes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent babac53 commit c2c4a87

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

include/captiveportal/CaptivePortalInstance.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#include "Common.h"
4-
#include "span.h"
4+
#include <span>
55
#include "WebSocketDeFragger.h"
66

77
#include <DNSServer.h>
@@ -25,16 +25,16 @@ namespace OpenShock::CaptivePortal {
2525
~CaptivePortalInstance();
2626

2727
bool sendMessageTXT(uint8_t socketId, std::string_view data) { return m_socketServer.sendTXT(socketId, data.data(), data.length()); }
28-
bool sendMessageBIN(uint8_t socketId, tcb::span<const uint8_t> data) { return m_socketServer.sendBIN(socketId, data.data(), data.size()); }
28+
bool sendMessageBIN(uint8_t socketId, std::span<const uint8_t> data) { return m_socketServer.sendBIN(socketId, data.data(), data.size()); }
2929
bool broadcastMessageTXT(std::string_view data) { return m_socketServer.broadcastTXT(data.data(), data.length()); }
30-
bool broadcastMessageBIN(tcb::span<const uint8_t> data) { return m_socketServer.broadcastBIN(data.data(), data.size()); }
30+
bool broadcastMessageBIN(std::span<const uint8_t> data) { return m_socketServer.broadcastBIN(data.data(), data.size()); }
3131
bool hasClients() { return m_socketServer.connectedClients() > 0; }
3232

3333
private:
3434
void task();
3535
void handleWebSocketClientConnected(uint8_t socketId);
3636
void handleWebSocketClientDisconnected(uint8_t socketId);
37-
void handleWebSocketEvent(uint8_t socketId, WebSocketMessageType type, tcb::span<const uint8_t> payload);
37+
void handleWebSocketEvent(uint8_t socketId, WebSocketMessageType type, std::span<const uint8_t> payload);
3838

3939
AsyncWebServer m_webServer;
4040
WebSocketsServer m_socketServer;

src/captiveportal/Manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ bool CaptivePortal::SendMessageTXT(uint8_t socketId, std::string_view data)
267267

268268
return true;
269269
}
270-
bool CaptivePortal::SendMessageBIN(uint8_t socketId, tcb::span<const uint8_t> data)
270+
bool CaptivePortal::SendMessageBIN(uint8_t socketId, std::span<const uint8_t> data)
271271
{
272272
auto instance = GetInstance();
273273
if (instance == nullptr) return false;
@@ -286,7 +286,7 @@ bool CaptivePortal::BroadcastMessageTXT(std::string_view data)
286286

287287
return true;
288288
}
289-
bool CaptivePortal::BroadcastMessageBIN(tcb::span<const uint8_t> data)
289+
bool CaptivePortal::BroadcastMessageBIN(std::span<const uint8_t> data)
290290
{
291291
auto instance = GetInstance();
292292
if (instance == nullptr) return false;

src/http/HTTPRequestManager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const char* const TAG = "HTTPRequestManager";
1111
#include "util/StringUtils.h"
1212

1313
#include <HTTPClient.h>
14+
#include <WiFi.h>
1415

1516
#include <algorithm>
1617
#include <memory>
@@ -350,7 +351,7 @@ static StreamReaderResult readHttpStreamData(HTTPClient& client, WiFiClient* str
350351
}
351352

352353
HTTP::Response<std::size_t>
353-
HTTP::Download(std::string_view url, const std::map<String, String>& headers, HTTP::GotContentLengthCallback contentLengthCallback, HTTP::DownloadCallback downloadCallback, tcb::span<const uint16_t> acceptedCodes, uint32_t timeoutMs)
354+
HTTP::Download(std::string_view url, const std::map<String, String>& headers, HTTP::GotContentLengthCallback contentLengthCallback, HTTP::DownloadCallback downloadCallback, std::span<const uint16_t> acceptedCodes, uint32_t timeoutMs)
354355
{
355356
std::shared_ptr<OpenShock::RateLimiter> rateLimiter = createRateLimiterForURL(url);
356357
if (rateLimiter == nullptr) {
@@ -450,7 +451,7 @@ HTTP::Response<std::size_t>
450451
return {result.result, responseCode, result.nWritten};
451452
}
452453

453-
HTTP::Response<std::string> HTTP::GetString(std::string_view url, const std::map<String, String>& headers, tcb::span<const uint16_t> acceptedCodes, uint32_t timeoutMs)
454+
HTTP::Response<std::string> HTTP::GetString(std::string_view url, const std::map<String, String>& headers, std::span<const uint16_t> acceptedCodes, uint32_t timeoutMs)
454455
{
455456
std::string result;
456457

src/message_handlers/websocket/Gateway.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static std::array<Handlers::HandlerType, HANDLER_COUNT> s_serverHandlers = []()
3737
return handlers;
3838
}();
3939

40-
void MessageHandlers::WebSocket::HandleGatewayBinary(tcb::span<const uint8_t> data)
40+
void MessageHandlers::WebSocket::HandleGatewayBinary(std::span<const uint8_t> data)
4141
{
4242
if (data.size() < sizeof(flatbuffers::uoffset_t)) {
4343
OS_LOGE(TAG, "Message too small to be a valid FlatBuffer");

0 commit comments

Comments
 (0)