Skip to content

Commit

Permalink
Add sorting of coap resources in generate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 26, 2020
1 parent 35d2a02 commit cfe46f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/wot_coap_generation/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ def find_all_coap_methods(handlerName, affName, coapJsons):
methods.append(aff['method'])
return methods

def write_coap_resources(coapResources):
def write_coap_resources(coap_resources):
add_content("const coap_resource_t _coap_resources[] = {\n")
#Fixme: sort before
for resource in coapResources:
resources = sorted(coap_resources, key=lambda k: k['url'])
for resource in resources:
add_content("{ \"" + resource['url'] + "\", COAP_GET | COAP_MATCH_SUBTREE, _echo_handler, NULL }")
i = len(resource['methods'])
for method in resource['methods']:
Expand Down

0 comments on commit cfe46f2

Please sign in to comment.