This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

S120 softdevice, ble_app_hrs_c how to exit from scan_start() to main

main.cI'm using S120 softdevice with nrf51822, I want to use S120 as central and peripheral devices. When I received my beacon data then switch to peripheral for advertise. When I got received beacon data from on_ble_evt then want to exit to main then run advertise. How to exit from scan_start() to main? I suceed to run central and peripheral device using S120 separately.

Parents
  • I have modified examples "ble_app_hrs_c_s130_pca10028" and add code for advertise and test it. I added advertise command to scan_start() and it works fine but one problem is that after advertise, it's system_reset and send one character only to UART port. is there any missing command? I don't know how to attach code here so I put my added code here.

    Added code in scan_start();

        err_code = sd_ble_gap_scan_start(&m_scan_param);
        APP_ERROR_CHECK(err_code);
    
    //yoo added to check return
    		if(beacon_ready==1)
    		{
    			//yoo
    			//start ch='-', 0x2D
    			printf("-");
    			for(uint8_t i=0;i<32;i++)
    			{
    				printf("%c",beacon_buffer[i]);
    			}
    			printf("\r");	// end ch=0x0D
    			beacon_ready=0;
    
    			
    //yoo added here for Beacon Transmit once
        advertising_init();
        // Start execution.
        advertising_start();
    //yoo end
    
Reply
  • I have modified examples "ble_app_hrs_c_s130_pca10028" and add code for advertise and test it. I added advertise command to scan_start() and it works fine but one problem is that after advertise, it's system_reset and send one character only to UART port. is there any missing command? I don't know how to attach code here so I put my added code here.

    Added code in scan_start();

        err_code = sd_ble_gap_scan_start(&m_scan_param);
        APP_ERROR_CHECK(err_code);
    
    //yoo added to check return
    		if(beacon_ready==1)
    		{
    			//yoo
    			//start ch='-', 0x2D
    			printf("-");
    			for(uint8_t i=0;i<32;i++)
    			{
    				printf("%c",beacon_buffer[i]);
    			}
    			printf("\r");	// end ch=0x0D
    			beacon_ready=0;
    
    			
    //yoo added here for Beacon Transmit once
        advertising_init();
        // Start execution.
        advertising_start();
    //yoo end
    
Children
No Data
Related