I have figured it out. The issue was with Characteristics type. Instead of "CBCharacteristicWriteWithResponse" I used "CBCharacteristicWriteWithoutResponse" and it worked.
I did this after reading this:
writeValue forCharacteristic writeType, this function is the primary function for writing to a characteristic on a device. the writeType property is either set to write with no response or write with response. When write with response is used, all writes to the peripheral are cached while the iOS device is waiting to receive the ok response and the callback. When write no response is used, the data will not be cached. This is important when using things which need low latency, like an RC car or helicopter etc. when using write with response, the iOS device may sometime lag behind, which does not make great response … For each write the didWriteCharacteristic callback is called.