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.

LP-CC2652RB: "zclSampleApp_processKey" vs "sampleApp_processKey"

Part Number: LP-CC2652RB
Other Parts Discussed in Thread: SYSCONFIG, CC2652RB

Hello!

I am trying to understand the Button Inferface. My Prototype has one single Button, I am starting with the sample app example which has two buttons, so I am removing one. First I remove the second button from the sysconfig and configure my button as per my hardware design. 

Now in sampleapp.c I face two functions: zclSampleApp_processKey and sampleApp_processKey. Both wrapped into #ifndef CUI_DISABLE

as far as I understand, the CUI is the console user interface? How is this related to the physical buttons on my hardware? I have found the same question asked in here, but I am honestly a bit unable to make a sense the answer. Which version is relevant for the physical button press?

After all, what I want to do is on short press wake up and read my sensor and report the reading and go back to sleep for a fixed period. And on long press factory reset and start commissioning.

on a sidenot: I don't use a launchpad, I develop directly on a prototype using CC2652RB, however if I select the non-LP version I can only select Bluetooth forums, but not Zigbee, seems to be a bug in the forums software. 

  • CUI allows you to operate with serial console input and button so you see button related code inside CUI define. 

  • ok, thank you! And which one of the two functions gets invoked when there is no console connected and the user just presses the button on the device? 

  • Button is initialized and setup callbacks in UI_Init.

  • again, thanks for taking the time to reply, but I do not see how this answers my question, it is actually causing even more confusion. I studied UI_Init and see that it registers zclSampleApp_processKey as a callback. So what is the purpose of sampleApp_processKey then? Why are there two seemingly identical functions?

  • I suppose you are using simplelink_cc13xx_cc26xx_sdk_5_30_00_56. I use simplelink_cc13xx_cc26xx_sdk_5_40_00_40. I only have zclSampleApp_processKey in my sampleapp.c and don't see sampleApp_processKey in my sampleapp.c. I would suggest you to use latest simplelink_cc13xx_cc26xx_sdk_5_40_00_40.

  • oh this is interesting. I just downloaded the CCS 11.1 last week. I just had a quick look, and I have not found *any* version information regarding the sdk anywhere. But assuming I am on an onld version of the SDK, why could that happen on a fresh install and how do I fix it? 

    I wish the big hardware manufacturers would finally learn what UX means.

    I actually just searched the project folder using VSCode (quick and easy, even a child could do this) and the syscfg file actually has info in the header tag: "simplelink_cc13x2_26x2_sdk@5.20.00.52". Also the .cproject file references this. Why would the IDE install old versions of the examples on a fesh install?

  • You can use resource explorer to remove 5.20 and install latest 5.40

  • Ok, now I start to make sense of why 5.20 was installed. I just did as you suggested, and try to reimport the example. And upon importing the temperature sensor example, CCS promts me that it needs to download resources, and then requests SDK 5.20. How can I go around this?

  • ok i got it, if I work around the issue and not use the "import example" option in getting started, but actually navigate to the examples using the resource explorer it works. messed up UI it seems. thank you YiKai!