Getting pointer from C function

I’m not good at C beyond some basics. I don’t exactly understand the syntax. I’m sure this is an easy one for someone here. This code works perfect for one switch. I want to add more that one switch and I’m trying to write an if statement to know which switch was pressed. I can generally follow the code to get what I need done but I’m struggling with what I need to do to get the value of the selected cha_name.

void cha_switch_on_setter(const homekit_value_t value) {
bool on = value.bool_value;
cha_switch_on.value.bool_value = on; //sync the value
LOG_D("Switch: %s", on ? "ON" : "OFF");
//if (which switch pushed)...how to get value of cha_name here <----------
digitalWrite(PIN_SWITCH, on ? LOW : HIGH);
 //Serial.print("button pressed: ");
 //Serial.println(cha_name???);
}

switchThree.ino (2.94 KB)

my_accessory.c (2.41 KB)

wifi_info.h (659 Bytes)

That's a lot of code and you've asked no specific question or explained where you're having a problem.

Try posting an MRE, providing a simple, complete code that demonstrates the problem you're having (and only that problem). Then explain the problem, coherently, in words.