Set default measurement config in tlogger app on NHS3100 with code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set default measurement config in tlogger app on NHS3100 with code

1,062 Views
pilot_art_lis
Contributor I

I try to set default measurement configuration in TLogger app on NHS3100. By default configuration sets with a phone application "NHS3100 Temperature Logger" for both iOS and Android. But I need to make it with code for my university project.

I understand that it can be done with a SetConfigHandler function (msghandler.c). Structure APP_MSG_CMD_SETCONFIG_T handles all necessary variables for measurment process. Function SetConfigHandler sets configuration for measurments. I tried to write some code but it gives errors like "undefined reference to 'SetConfigHandler'". I did programming in C long far and don't remember how to do it right. I used function SetConfigHandler in InitApp function (maintlogger.c). I think that it just doesn't see this function because there is no variable of needed type.

Below you can find all lines of code written by me. This is in the maintlogger.c file. I changed only that file in this one place. I also attach this source file to this post. Other files of demo app app_demo_dp_tlogger are the same as originals. I'd be gratefull if you could help me solve this problem.

Error_2.png

0 Kudos
1 Reply

965 Views
driesmoors
NXP Employee
NXP Employee

Hi,

As a quick hack, you can remove the static keyword from SetConfigHandler in both the declaration and the implementation in file msghandler.c, and add uint32_t SetConfigHandler(uint8_t msgId, int len, const uint8_t* pPayload); on the line before using it in maintlogger.c

A bit more clean would be to present the message tp the msg module, who will dispatch it to the correct handler. Have a look at how it is done in GenerateNextAutomaticCommand.

Last, your changes will unconditionally start a new monitoring session after each restart. You may want to add a check on whether a session is already ongoing Memory_IsMonitoring(), or whether samples have already been stored in memory Storage_GetCount().

Kind regards,
Dries.

0 Kudos