@@ -1676,6 +1676,22 @@ int brSetECTrustAnchor(const uint8_t command[], uint8_t response[])
1676
1676
return 6 ;
1677
1677
}
1678
1678
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
+
1679
1695
//
1680
1696
// Low-level BSD-like sockets functions
1681
1697
//
@@ -2152,7 +2168,7 @@ const CommandHandlerType commandHandlers[] = {
2152
2168
setPinMode, setDigitalWrite, setAnalogWrite, getDigitalRead, getAnalogRead, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
2153
2169
2154
2170
// 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 ,
2156
2172
2157
2173
// Low-level BSD-like sockets functions.
2158
2174
// 0x70 -> 0x7f
0 commit comments