@@ -102,8 +102,8 @@ static bool find_peer_addr(ble_gap_evt_adv_report_t const *const adv_report,
102102 ble_gap_addr_t const * addr )
103103{
104104 /* Compare addresses.*/
105- if (memcmp (addr -> addr , adv_report -> peer_addr .addr ,
106- sizeof ( adv_report -> peer_addr . addr )) == 0 ) {
105+ if (memcmp (addr -> addr , adv_report -> peer_addr .addr , sizeof ( adv_report -> peer_addr . addr )) ==
106+ 0 ) {
107107 return true;
108108 }
109109
@@ -126,8 +126,7 @@ static bool adv_addr_compare(ble_gap_evt_adv_report_t const *const adv_report,
126126 return false;
127127}
128128
129- static int nrf_ble_scan_addr_filter_add (struct nrf_ble_scan * const scan_ctx ,
130- uint8_t const * addr )
129+ static int nrf_ble_scan_addr_filter_add (struct nrf_ble_scan * const scan_ctx , uint8_t const * addr )
131130{
132131 ble_gap_addr_t * addr_filter = scan_ctx -> scan_filters .addr_filter .target_addr ;
133132 uint8_t * counter = & scan_ctx -> scan_filters .addr_filter .addr_cnt ;
@@ -168,8 +167,7 @@ static int nrf_ble_scan_addr_filter_add(struct nrf_ble_scan *const scan_ctx,
168167static bool adv_name_compare (ble_gap_evt_adv_report_t const * adv_report ,
169168 struct nrf_ble_scan const * const scan_ctx )
170169{
171- struct nrf_ble_scan_name_filter const * name_filter =
172- & scan_ctx -> scan_filters .name_filter ;
170+ struct nrf_ble_scan_name_filter const * name_filter = & scan_ctx -> scan_filters .name_filter ;
173171 uint8_t counter = scan_ctx -> scan_filters .name_filter .name_cnt ;
174172 uint8_t index ;
175173 uint16_t data_len ;
@@ -211,8 +209,7 @@ static int nrf_ble_scan_name_filter_add(struct nrf_ble_scan *const scan_ctx, cha
211209 }
212210
213211 /* Add name to filter.*/
214- memcpy (scan_ctx -> scan_filters .name_filter .target_name [(* counter )++ ], name ,
215- strlen (name ));
212+ memcpy (scan_ctx -> scan_filters .name_filter .target_name [(* counter )++ ], name , strlen (name ));
216213
217214 LOG_DBG ("Adding filter on %s name" , name );
218215
@@ -326,8 +323,7 @@ static bool adv_uuid_compare(ble_gap_evt_adv_report_t const *const adv_report,
326323 return false;
327324}
328325
329- static int nrf_ble_scan_uuid_filter_add (struct nrf_ble_scan * const scan_ctx ,
330- ble_uuid_t const * uuid )
326+ static int nrf_ble_scan_uuid_filter_add (struct nrf_ble_scan * const scan_ctx , ble_uuid_t const * uuid )
331327{
332328 ble_uuid_t * uuid_filter = scan_ctx -> scan_filters .uuid_filter .uuid ;
333329 uint8_t * counter = & scan_ctx -> scan_filters .uuid_filter .uuid_cnt ;
@@ -494,8 +490,7 @@ int nrf_ble_scan_all_filter_remove(struct nrf_ble_scan *const scan_ctx)
494490
495491int nrf_ble_scan_filters_enable (struct nrf_ble_scan * const scan_ctx , uint8_t mode , bool match_all )
496492{
497- /* VERIFY_PARAM_NOT_NULL(scan_ctx);*/
498- if (scan_ctx == NULL ) {
493+ if (!scan_ctx ) {
499494 return NRF_ERROR_NULL ;
500495 }
501496
@@ -759,10 +754,6 @@ bool is_whitelist_used(struct nrf_ble_scan const *const scan_ctx)
759754 return false;
760755}
761756
762- /**@brief Function for restoring the default scanning parameters.
763- *
764- * @param[out] scan_ctx Pointer to the Scanning Module instance.
765- */
766757static void nrf_ble_scan_default_param_set (struct nrf_ble_scan * const scan_ctx )
767758{
768759 /* Set the default parameters.*/
@@ -779,10 +770,6 @@ static void nrf_ble_scan_default_param_set(struct nrf_ble_scan *const scan_ctx)
779770 scan_ctx -> scan_params .scan_phys = BLE_GAP_PHY_1MBPS ;
780771}
781772
782- /**@brief Function for setting the default connection parameters.
783- *
784- * @param[out] scan_ctx Pointer to the Scanning Module instance.
785- */
786773static void nrf_ble_scan_default_conn_param_set (struct nrf_ble_scan * const scan_ctx )
787774{
788775 scan_ctx -> conn_params .conn_sup_timeout = BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN ;
@@ -791,11 +778,6 @@ static void nrf_ble_scan_default_conn_param_set(struct nrf_ble_scan *const scan_
791778 scan_ctx -> conn_params .slave_latency = (uint16_t )NRF_BLE_SCAN_SLAVE_LATENCY ;
792779}
793780
794- /**@brief Function for calling the BLE_GAP_EVT_TIMEOUT event.
795- *
796- * @param[in] scan_ctx Pointer to the Scanning Module instance.
797- * @param[in] gap GAP event structure.
798- */
799781static void nrf_ble_scan_on_timeout (struct nrf_ble_scan const * const scan_ctx ,
800782 ble_gap_evt_t const * const gap )
801783{
@@ -814,8 +796,6 @@ static void nrf_ble_scan_on_timeout(struct nrf_ble_scan const *const scan_ctx,
814796 }
815797}
816798
817- /**@brief Function for stopping the scanning.
818- */
819799void nrf_ble_scan_stop (void )
820800{
821801 /* It is ok to ignore the function return value here, because this function can return*/
@@ -884,7 +864,8 @@ int nrf_ble_scan_start(struct nrf_ble_scan const *const scan_ctx)
884864
885865 nrf_ble_scan_stop ();
886866
887- /* If the whitelist is used and the event handler is not NULL, send the whitelist request to*/
867+ /* If the whitelist is used and the event handler is not NULL, send the whitelist request
868+ * to*/
888869 /* the main application.*/
889870 if (is_whitelist_used (scan_ctx )) {
890871 if (scan_ctx -> evt_handler != NULL ) {
@@ -909,7 +890,6 @@ int nrf_ble_scan_start(struct nrf_ble_scan const *const scan_ctx)
909890int nrf_ble_scan_params_set (struct nrf_ble_scan * const scan_ctx ,
910891 ble_gap_scan_params_t const * const scan_param )
911892{
912- /* VERIFY_PARAM_NOT_NULL(scan_ctx);*/
913893 if (!scan_ctx ) {
914894 return NRF_ERROR_NULL ;
915895 }
@@ -928,11 +908,6 @@ int nrf_ble_scan_params_set(struct nrf_ble_scan *const scan_ctx,
928908 return NRF_SUCCESS ;
929909}
930910
931- /**@brief Function for calling the BLE_GAP_EVT_CONNECTED event.
932- *
933- * @param[in] scan_ctx Pointer to the Scanning Module instance.
934- * @param[in] gap_evt GAP event structure.
935- */
936911static void nrf_ble_scan_on_connected_evt (struct nrf_ble_scan const * const scan_ctx ,
937912 ble_gap_evt_t const * const gap_evt )
938913{
0 commit comments