Loading system/stack/btu/btu_init.c +2 −0 Original line number Original line Diff line number Diff line Loading @@ -115,6 +115,8 @@ void btu_free_core(void) /* Free the mandatory core stack components */ /* Free the mandatory core stack components */ l2c_free(); l2c_free(); sdp_free(); #if BLE_INCLUDED == TRUE #if BLE_INCLUDED == TRUE gatt_free(); gatt_free(); #endif #endif Loading system/stack/sdp/sdp_main.c +11 −0 Original line number Original line Diff line number Diff line Loading @@ -85,6 +85,10 @@ void sdp_init (void) /* Clears all structures and local SDP database (if Server is enabled) */ /* Clears all structures and local SDP database (if Server is enabled) */ memset (&sdp_cb, 0, sizeof (tSDP_CB)); memset (&sdp_cb, 0, sizeof (tSDP_CB)); for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) { sdp_cb.ccb[i].sdp_conn_timer = alarm_new("sdp.sdp_conn_timer"); } /* Initialize the L2CAP configuration. We only care about MTU and flush */ /* Initialize the L2CAP configuration. We only care about MTU and flush */ sdp_cb.l2cap_my_cfg.mtu_present = TRUE; sdp_cb.l2cap_my_cfg.mtu_present = TRUE; sdp_cb.l2cap_my_cfg.mtu = SDP_MTU_SIZE; sdp_cb.l2cap_my_cfg.mtu = SDP_MTU_SIZE; Loading Loading @@ -139,6 +143,13 @@ void sdp_init (void) } } } } void sdp_free(void) { for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) { alarm_free(sdp_cb.ccb[i].sdp_conn_timer); sdp_cb.ccb[i].sdp_conn_timer = NULL; } } #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) /******************************************************************************* /******************************************************************************* ** ** Loading system/stack/sdp/sdp_utils.c +3 −3 Original line number Original line Diff line number Diff line Loading @@ -120,8 +120,9 @@ tCONN_CB *sdpu_allocate_ccb (void) { { if (p_ccb->con_state == SDP_STATE_IDLE) if (p_ccb->con_state == SDP_STATE_IDLE) { { alarm_t* alarm = p_ccb->sdp_conn_timer; memset(p_ccb, 0, sizeof(tCONN_CB)); memset(p_ccb, 0, sizeof(tCONN_CB)); p_ccb->sdp_conn_timer = alarm_new("sdp.sdp_conn_timer"); p_ccb->sdp_conn_timer = alarm; return (p_ccb); return (p_ccb); } } } } Loading @@ -143,8 +144,7 @@ tCONN_CB *sdpu_allocate_ccb (void) void sdpu_release_ccb (tCONN_CB *p_ccb) void sdpu_release_ccb (tCONN_CB *p_ccb) { { /* Ensure timer is stopped */ /* Ensure timer is stopped */ alarm_free(p_ccb->sdp_conn_timer); alarm_cancel(p_ccb->sdp_conn_timer); p_ccb->sdp_conn_timer = NULL; /* Drop any response pointer we may be holding */ /* Drop any response pointer we may be holding */ p_ccb->con_state = SDP_STATE_IDLE; p_ccb->con_state = SDP_STATE_IDLE; Loading system/stack/sdp/sdpint.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -246,6 +246,7 @@ extern tSDP_CB *sdp_cb_ptr; /* Functions provided by sdp_main.c */ /* Functions provided by sdp_main.c */ extern void sdp_init (void); extern void sdp_init (void); extern void sdp_free(void); extern void sdp_disconnect (tCONN_CB*p_ccb, UINT16 reason); extern void sdp_disconnect (tCONN_CB*p_ccb, UINT16 reason); #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) Loading Loading
system/stack/btu/btu_init.c +2 −0 Original line number Original line Diff line number Diff line Loading @@ -115,6 +115,8 @@ void btu_free_core(void) /* Free the mandatory core stack components */ /* Free the mandatory core stack components */ l2c_free(); l2c_free(); sdp_free(); #if BLE_INCLUDED == TRUE #if BLE_INCLUDED == TRUE gatt_free(); gatt_free(); #endif #endif Loading
system/stack/sdp/sdp_main.c +11 −0 Original line number Original line Diff line number Diff line Loading @@ -85,6 +85,10 @@ void sdp_init (void) /* Clears all structures and local SDP database (if Server is enabled) */ /* Clears all structures and local SDP database (if Server is enabled) */ memset (&sdp_cb, 0, sizeof (tSDP_CB)); memset (&sdp_cb, 0, sizeof (tSDP_CB)); for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) { sdp_cb.ccb[i].sdp_conn_timer = alarm_new("sdp.sdp_conn_timer"); } /* Initialize the L2CAP configuration. We only care about MTU and flush */ /* Initialize the L2CAP configuration. We only care about MTU and flush */ sdp_cb.l2cap_my_cfg.mtu_present = TRUE; sdp_cb.l2cap_my_cfg.mtu_present = TRUE; sdp_cb.l2cap_my_cfg.mtu = SDP_MTU_SIZE; sdp_cb.l2cap_my_cfg.mtu = SDP_MTU_SIZE; Loading Loading @@ -139,6 +143,13 @@ void sdp_init (void) } } } } void sdp_free(void) { for (int i = 0; i < SDP_MAX_CONNECTIONS; i++) { alarm_free(sdp_cb.ccb[i].sdp_conn_timer); sdp_cb.ccb[i].sdp_conn_timer = NULL; } } #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) /******************************************************************************* /******************************************************************************* ** ** Loading
system/stack/sdp/sdp_utils.c +3 −3 Original line number Original line Diff line number Diff line Loading @@ -120,8 +120,9 @@ tCONN_CB *sdpu_allocate_ccb (void) { { if (p_ccb->con_state == SDP_STATE_IDLE) if (p_ccb->con_state == SDP_STATE_IDLE) { { alarm_t* alarm = p_ccb->sdp_conn_timer; memset(p_ccb, 0, sizeof(tCONN_CB)); memset(p_ccb, 0, sizeof(tCONN_CB)); p_ccb->sdp_conn_timer = alarm_new("sdp.sdp_conn_timer"); p_ccb->sdp_conn_timer = alarm; return (p_ccb); return (p_ccb); } } } } Loading @@ -143,8 +144,7 @@ tCONN_CB *sdpu_allocate_ccb (void) void sdpu_release_ccb (tCONN_CB *p_ccb) void sdpu_release_ccb (tCONN_CB *p_ccb) { { /* Ensure timer is stopped */ /* Ensure timer is stopped */ alarm_free(p_ccb->sdp_conn_timer); alarm_cancel(p_ccb->sdp_conn_timer); p_ccb->sdp_conn_timer = NULL; /* Drop any response pointer we may be holding */ /* Drop any response pointer we may be holding */ p_ccb->con_state = SDP_STATE_IDLE; p_ccb->con_state = SDP_STATE_IDLE; Loading
system/stack/sdp/sdpint.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -246,6 +246,7 @@ extern tSDP_CB *sdp_cb_ptr; /* Functions provided by sdp_main.c */ /* Functions provided by sdp_main.c */ extern void sdp_init (void); extern void sdp_init (void); extern void sdp_free(void); extern void sdp_disconnect (tCONN_CB*p_ccb, UINT16 reason); extern void sdp_disconnect (tCONN_CB*p_ccb, UINT16 reason); #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) #if (defined(SDP_DEBUG) && SDP_DEBUG == TRUE) Loading