Skip to content

Commit 3bfb48e

Browse files
committed
misc. fix
1 parent aa574e4 commit 3bfb48e

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

SerialPrograms/Source/Controllers/SerialPABotBase/Messages/SerialPABotBase_MessageWrappers_BaseProtocol_Misc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class MessageType_ReadMacAddress : public BotBaseMessageType{
110110
Params params;
111111
memcpy(&params, body.data(), sizeof(params));
112112
ret += ": seqnum = " + std::to_string(params.seqnum);
113+
ret += ", mode = " + std::to_string(params.mode);
113114
return ret;
114115
}
115116
};
@@ -119,6 +120,7 @@ class DeviceRequest_read_mac_address : public BotBaseRequest{
119120
DeviceRequest_read_mac_address(uint32_t mode)
120121
: BotBaseRequest(false)
121122
{
123+
params.seqnum = 0;
122124
params.mode = mode;
123125
}
124126
virtual BotBaseMessage message() const override{

SerialPrograms/Source/NintendoSwitch/Controllers/SerialPABotBase/NintendoSwitch_SerialPABotBase_OemController.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ void SerialPABotBase_OemController::set_info(){
128128
response.body.data() + sizeof(seqnum_t),
129129
sizeof(controller_mac_address)
130130
);
131+
132+
std::string str = "Controller MAC Address: ";
133+
134+
static const char HEX_DIGITS[] = "0123456789abcdef";
135+
for (size_t c = 0; c < 6; c++){
136+
uint8_t byte = controller_mac_address[c];
137+
str += " ";
138+
str += HEX_DIGITS[(byte >> 4)];
139+
str += HEX_DIGITS[byte & 15];
140+
}
141+
142+
m_logger.log(str);
143+
131144
}else{
132145
m_logger.log(
133146
"Invalid response size to PABB_MSG_ESP32_REQUEST_READ_SPI: body = " + std::to_string(response.body.size()),

SerialPrograms/Source/NintendoSwitch/Framework/UI/NintendoSwitch_CommandRow.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ void CommandRow::set_focus(bool focused){
213213

214214
AbstractController* controller = m_controller.controller();
215215
if (controller != nullptr && allow_controller_input()){
216-
controller->cancel_all_commands();
216+
try{
217+
controller->cancel_all_commands();
218+
}catch (InvalidConnectionStateException&){
219+
}catch (OperationCancelledException&){
220+
}
217221
}
218222
}
219223
if (m_last_known_focus == focused){

0 commit comments

Comments
 (0)