This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to Write Attributes larger than 1byte

Hi,

I'm trying to modify the SimpleBLEPeripheral to change Characteristic 1 from a single byte into a 16 byte array.  I have successfully configured it to be initialised and it reads OK, but get an error when trying to write 16 bytes.  Write permissions are enabled.  I can see that I'm getting erors because the existing source code is configured for single byte write only. Are there any examples I can look at which succesfully write an array?

regards

Tony Green

  • Hi,

    In the same application, characteristic 5 is 5 bytes of array. You can look at it.

  • Have you checked simpleGATTprofile.c? SimpleProfile_SetParameter has length checks for each char that need to be updated. Also there are a number of points that single byte copies need to be changed to array copies in this file and others within the project.

  • Thanks Eng351,

    There were a number of hurdles but we got there in the end using the memcpy function, but the real culprit was the callback and 'notifyapp' which copies the pointer to the array for your application to use - it's currently set a s a pointer to a char but now needs to point to a char array, this was causing the application to crash.