Added support to configure LED GPIO, LED brightness and LED dimming.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-09-27 20:56:33 +02:00
parent 720c2e45f3
commit 2d09a5c8e5
5 changed files with 109 additions and 13 deletions

View File

@@ -244,18 +244,13 @@ int cbor_config(const uint8_t *data, size_t len) {
}
}
else if (vendorCommandId == CTAP_CONFIG_PHY_LED_GPIO || vendorCommandId == CTAP_CONFIG_PHY_LED_BTNESS) {
if (vendorParam != 0) {
if (vendorCommandId == CTAP_CONFIG_PHY_LED_GPIO) {
tmp[PHY_LED_GPIO] = (uint8_t)vendorParam;
opts |= PHY_OPT_GPIO;
}
else if (vendorCommandId == CTAP_CONFIG_PHY_LED_BTNESS) {
tmp[PHY_LED_BTNESS] = (uint8_t)vendorParam;
opts |= PHY_OPT_BTNESS;
}
if (vendorCommandId == CTAP_CONFIG_PHY_LED_GPIO) {
tmp[PHY_LED_GPIO] = (uint8_t)vendorParam;
opts |= PHY_OPT_GPIO;
}
else {
CBOR_ERROR(CTAP2_ERR_MISSING_PARAMETER);
else if (vendorCommandId == CTAP_CONFIG_PHY_LED_BTNESS) {
tmp[PHY_LED_BTNESS] = (uint8_t)vendorParam;
opts |= PHY_OPT_BTNESS;
}
}
else if (vendorCommandId == CTAP_CONFIG_PHY_OPTS) {