Skip to content

Commit

Permalink
Automatic format commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CascodaBot committed Feb 27, 2024
1 parent d5c7dbc commit eed7d06
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
21 changes: 11 additions & 10 deletions api/oc_knx.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,10 @@ void
oc_create_knx_resource(int resource_idx, size_t device)
{
OC_DBG("oc_create_knx_resource\n");
oc_core_populate_resource(resource_idx, device, "/.well-known/knx",
OC_IF_LI | OC_IF_SEC | OC_IF_D, APPLICATION_LINK_FORMAT,
OC_DISCOVERABLE, oc_core_knx_get_handler, 0,
oc_core_knx_post_handler, 0, 0);
oc_core_populate_resource(
resource_idx, device, "/.well-known/knx", OC_IF_LI | OC_IF_SEC | OC_IF_D,
APPLICATION_LINK_FORMAT, OC_DISCOVERABLE, oc_core_knx_get_handler, 0,
oc_core_knx_post_handler, 0, 0);
}

// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -969,18 +969,19 @@ oc_core_knx_k_post_handler(oc_request_t *request,
}

OC_CORE_CREATE_CONST_RESOURCE_LINKED(knx_k, knx_fingerprint, 0, "/k",
OC_IF_LI | OC_IF_G | OC_IF_D, APPLICATION_CBOR,
OC_DISCOVERABLE, oc_core_knx_k_get_handler,
0, oc_core_knx_k_post_handler, 0, NULL,
OC_IF_LI | OC_IF_G | OC_IF_D,
APPLICATION_CBOR, OC_DISCOVERABLE,
oc_core_knx_k_get_handler, 0,
oc_core_knx_k_post_handler, 0, NULL,
OC_SIZE_MANY(1), "urn:knx:g.s");
void
oc_create_knx_k_resource(int resource_idx, size_t device)
{
OC_DBG("oc_create_knx_k_resource (g)\n");

oc_core_populate_resource(resource_idx, device, "/k", OC_IF_LI | OC_IF_G | OC_IF_D,
APPLICATION_CBOR, OC_DISCOVERABLE,
oc_core_knx_k_get_handler, 0,
oc_core_populate_resource(resource_idx, device, "/k",
OC_IF_LI | OC_IF_G | OC_IF_D, APPLICATION_CBOR,
OC_DISCOVERABLE, oc_core_knx_k_get_handler, 0,
oc_core_knx_k_post_handler, 0, 1, "urn:knx:g.s");
}

Expand Down
4 changes: 2 additions & 2 deletions api/oc_knx_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ discovery_ia_cb(const char *payload, int len, oc_endpoint_t *endpoint,
}

int
oc_knx_client_do_broker_request(const char *resource_url, uint64_t iid, uint32_t ia,
char *destination, char *rp)
oc_knx_client_do_broker_request(const char *resource_url, uint64_t iid,
uint32_t ia, char *destination, char *rp)
{
char query[20];

Expand Down
10 changes: 6 additions & 4 deletions api/oc_knx_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ oc_core_fb_x_get_handler(oc_request_t *request, oc_interface_mask_t iface_mask,
}

OC_CORE_CREATE_CONST_RESOURCE_LINKED(knx_f_x, knx_swu_protocol, 0, "/f/*",
OC_IF_LI | OC_IF_D, APPLICATION_LINK_FORMAT, 0,
OC_IF_LI | OC_IF_D,
APPLICATION_LINK_FORMAT, 0,
oc_core_fb_x_get_handler, 0, 0, 0, NULL,
OC_SIZE_MANY(1), "urn:knx:fb.0");

Expand All @@ -255,8 +256,8 @@ oc_create_fb_x_resource(int resource_idx, size_t device)
// note that this resource is listed in /.well-known/core so it should have
// the full rt with urn:knx prefix
oc_core_populate_resource(
resource_idx, device, "/f/*", OC_IF_LI | OC_IF_D, APPLICATION_LINK_FORMAT, 0,
oc_core_fb_x_get_handler, 0, 0, 0, 1, "urn:knx:fb.0");
resource_idx, device, "/f/*", OC_IF_LI | OC_IF_D, APPLICATION_LINK_FORMAT,
0, oc_core_fb_x_get_handler, 0, 0, 0, 1, "urn:knx:fb.0");
}

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -560,7 +561,8 @@ oc_core_fb_get_handler(oc_request_t *request, oc_interface_mask_t iface_mask,
PRINT("oc_core_fb_get_handler - end\n");
}

OC_CORE_CREATE_CONST_RESOURCE_LINKED(knx_f, knx_f_x, 0, "/f", OC_IF_LI | OC_IF_D,
OC_CORE_CREATE_CONST_RESOURCE_LINKED(knx_f, knx_f_x, 0, "/f",
OC_IF_LI | OC_IF_D,
APPLICATION_LINK_FORMAT, 0,
oc_core_fb_get_handler, 0, 0, 0, NULL,
OC_SIZE_MANY(1), "urn:knx:fb.0");
Expand Down
4 changes: 2 additions & 2 deletions api/oc_knx_sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ oc_core_knx_auth_o_get_handler(oc_request_t *request,
}

OC_CORE_CREATE_CONST_RESOURCE_LINKED(knx_auth_o, knx_auth_at, 0, "/auth/o",
OC_IF_LI | OC_IF_D, APPLICATION_LINK_FORMAT,
OC_DISCOVERABLE,
OC_IF_LI | OC_IF_D,
APPLICATION_LINK_FORMAT, OC_DISCOVERABLE,
oc_core_knx_auth_o_get_handler, 0, 0, 0,
NULL, OC_SIZE_ZERO());
void
Expand Down
11 changes: 6 additions & 5 deletions api/oc_knx_swu.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ void
oc_create_knx_swu_maxdefer_resource(int resource_idx, size_t device)
{
OC_DBG("oc_create_knx_swu_maxdefer_resource\n");
oc_core_populate_resource(resource_idx, device, "/swu/maxdefer", OC_IF_LI | OC_IF_D,
APPLICATION_CBOR, OC_DISCOVERABLE,
oc_knx_swu_maxdefer_get_handler,
oc_core_populate_resource(resource_idx, device, "/swu/maxdefer",
OC_IF_LI | OC_IF_D, APPLICATION_CBOR,
OC_DISCOVERABLE, oc_knx_swu_maxdefer_get_handler,
oc_knx_swu_maxdefer_put_handler, 0, 0, 0);

oc_core_bind_dpt_resource(resource_idx, device, "urn:knx:dpt.timePeriodSec");
Expand Down Expand Up @@ -876,8 +876,9 @@ oc_create_knx_swu_resource(int resource_idx, size_t device)
OC_DBG("oc_create_knx_swu_resource\n");
//
oc_core_populate_resource(
resource_idx, device, "/swu", OC_IF_SWU | OC_IF_LI | OC_IF_D, APPLICATION_LINK_FORMAT,
OC_DISCOVERABLE, oc_core_knx_swu_get_handler, 0, 0, 0, 1, "urn:knx:fb.swu");
resource_idx, device, "/swu", OC_IF_SWU | OC_IF_LI | OC_IF_D,
APPLICATION_LINK_FORMAT, OC_DISCOVERABLE, oc_core_knx_swu_get_handler, 0, 0,
0, 1, "urn:knx:fb.swu");
}

void
Expand Down
3 changes: 2 additions & 1 deletion security/oc_oscore_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ oc_oscore_add_context(size_t device, const char *senderid, int senderid_size,
return NULL;
}

if (mastersecret_size < OSCORE_KEY_LEN || mastersecret_size > OSCORE_MASTER_SECRET_LEN) {
if (mastersecret_size < OSCORE_KEY_LEN ||
mastersecret_size > OSCORE_MASTER_SECRET_LEN) {
OC_ERR("master secret size is incorrect : %d", mastersecret_size);
return NULL;
}
Expand Down

0 comments on commit eed7d06

Please sign in to comment.