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.

  • What do you mean how to exit scan_start() function? Where is it hanging? What example and SDK you use? And most importantly why you don't switch to S130 which is supported in all examples in nRF5 SDK v12.3.0 including such GAP Peripheral + Central? Your question about some jumping indicates that you don't follow basic BLE FW structure for nRF5x platform with Nordic BLE stacks (Soft Device of any flavor) which is pretty much event driven and you shouldn't have anything to do in main function beside some init functions and then waiting for events and interrupts which should be handled in specific handler functions...

  • I'm using nRF51822 QFAAG0 chips and using S110 and S120 about 2years so convert to S130 is a hard job. There are so many my own code added in S120 example and I have look into S130 examples, it's difficult to me where I get all data from S130 sample codes.

  • Well your comment about jumping from one function to main where normally this is non-blocking call (so no need to jump anywhere, the function should exit basically immediately from wherever you call it) and normally nothing should really be done in main after initialization (but rather in event and interrupt handlers) indicates possibly deeper architectural problems where maybe porting/starting from scratch with good S130 examples is the way forward... but indeed it's your call. In every case from your poor description there is hardly anything to suggest;)

  • @Mike please try to answer the questions in endnode's first comment. It is a bit difficult to understand what the problem is. Remember that you can edit your question and add more information, and maybe some code?

  • my project is like this. my device is first running scanning mode to scan my beacons, when the device detect a beacon, transmit beacon's RSSI, peer address and UUID to UART port. Then modify major and minor ID then advertise packet then return to scan mode again. my question, when I use S130 softdevice. recommand proper example code.

    • how and where can I get received beacon's RSSI, peer address and UUID?
    • how can I switch scan mode to advertise mode then return to scan mode?
    • can you make me sample code for me? I'm currently using uVision V4.54 and nRF51_SDK_9.0.0 I have PCA10000 and PCA10001 samples
Related