Skip to content

Commit

Permalink
python: remove internal functions from public header
Browse files Browse the repository at this point in the history
Functions print_rep, save_rep and display_cred_rsrc and
not used by the python layer were removed from the public header.

Unused function provision_authcrypt_wildcard_ace_cb removed
altogether.
  • Loading branch information
Danielius1922 committed Oct 25, 2023
1 parent 67b5d1b commit af8a458
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 38 deletions.
24 changes: 5 additions & 19 deletions python/oc_python.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ inform_resource_python(const char *anchor, const char *uri, const char *types,
}
}

void
/** function to print the returned cbor as JSON */
static void
print_rep(const oc_rep_t *rep, bool pretty_print)
{
char *json;
Expand All @@ -216,7 +217,8 @@ get_response_payload(void)
return response_payload;
}

void
/** function to save the returned cbor as JSON */
static void
save_rep(const oc_rep_t *rep, bool pretty_print)
{
size_t json_size;
Expand Down Expand Up @@ -870,7 +872,7 @@ py_retrieve_acl2(const char *uuid)
otb_mutex_unlock(app_sync_lock);
}

void
static void
display_cred_rsrc(const oc_sec_creds_t *creds)
{
if (creds) {
Expand Down Expand Up @@ -1250,22 +1252,6 @@ py_provision_pairwise_credentials(const char *uuid1, const char *uuid2)
otb_mutex_unlock(app_sync_lock);
}

void
provision_authcrypt_wildcard_ace_cb(const oc_uuid_t *uuid, int status,
void *data)
{
(void)data;
char di[OC_UUID_LEN];
oc_uuid_to_str(uuid, di, OC_ARRAY_SIZE(di));

if (status >= 0) {
OC_PRINTF("[C]\nSuccessfully provisioned auth-crypt * ACE to device %s\n",
di);
} else {
OC_PRINTF("[C]\nERROR provisioning ACE to device %s\n", di);
}
}

static void
provision_ace2_cb(const oc_uuid_t *uuid, int status, void *data)
{
Expand Down
19 changes: 0 additions & 19 deletions python/oc_python.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,9 @@ OC_API
void inform_resource_python(const char *anchor, const char *uri,
const char *types, const char *interfaces);

/**
* function to print the returned cbor as JSON
*/
OC_API
void print_rep(const oc_rep_t *rep, bool pretty_print);

OC_API
char *get_response_payload(void);

/**
* function to save the returned cbor as JSON
*/
OC_API
void save_rep(const oc_rep_t *rep, bool pretty_print);

/**
* function to call the callback for diplomats to python.
*/
Expand Down Expand Up @@ -178,9 +166,6 @@ void py_otm_just_works(const char *uuid);
OC_API
void py_retrieve_acl2(const char *uuid);

OC_API
void display_cred_rsrc(const oc_sec_creds_t *creds);

OC_API
void retrieve_cred_rsrc_cb(oc_sec_creds_t *creds, void *data);

Expand Down Expand Up @@ -258,10 +243,6 @@ void provision_oscore_contexts_cb(int status, void *data);
OC_API
void py_provision_pairwise_credentials(const char *uuid1, const char *uuid2);

OC_API
void provision_authcrypt_wildcard_ace_cb(const oc_uuid_t *uuid, int status,
void *data);

OC_API
void py_provision_ace_cloud_access(const char *uuid);

Expand Down

0 comments on commit af8a458

Please sign in to comment.