- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
03-19-2017 12:35 PM
I have a problem with buffers.
I have initialized a buffer at the start of the script: dim datatosend (8)
after at the event "system_boot" I use this buffer and I fill it with this code: datatosend(0:8) = "Prova123"
When I try to use this buffer (for example reading it by USB endpoint with Bluegiga GUI - this is the command; call endpoint_send(3, 8, datatosend(0)),
only the first 4 bytes are filled with "Prov" the other bytes starting from the 4th byte are filled with \x04 \x00 \x00 \x00.
I try to use memcpy and other solution, but I reach the same result.
Have I made a mistake?
Solved! Go to Solution.
03-19-2017 03:53 PM
After a deep-Search acitvity in the forum I have found the solution here:
My mistake is to call the command:
endpoint_send(3, 8, datatosend(0))
instead of this one:
endpoint_send(3, 8, datatosend(0:8))