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.

Size of message

Other Parts Discussed in Thread: ADS1231

Hello.

I have a EZ430-RF2560 kit and I want to change the original software in order to send my own messages via Bluetooth instead of accelerometer readings. After making the necessary changes, the comunication seems to be working just fine. The problem is when I try to send a message bigger than 4 bytes (the original size of accelerometer buffer), some bytes are lost. Can anyone tell me what I have to do to send bigger messages?

  • Bernardo,

     

    You will need to change the size of the message in several places.

    At the transmitter end, there are several calls to appl_acceleromenter_read_spp_send(.....).

    These will need to be changed to something Like:

    appl_spp_write(index, "String here",strlen("String here"));

     

    Note that the first parameter, index, is sometimes 0 (make it coincide with the parameter of the appl_acceleromenter_read_spp_send call. A better way is to replace all those lines with your own function.

     

    At the receiver, there is in appl_spp.c the following lines:

    if (TRUE == sdk_usb_detected) {
                memcpy(string, l_data, datalen);
                halUsbSendString(string, 4);
            }

    As you can see, the functions sendString should have datalen as second parameter to send whatever length arrives from the bluetooth UART.

     

    Gustavo

  • Thanks!

    That was exactly what I needed.

  • Hi Bernardo, I am interested in modifying the original software in order to send my own messages like you have done, but I am not sure where to start modifying. Can you lead me on where to start modifying the code so I could send my own messages?

     

    Thanks. Any help will be appreciated

  • Jorge,

               You can look at appl_sdk.c file for the appl_acceleromenter_read_spp_send() function. This function reads the data from the accelerometer and sends it over BT. You can simply replace  sdk_accelerometer_read()  with your function (e.g. sdk_ADS1231_read.

    Regards,

  • That's pretty much what I have done. I replaced sdk_accelerometer_read() by functions that read data from serial port, and calling appl_spp_write to send data over bluetooth. Also, remember to change de size of the expected message like described above.

  • Dear all,

    as explained in this thread I changed the code in the file appl_sdk.c for the appl_acceleromenter_read_spp_send() function

    to send the string "Hello world", this modification works pretty good, but I receive it in a continuative way on my serial.

     

    I would to receive it once every time the button S2 is released.

     

    I' ve looked in the appl_menu_pl.c file but seems I can't fix the problem.

     

    Can you help me ?

    Thanks a lot.

     

    Regards

     

    Netmastro