@@ -1676,6 +1676,22 @@ int brSetECTrustAnchor(const uint8_t command[], uint8_t response[])
16761676 return 6 ;
16771677}
16781678
1679+ int brErrorCode (const uint8_t command[], uint8_t response[])
1680+ {
1681+ // [0] CMD_START < 0xE0 >
1682+ // [1] Command < 1 byte >
1683+ // [2] N args < 1 byte >
1684+
1685+ int result = bearsslClient.errorCode ();
1686+ int len = sizeof (result);
1687+
1688+ response[2 ] = 1 ; // number of parameters
1689+ response[3 ] = len; // parameter 1 length
1690+ memcpy (&response[4 ], &result, sizeof (result));
1691+
1692+ return len + 5 ;
1693+ }
1694+
16791695//
16801696// Low-level BSD-like sockets functions
16811697//
@@ -2152,7 +2168,7 @@ const CommandHandlerType commandHandlers[] = {
21522168 setPinMode, setDigitalWrite, setAnalogWrite, getDigitalRead, getAnalogRead, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
21532169
21542170 // 0x60 -> 0x6f
2155- writeFile, readFile, deleteFile, existsFile, downloadFile, applyOTA, renameFile, downloadOTA, brSetECTrustAnchor, NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
2171+ writeFile, readFile, deleteFile, existsFile, downloadFile, applyOTA, renameFile, downloadOTA, brSetECTrustAnchor, brErrorCode , NULL , NULL , NULL , NULL , NULL , NULL ,
21562172
21572173 // Low-level BSD-like sockets functions.
21582174 // 0x70 -> 0x7f
0 commit comments