mesh: Clean up naming of provisioning callbacks 73/229673/1
authorMichał Lowas-Rzechonek <michal.lowas-rzechonek@silvair.com>
Wed, 1 Apr 2020 10:24:59 +0000 (12:24 +0200)
committerAnupam Roy <anupam.r@samsung.com>
Wed, 1 Apr 2020 21:02:44 +0000 (02:32 +0530)
Change-Id: I06a052241958d54371270c1ff15117160d27c5e8
Signed-off-by: Anupam Roy <anupam.r@samsung.com>
mesh/prov-initiator.c
mesh/provision.h

index d5bae11..f2ebff6 100644 (file)
@@ -77,10 +77,10 @@ enum int_state {
 #define MAT_SECRET     (MAT_REMOTE_PUBLIC | MAT_LOCAL_PRIVATE)
 
 struct mesh_prov_initiator {
-       mesh_prov_initiator_complete_func_t cmplt;
-       mesh_prov_initiator_data_req_func_t get_prov_data;
+       mesh_prov_initiator_complete_func_t complete_cb;
+       mesh_prov_initiator_data_req_func_t data_req_cb;
        prov_trans_tx_t trans_tx;
-       void *agent;
+       struct mesh_agent *agent;
        void *caller_data;
        void *trans_data;
        struct mesh_node *node;
@@ -125,7 +125,7 @@ static void int_prov_close(void *user_data, uint8_t reason)
        struct mesh_prov_node_info info;
 
        if (reason != PROV_ERR_SUCCESS) {
-               prov->cmplt(prov->caller_data, reason, NULL);
+               prov->complete_cb(prov->caller_data, reason, NULL);
                initiator_free();
                return;
        }
@@ -135,7 +135,7 @@ static void int_prov_close(void *user_data, uint8_t reason)
        info.unicast = prov->unicast;
        info.num_ele = prov->conf_inputs.caps.num_ele;
 
-       prov->cmplt(prov->caller_data, PROV_ERR_SUCCESS, &info);
+       prov->complete_cb(prov->caller_data, PROV_ERR_SUCCESS, &info);
        initiator_free();
 }
 
@@ -738,7 +738,7 @@ static void int_prov_rx(void *user_data, const uint8_t *data, uint16_t len)
                        goto failure;
                }
 
-               if (!prov->get_prov_data(prov->caller_data,
+               if (!prov->data_req_cb(prov->caller_data,
                                        prov->conf_inputs.caps.num_ele)) {
                        l_error("Provisioning Failed-Data Get");
                        fail_code[1] = PROV_ERR_CANT_ASSIGN_ADDR;
@@ -819,7 +819,7 @@ bool initiator_start(enum trans_type transport,
                uint16_t max_ele,
                uint32_t timeout, /* in seconds from mesh.conf */
                struct mesh_agent *agent,
-               mesh_prov_initiator_data_req_func_t get_prov_data,
+               mesh_prov_initiator_data_req_func_t data_req_cb,
                mesh_prov_initiator_complete_func_t complete_cb,
                void *node, void *caller_data)
 {
@@ -836,8 +836,8 @@ bool initiator_start(enum trans_type transport,
        prov->to_secs = timeout;
        prov->node = node;
        prov->agent = agent;
-       prov->cmplt = complete_cb;
-       prov->get_prov_data = get_prov_data;
+       prov->complete_cb = complete_cb;
+       prov->data_req_cb = data_req_cb;
        prov->caller_data = caller_data;
        prov->previous = -1;
 
index d6f6e0a..43f53f9 100644 (file)
@@ -120,7 +120,7 @@ bool initiator_start(enum trans_type transport,
                uint16_t max_ele,
                uint32_t timeout, /* in seconds from mesh.conf */
                struct mesh_agent *agent,
-               mesh_prov_initiator_data_req_func_t get_prov_data,
+               mesh_prov_initiator_data_req_func_t data_req_cb,
                mesh_prov_initiator_complete_func_t complete_cb,
                void *node, void *caller_data);
 void initiator_prov_data(uint16_t net_idx, uint16_t primary, void *caller_data);