2026-04-06 17:24:34 +09:00
|
|
|
#include "handlers.h"
|
|
|
|
|
#include "pico/unique_id.h"
|
2026-04-07 07:34:24 +09:00
|
|
|
#include "net.h"
|
2026-04-06 17:24:34 +09:00
|
|
|
|
2026-04-07 06:58:39 +09:00
|
|
|
std::vector<std::vector<uint8_t>> handle_picoboot(uint32_t message_id, std::span<const uint8_t>) {
|
2026-04-06 20:22:40 +09:00
|
|
|
return {encode_response(message_id, ResponsePICOBOOT{})};
|
2026-04-06 17:24:34 +09:00
|
|
|
}
|
|
|
|
|
|
2026-04-07 06:58:39 +09:00
|
|
|
std::vector<std::vector<uint8_t>> handle_info(uint32_t message_id, std::span<const uint8_t>) {
|
2026-04-06 17:24:34 +09:00
|
|
|
ResponseInfo resp;
|
|
|
|
|
pico_unique_board_id_t uid;
|
|
|
|
|
pico_get_unique_board_id(&uid);
|
|
|
|
|
std::copy(uid.id, uid.id + 8, resp.board_id.begin());
|
2026-04-07 07:34:24 +09:00
|
|
|
auto& ns = net_get_state();
|
|
|
|
|
resp.mac = ns.mac;
|
|
|
|
|
resp.ip = ns.ip;
|
2026-04-06 20:09:30 +09:00
|
|
|
resp.firmware_name = firmware_name;
|
2026-04-06 20:22:40 +09:00
|
|
|
return {encode_response(message_id, resp)};
|
2026-04-06 17:24:34 +09:00
|
|
|
}
|