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

What is an Application Event?

I am searching for a straight answer to this question. 'Application event' is used frequently in the documentation but never defined. I write the application but I clearly do not define these events. Initially I assumed they were events I defined and I could use them with sd_app_evt_wait(). Alas that is not the case.

So what is an application event?

All events received by my application?

If I know what an application event actually is, then I might be able to use sd_app_evt_wait(). If SoftDevice events (such as all the Bluetooth GAP and GATT events) are 'application events', I might be able to use sd_app_evt_wait() to support semaphore-like behavior that I really need.

Someone please tell me what 'application events' are and give some examples! It would also be helpful to tell me what events received by my application from SoftDevice are NOT 'application events'.

I guess while your at it, can you tell me what application interrupts are? These sound more like interrupts I define unlike application events.

  • Hello Brian,

    I have been out of office for some days, thank you for your patience.

    brianreinhold said:
    I also do most of my design work using the pc-ble-driver as it is obviously easier to create new designs on a PC than any embedded platform. That makes portability of that test code to any on-device implementation quite easy.
    brianreinhold said:
    Lastly, we are working on a new health device standard that is generic. Clearly there is no support for such a standard on any platform. One of the guiding principles here is that it be a simple as possible with minimum Bluetooth knowledge needed. I want to make it as easy as possible to develop using the fewest and most basic GATT GAP operations possible.

    Thank you for elaborating - I definitely understand what you mean about the SDK's changing more dramatically then the SoftDevice API's, and I suppose that if you aspire to always keep the SDK up to date with the latest version, this is a better way of doing it - especially since you are able to implement all the functionality you are after, using this way.

    brianreinhold said:
    this is flash on an embedded system! When is that ever completely simple?

    I wholeheartedly concur! I am also glad to hear that you have found an approach that achieves your intended functionality, in an easy way. 

    brianreinhold said:
    Okay, I have grown fond of SoftDevice. I can understand what it does because I have a good understanding of BTLE at the GATT/GAP level. When I need something, I have a good idea what to look for.

    I am happy to hear that, brianreinhold! Then you have already gotten to 'the sweet spot' of BLE development, in my opinion! Good knowledge of the protocol - and SoftDevice implementation of it - significantly speeds up the development, and makes the whole process significantly easier.

    Please do not hesitate to open a new ticket if you should encounter any issues or questions in the future.

    Good luck with your development!

    Best regards,
    Karl

  • Only thing missing is finding the start of free flash programmatically. I'll work on that issue later.

  • To accomplish this without using the app_util.h file from the SKD, I suppose you could just take out the relevant parts of the file, to be used in your application.
    For example, take a look at the following code from the app_util.h file.

    #elif defined(__SES_ARM)
    extern uint32_t * _vectors;
    extern uint32_t __FLASH_segment_used_end__;
    #define CODE_START ((uint32_t)&_vectors)
    #define CODE_END   ((uint32_t)&__FLASH_segment_used_end__)
    #define CODE_SIZE  (CODE_END - CODE_START)


    You could then have your application calculate where the first free page is located by subtracting the application and SoftDevice size from the available flash.
    Keep in mind that if you at any point add a DFU bootloader or similar at the top of the memory, you will need to account for this yourself, in your application logic.

    Best regards,
    Karl

Related