File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed 
subsys/bluetooth/controller Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ static void read_bd_addr(struct net_buf *buf, struct net_buf **evt)
273273	rp  =  cmd_complete (evt , sizeof (* rp ));
274274
275275	rp -> status  =  0x00 ;
276- 	ll_address_get (0 , & rp -> bdaddr .val [0 ]);
276+ 	ll_addr_get (0 , & rp -> bdaddr .val [0 ]);
277277}
278278
279279static  int  info_cmd_handle (u8_t  ocf , struct  net_buf  * cmd ,
@@ -345,7 +345,7 @@ static void le_set_random_address(struct net_buf *buf, struct net_buf **evt)
345345	struct  bt_hci_cp_le_set_random_address  * cmd  =  (void  * )buf -> data ;
346346	struct  bt_hci_evt_cc_status  * ccst ;
347347
348- 	ll_address_set (1 , & cmd -> bdaddr .val [0 ]);
348+ 	ll_addr_set (1 , & cmd -> bdaddr .val [0 ]);
349349
350350	ccst  =  cmd_complete (evt , sizeof (* ccst ));
351351	ccst -> status  =  0x00 ;
Original file line number Diff line number Diff line change 1010
1111int  ll_init (struct  k_sem  * sem_rx );
1212void  ll_reset (void );
13- void   ll_address_get (u8_t  addr_type , u8_t  * p_bdaddr );
14- void  ll_address_set (u8_t  addr_type , u8_t  const  * const  p_bdaddr );
13+ u8_t   * ll_addr_get (u8_t  addr_type , u8_t  * p_bdaddr );
14+ void  ll_addr_set (u8_t  addr_type , u8_t  const  * const  p_bdaddr );
1515void  ll_adv_params_set (u16_t  interval , u8_t  adv_type ,
1616		       u8_t  own_addr_type , u8_t  direct_addr_type ,
1717		       u8_t  const  * const  p_direct_addr , u8_t  chl_map ,
Original file line number Diff line number Diff line change @@ -246,21 +246,29 @@ int ll_init(struct k_sem *sem_rx)
246246	return  0 ;
247247}
248248
249- void   ll_address_get (u8_t  addr_type , u8_t  * bdaddr )
249+ u8_t   * ll_addr_get (u8_t  addr_type , u8_t  * bdaddr )
250250{
251251	if  (addr_type ) {
252- 		memcpy (bdaddr , & _ll_context .rnd_addr [0 ], BDADDR_SIZE );
253- 	} else  {
254- 		memcpy (bdaddr , & _ll_context .pub_addr [0 ], BDADDR_SIZE );
252+ 		if  (bdaddr ) {
253+ 			memcpy (bdaddr , _ll_context .rnd_addr , BDADDR_SIZE );
254+ 		}
255+ 
256+ 		return  _ll_context .rnd_addr ;
255257	}
258+ 
259+ 	if  (bdaddr ) {
260+ 		memcpy (bdaddr , _ll_context .pub_addr , BDADDR_SIZE );
261+ 	}
262+ 
263+ 	return  _ll_context .pub_addr ;
256264}
257265
258- void  ll_address_set (u8_t  addr_type , u8_t  const  * const  bdaddr )
266+ void  ll_addr_set (u8_t  addr_type , u8_t  const  * const  bdaddr )
259267{
260268	if  (addr_type ) {
261- 		memcpy (& _ll_context .rnd_addr [ 0 ] , bdaddr , BDADDR_SIZE );
269+ 		memcpy (_ll_context .rnd_addr , bdaddr , BDADDR_SIZE );
262270	} else  {
263- 		memcpy (& _ll_context .pub_addr [ 0 ] , bdaddr , BDADDR_SIZE );
271+ 		memcpy (_ll_context .pub_addr , bdaddr , BDADDR_SIZE );
264272	}
265273}
266274
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments