I've also attached a development app I created while learning to communicate with an RN4020 BLE device. I'm using it's MLDP mode (a so called SPP equivalent) so it's a little different from communicating with standard BLE devices, but it should give you some ideas to start with. Also, BLE has a 20 byte max limit on write transfers. In my app I use the write complete event to send data in chunks of 20 bytes if necessary, so I can send more or less continuous streams if I need to. If you look at "Manager_Disconnected" you'll see I do retries. I was getting disconnect events without a connect. Doing a connect retry solved the problem. I don't know if it's something odd with BLE itself, or the RN4020 module. You may not have this issue.
Thanks so much for your reply sir. I will read your code later. I'am using bluno bettle as my BLE module.
I tried using their sample from here. Also i got getting disconnected without doing anything. For the data length i just need to pass 1 or 0 to trigger job of bluno bettle. Again sir thanks. https://www.dfrobot.com/blog-283.html
'Private Service For Microchip MLDP
Private MLDP_PRIVATE_SERVICE As String = "00035b03-58e6-07dd-021a-08123a000300"
'Characteristic For MLDP Data, properties - notify, write
Private MLDP_DATA_PRIVATE_CHAR As String = "00035b03-58e6-07dd-021a-08123a000301"