@@ -1180,6 +1180,19 @@ int setAnalogWrite(const uint8_t command[], uint8_t response[])
1180
1180
return 6 ;
1181
1181
}
1182
1182
1183
+ int getDigitalRead (const uint8_t command[], uint8_t response[])
1184
+ {
1185
+ uint8_t pin = command[4 ];
1186
+
1187
+ int const pin_status = digitalRead (pin);
1188
+
1189
+ response[2 ] = 1 ; // number of parameters
1190
+ response[3 ] = 1 ; // parameter 1 length
1191
+ response[4 ] = (uint8_t )pin_status;
1192
+
1193
+ return 6 ;
1194
+ }
1195
+
1183
1196
int writeFile (const uint8_t command[], uint8_t response[]) {
1184
1197
char filename[32 + 1 ];
1185
1198
size_t len;
@@ -1566,7 +1579,7 @@ const CommandHandlerType commandHandlers[] = {
1566
1579
setEnt, NULL , NULL , NULL , sendDataTcp, getDataBufTcp, insertDataBuf, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
1567
1580
1568
1581
// 0x50 -> 0x5f
1569
- setPinMode, setDigitalWrite, setAnalogWrite, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
1582
+ setPinMode, setDigitalWrite, setAnalogWrite, getDigitalRead , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
1570
1583
1571
1584
// 0x60 -> 0x6f
1572
1585
writeFile, readFile, deleteFile, existsFile, downloadFile, applyOTA, renameFile, downloadOTA, NULL , NULL , NULL , NULL , NULL , NULL , NULL , NULL ,
0 commit comments