Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion main/CommandHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1676,6 +1676,22 @@ int brSetECTrustAnchor(const uint8_t command[], uint8_t response[])
return 6;
}

int brErrorCode(const uint8_t command[], uint8_t response[])
{
//[0] CMD_START < 0xE0 >
//[1] Command < 1 byte >
//[2] N args < 1 byte >

int result = bearsslClient.errorCode();
int len = sizeof(result);

response[2] = 1; // number of parameters
response[3] = len; // parameter 1 length
memcpy(&response[4], &result, sizeof(result));

return len + 5;
}

//
// Low-level BSD-like sockets functions
//
Expand Down Expand Up @@ -2152,7 +2168,7 @@ const CommandHandlerType commandHandlers[] = {
setPinMode, setDigitalWrite, setAnalogWrite, getDigitalRead, getAnalogRead, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

// 0x60 -> 0x6f
writeFile, readFile, deleteFile, existsFile, downloadFile, applyOTA, renameFile, downloadOTA, brSetECTrustAnchor, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
writeFile, readFile, deleteFile, existsFile, downloadFile, applyOTA, renameFile, downloadOTA, brSetECTrustAnchor, brErrorCode, NULL, NULL, NULL, NULL, NULL, NULL,

// Low-level BSD-like sockets functions.
// 0x70 -> 0x7f
Expand Down