Skip to content

Commit 777dfc7

Browse files
committed
SATSE examples: compute certificate length from payload
1 parent 6d7ca0e commit 777dfc7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/SoftwareATSE/examples/SATSECertificate/SATSECertificate.ino

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ void setup() {
6767
}
6868

6969
byte buf[512];
70-
int len = 0;
70+
int ret = 0;
7171

72-
if((len = SATSE.readSlot(certId, buf, sizeof(buf))) > 0) {
72+
if((ret = SATSE.readSlot(certId, buf, sizeof(buf))) > 0) {
7373
Serial.print("Readback data is: ");
74+
int len = (buf[2] << 8) + buf[3] + 4;
7475
printBufferHex(buf, len);
7576
} else {
7677
Serial.println("Failed to read data");

0 commit comments

Comments
 (0)