card not installed handling

This commit is contained in:
Siwat Sirichai 2024-11-03 22:32:36 +07:00
parent 268218f546
commit a22c8ef55c
5 changed files with 44 additions and 4 deletions

View file

@ -144,6 +144,12 @@ void ESPMegaIoT::registerCard(uint8_t card_id)
{
return;
}
// Check if the physical card is installed
if (cards[card_id] == NULL)
{
ESP_LOGE("ESPMegaIoT", "Registering card %d failed: Card not installed", card_id);
return;
}
// Get the card type
uint8_t card_type = cards[card_id]->getType();
// Create the respective IoT component