This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf 5340 for Bluetooth low energy

Hi!

This tutorial is just for current Measuring current. I want the same for latency with code. 

I'm working with two nrf5340 for Bluetooth low energy and I want to measure latency value between those cards using oscilloscope. Is there any sample code that I can use to send data  and receive it in the other cord. I want to allow  one bin in the first nrf5340 to write data and a bin in the other nrf5340 to read this data. 

2. I also want to measure RSSI. Is is possible to do that using the same method. I mean that I want to measure RSSI when the two cards are connected to each other.

Best regards  

Parents Reply
  • I print device_info like you say and I get ø@. I try to understand the cod but in scan_filter_match()  there is no arguments that contain rssi value so what i should do. Pleas help me to print rssi value.

    I find out this struct that have rssi so how can I print it if it is right to use.

    struct bt_scan_adv_info {
    	/** Bluetooth LE advertising type. According to
    	 *  Bluetooth Specification 7.8.5
    	 */
    	uint8_t adv_type;
    
    	/** Received Signal Strength Indication in dBm. */
    	int8_t rssi;
    };

Children
  • Try this

    static void scan_filter_match(struct bt_scan_device_info *device_info,
    			      struct bt_scan_filter_match *filter_match,
    			      bool connectable)
    {
    	char addr[BT_ADDR_LE_STR_LEN];
    
    	bt_addr_le_to_str(device_info->recv_info->addr, addr, sizeof(addr));
    LOG_INF("Filters matched. RSSI: %d, Address: %s connectable: %d",device_info->recv_info->rssi,
    		log_strdup(addr), connectable);
    	
    }

    The log will be printed in RTT. 

Related