This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unable to send consecutive commands to peripheral through bglib on C#

I am implementing Device Firmware Update using BGLib on C# using BLED112. When i am writing on the DFU Data point on Peripheral (which is a Nordic's nrf51 chipset), i need to provide atleast 100 ms delay between each 20bytes chunk. If i am providing less or no interval in between, peripheral is not recieving my data and refusing to execute the data chunk on Flash Page. My minimum and maximum connection interval is 8ms each (0x08 and 0x08), latency is 0 and timeout is 256 msec (0x100):

bglib.SendCommand(serialPort, bglib.BLECommandGAPConnectDirect(device.Value.sender, device.Value.address_type, 0x08, 0x08, 0x100, 0));

Can you provide me a way to reduce the inter-command delay because it is taking more than 12 minutes to transfer the whole firmware (almost 140KB).

Thank you.

  • what exactly happen when "peripheral is not recieving my data and refusing to execute the data chunk" ?

    Was the data packet sent from the BLED112 ? If you test using a phone, do you have the same problem ? Do you have a sniffer to capture what happens over the air ?

    I don't see any reason why our DFU bootloader would require that 100ms delay.

  • Hello Hung, yes the data packet was sent from BLED112. The Flash page size is 4KB, so i needed to break the firmware in 4KB pages and then further break down to 20Bytes chunks. Since the notifications are off, i don't know which 20 bytes chunk in 4KB flash page is having problem transmitting. But when at the end i am running the Execute command (0x04), it is giving me a response of {0x60, 0x04, 0x08}. There is no latency issue at the BlueGiga dongle, i have verified it at their forum.

    The only doubt i have is the connection properties. I am asking for 8ms of max and min connection interval, while firmware can only give between 15ms to 30ms... Do you think this is somehow having this effect that i need to give 100ms delay in between each 20 bytes?

  • The behavior is not being noticed from cellphone. I didn't use any sniffer, probably i should set it up to see what is happening. I will update this thread afterwards.

  • Yes, the sniffer would really help to pin down the issue. I assume you know where to download our sniffer.

    Another way to test is to make a simple program and try to send a lot of notifications and then on the other side print number out or use LED to tell how many packet you receive.

Related