examples/Lock_button_contact/main.c
/**
 * Called (indirectly) from the interrupt handler to notify the client of a state change.
 **/
Called (indirectly) from the interrupt handler to notify the client of a state change.
Called ( indirectly ) from the interrupt handler to notify the client of a state change .
void contact_sensor_callback(uint8_t gpio, contact_sensor_state_t state) {
    switch (state) {
        case CONTACT_OPEN:
        case CONTACT_CLOSED:
            printf("Pushing contact sensor state '%s'.\n", state == CONTACT_OPEN ? "open" : "closed");
            homekit_characteristic_notify(&door_open_characteristic, door_state_getter());
            break;
        default:
            printf("Unknown contact sensor event: %d\n", state);
    }
}
void contact_sensor_callback ( uint8_t gpio , contact_sensor_state_t state ) { switch ( state ) { case CONTACT_OPEN : case CONTACT_CLOSED : printf ( " \n " , state == CONTACT_OPEN ? " " : " " ) ; homekit_characteristic_notify ( & door_open_characteristic , door_state_getter ( ) ) ; break ; default : printf ( " \n " , state ) ; } }
Called (indirectly) from the interrupt handler to notify the client of a state change.
Called ( indirectly ) from the interrupt handler to notify the client of a state change .