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.

RTOS/LAUNCHXL-CC2640R2: Questions about 'TASK 4' in the Thermostat BLE demo

Part Number: LAUNCHXL-CC2640R2

Tool/software: TI-RTOS

Hello,

I am modifying a program from Resource Explorer/CC2640R2 board to read accelerometer values from a 3-axis accelerometer and send the results from the three-axes (x, y, and z) via BLE to a notepad/phone/…. The data are three 16-bit values. I am following the example for ‘Thermostat’ (http://dev.ti.com/tirex/content/simplelink_academy_cc2640r2sdk_1_12_00_00/modules/ble_02_thermostat/ble_02_thermostat.html#expandable_-expand-for-header-file-for-temperature-reading-task-) The example is fairly easy to follow UNTIL the section ‘TASK 4’. While several of the instructions for TASK 4 are ‘plug-and-chug’, I see no easy/straight-forward method to extend the example to the general case (i.e., see ‘1’ below), and am looking for suggestions/insight on how to do so:

1 – It is stated “ ….the following code was modified from the temperature.c file….It was modified to run in a TI-RTOS task” Again, not clear what to do with/how to change *my*/a different program, i.e., just change all of the TMP007 references to i.e., MYACCEL…., to make this go ??

2 – The .h file is short enough, but again, just change all of the ‘tmp007’ references ? How was it generated, as the original project just shows ‘board.h’, ‘temperature.c’, ….

3 – Would using the Bluetooth Developers Suite (BDS) solve/address *ALL* of these issues ??? It seems like it might, as it generates all of the services and actually generates an entirely different/modified application program, but again looking for someone with more experience.

4 – If I use BDS, where and how do I specify my output data. Currently thinking of using one service that has as output x, y, and z, accelerometer data.

I believe in ‘hope’, but if possible would like a more concrete method to go about converting generating the files.

Thanks,

J.

  • Hi,

    For the first two items, you can take those 2 files and adding/removing the code to your custom code.

    For the 3rd item, BDS will just provide service/characteristics declaration/structure/callbacks for you, you still need to implement the sensor data reading/processing .

    The last item, You can have 1 service with 4 characteristics to cover your data(x,y, z and accel data)
  • Good morning, Christin,

    After I thought about the problem a bit more last night I also came to the conclusion that I could carefully substitute my working accel/application code into the current temperature program shell.

    BDS - indeed, I wasn't suggesting that BDS would write the application section of the program. On the examples I've tried, BDS writes 'XYZ.c', 'XYZ.h', files for the generated Profile/Services and a *new* 'ABC_BDS.c' to *replace* the original application file. I was wondering if the generated 'ABC_BDS.c' would contain all of the necessary program modifications, without having to copy/paste/.... from my original program as mentioned in my prior sentence and your suggestion.

    For the last item, agreed, though probably only *3* characteristics, as 'x,y,and, z', *are* the accel data.

    Best regards,

    Jim

  • Hi,

    What do you mean by all the necessary program modification? We have a BDS training in SimpleLink Academy. You can take a look at it.
    dev.ti.com/.../
  • Good afternoon, Christin,

    Indeed, before I initially posted I'd looked at/worked through the BDS section of SimpleLink Academy. As you know, there is "...more than one way to skin a cat...." What I mean by "....all the necessary program modifications..." is that in the BDS tutorial we create some Services. After compiling (in BDS), BDS generates two new files (a '.c' and a '.h') related to the services and one new application file. The two new files are added to the project and the new application file replaces the original application file. There is no going into any of the files, fiddling around, adding a line here, there, .... just compile (CCS) and run.

    In the approach used for the 'temperature.c' example and entire program has been modified to "...run in a TI-RTOS task..." Additionally, following the example requires going into several of the original/generated files, and adding a line here and there, ...., generating a '.h' file (aside from the files which were generated using the embedded light version of the BDS generator at the bottom of the example

    So, I was just wondering if generating the 'new' application file (along with the service '.c' and '.h' files) through BDS would negate having to go into the various files and adding lines of code here and there. I'm working from memory, but again, I think once I generated everything in BDS, I just added the two files generated for the service to the project, replaced the 'old' application file with the BDS-generated application file, compiled and ran. 

    The two exercises - 'temperature', and 'thermostat' - are very similar, i.e., start with a base application, then use Project_Zero code to take advantage of the already encapsulated BLE, but the approach used by each of the projects is a bit different and I'm trying to get to the actual differences between the two so I can understand what's going on and which approach to employ. I'm going by recall, so hopefully I've gotten the facts correct. Hopefully this clarifies my question and issues.

    Thanks,

    Jim