Skip to content

Commit

Permalink
added NETWORK_GET_SCAN_RESULT
Browse files Browse the repository at this point in the history
  • Loading branch information
BrokeStudio committed Nov 10, 2023
1 parent 5c59006 commit d54d9be
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
16 changes: 12 additions & 4 deletions Core/NES/Mappers/Homebrew/RainbowESP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,19 @@ void BrokeStudioFirmware::processBufferedMessage()
if(message_size == 1) {
this->tx_messages.push_back({
2,
static_cast<uint8_t>(fromesp_cmds_t::NETWORK_COUNT),
static_cast<uint8_t>(fromesp_cmds_t::NETWORK_SCAN_RESULT),
NUM_FAKE_NETWORKS
});
}
break;
case toesp_cmds_t::NETWORK_GET_SCAN_RESULT:
UDBG("[Rainbow] ESP received command NETWORK_GET_SCAN_RESULT");
this->tx_messages.push_back({
2,
static_cast<uint8_t>(fromesp_cmds_t::NETWORK_SCAN_RESULT),
NUM_FAKE_NETWORKS
});
break;
case toesp_cmds_t::NETWORK_GET_DETAILS:
UDBG("[Rainbow] ESP received command NETWORK_GET_DETAILS");
if(message_size == 2) {
Expand Down Expand Up @@ -828,9 +836,9 @@ void BrokeStudioFirmware::processBufferedMessage()
if(message_size >= 2 && message_size <= 5) {
if(this->working_file.active) {
this->working_file.offset = this->rx_buffer.at(2);
if(message_size == 3) this->working_file.offset += static_cast<uint32_t>(message_size >= 3 ? this->rx_buffer.at(3) : 0) << 8;
if(message_size == 4) this->working_file.offset += static_cast<uint32_t>(message_size >= 4 ? this->rx_buffer.at(4) : 0) << 16;
if(message_size == 5) this->working_file.offset += static_cast<uint32_t>(message_size >= 5 ? this->rx_buffer.at(5) : 0) << 24;
if(message_size == 3) this->working_file.offset += this->rx_buffer.at(3) << 8;
if(message_size == 4) this->working_file.offset += this->rx_buffer.at(4) << 16;
if(message_size == 5) this->working_file.offset += this->rx_buffer.at(5) << 24;
}
}
break;
Expand Down
3 changes: 2 additions & 1 deletion Core/NES/Mappers/Homebrew/RainbowESP.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ class BrokeStudioFirmware

// NETWORK CMDS
NETWORK_SCAN,
NETWORK_GET_SCAN_RESULT,
NETWORK_GET_DETAILS,
NETWORK_GET_REGISTERED,
NETWORK_GET_REGISTERED_DETAILS,
Expand Down Expand Up @@ -189,7 +190,7 @@ class BrokeStudioFirmware
MESSAGE_FROM_SERVER,

// NETWORK CMDS
NETWORK_COUNT,
NETWORK_SCAN_RESULT,
NETWORK_SCANNED_DETAILS,
NETWORK_REGISTERED_DETAILS,
NETWORK_REGISTERED,
Expand Down

0 comments on commit d54d9be

Please sign in to comment.