cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Find element infotable CSDK

AliBenBelgacem
14-Alexandrite

Find element infotable CSDK

Hello,

 

I have a csdk prorgam, i need to search specific element on infotable.

I am trying to use the function twList_Foreach(twList *list, twForEachHander listHandler, void *userData) to find and update row on the infotable, but i am not succeeding.

Can someone provide me with a sample to use this method please?

my infotable contains 4 strings [field A , field B , field C , field D] , 

i am searching the row where B=='some specific string'

if true update the row.

 

Thank you very much for your help 

 

ACCEPTED SOLUTION

Accepted Solutions

No working example, but the CSDK has some usages of it, just search for twList_Foreach. Some sample files using twList_Foreach are:

BindingIntegrationTests.c (in test/integration)

twInfoTable.c (in src/messaging)

 

twList_Foreach will iterate all rows, so your handler will be called for each row. Therefore you need to check for your condition B=='some specific string' in the handler (and exit/return) if it doesn't match.

You could also try to use twList_Find instead, a sample you can find in unit_twList_Find.c

View solution in original post

1 REPLY 1

No working example, but the CSDK has some usages of it, just search for twList_Foreach. Some sample files using twList_Foreach are:

BindingIntegrationTests.c (in test/integration)

twInfoTable.c (in src/messaging)

 

twList_Foreach will iterate all rows, so your handler will be called for each row. Therefore you need to check for your condition B=='some specific string' in the handler (and exit/return) if it doesn't match.

You could also try to use twList_Find instead, a sample you can find in unit_twList_Find.c

Announcements


Top Tags