无代码:过程of writing to a characteristic

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
3 posts / 0 new
Last post
krishnanag
Offline
Last seen:2 years 3 months ago
加入:2018-05-27 21:33
无代码:过程of writing to a characteristic

Hi,

I am using codeless, to transfer data from peripheral to smart phone, by writing into characteristic. So, when I do ATrl+"String", the characteristic gets written with that string.
This is working nicely even for large strings like 240 bytes. Now, I want to use this to transmit image from peripheral to smartphone. For this, I broke down the image to bytes, and I am sending ATrl+240 bytes of the image in packets. This writes only a few characters into the ble characteristic.

My suspicion is that when codeless receives from UART, and writes to ble characteristic, it stops writing at a particular character, and unfortunately, the byte value of the image might just equal that character. So, random pieces are being written to the characteristic.

I checked whether it receives everything properly through UART, by echoing , and it echoed 240 characters, or rather bytes, but the characteristic only gets a few.

Can you look into this please?

Thanks

Device:
krishnanag
Offline
Last seen:2 years 3 months ago
加入:2018-05-27 21:33
I got it. strlen was being

I got it. strlen was being used to handle the data, so it would stop at '\0' . I wrote my own code instead of strlen and it worked.

PM_Dialog
Offline
Last seen:2 days 2 hours ago
Staff
加入:2018-02-08 11:03
Hi krishnanag,

Hi krishnanag,

Glad that your problem has been fixed. Thanks for your indication.

Thanks, PM_Dialog