Toggling GPIO using BLE UART

Hello I am using nRF52832 board and trying to toggle the LEDs using ble uart code. I tried to modify the following function as follows. I am able to send the 1 from the nRF connect app and the LED glows . But when I send 0, the LED does not turn off. Am I doing something wrong or I have to call the function in the main function as well? I have modified the function ble_peripheral_uart code.                                                                                                                                                                                                            

Related