Add setDigitalRead command handler type and command handler.
This commit is contained in:
@@ -994,6 +994,19 @@ int setAnalogWrite(const uint8_t command[], uint8_t response[])
|
|||||||
return 6;
|
return 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int setDigitalRead(const uint8_t command[], uint8_t response[])
|
||||||
|
{
|
||||||
|
uint8_t pin = command[4];
|
||||||
|
|
||||||
|
int8_t value = digitalRead(pin);
|
||||||
|
|
||||||
|
response[2] = 1; // number of parameters
|
||||||
|
response[3] = 1; // parameter 1 length
|
||||||
|
response[4] = value;
|
||||||
|
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
|
|
||||||
int wpa2EntSetIdentity(const uint8_t command[], uint8_t response[]) {
|
int wpa2EntSetIdentity(const uint8_t command[], uint8_t response[]) {
|
||||||
char identity[32 + 1];
|
char identity[32 + 1];
|
||||||
|
|
||||||
@@ -1112,7 +1125,7 @@ const CommandHandlerType commandHandlers[] = {
|
|||||||
setClientCert, setCertKey, NULL, NULL, sendDataTcp, getDataBufTcp, insertDataBuf, NULL, NULL, NULL, wpa2EntSetIdentity, wpa2EntSetUsername, wpa2EntSetPassword, wpa2EntSetCACert, wpa2EntSetCertKey, wpa2EntEnable,
|
setClientCert, setCertKey, NULL, NULL, sendDataTcp, getDataBufTcp, insertDataBuf, NULL, NULL, NULL, wpa2EntSetIdentity, wpa2EntSetUsername, wpa2EntSetPassword, wpa2EntSetCACert, wpa2EntSetCertKey, wpa2EntEnable,
|
||||||
|
|
||||||
// 0x50 -> 0x5f
|
// 0x50 -> 0x5f
|
||||||
setPinMode, setDigitalWrite, setAnalogWrite,
|
setPinMode, setDigitalWrite, setAnalogWrite, setDigitalRead,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_COMMAND_HANDLERS (sizeof(commandHandlers) / sizeof(commandHandlers[0]))
|
#define NUM_COMMAND_HANDLERS (sizeof(commandHandlers) / sizeof(commandHandlers[0]))
|
||||||
|
|||||||
Reference in New Issue
Block a user