BSB Developer Docs
Loading...
Searching...
No Matches
ble_incoming_nwp_event_processor.h File Reference

Spawns events on nwp callbacks and processes them in queue. More...

#include "ble_incoming_nwp_event_type_enum.h"
#include <furi.h>

Go to the source code of this file.

Typedefs

typedef struct BleIncomingNwpEventProcessor BleIncomingNwpEventProcessor
 Opaque BleIncomingNwpEventProcessor type declaration.
 

Functions

BleIncomingNwpEventProcessor * ble_incoming_nwp_event_processor_alloc (void *context)
 Allocates processor instance during ble initialization.
 
void ble_incoming_nwp_event_processor_subscribe (BleIncomingNwpEventProcessor *instance, FuriEventLoop *event_loop)
 Subscribes inner queue to event_loop.
 
void ble_incoming_nwp_event_processor_unsubscribe (BleIncomingNwpEventProcessor *instance, FuriEventLoop *event_loop)
 Unsubscribe queue from event loop on stop.
 
void ble_incoming_nwp_event_processor_spawn_event (BleIncomingNwpEventProcessor *instance, BleIncomingNwpEventType type, size_t data_size, void *data)
 Spawns event of desired type and puts it into queue for further processing.
 

Detailed Description

Spawns events on nwp callbacks and processes them in queue.

Function Documentation

◆ ble_incoming_nwp_event_processor_alloc()

BleIncomingNwpEventProcessor * ble_incoming_nwp_event_processor_alloc ( void * context)

Allocates processor instance during ble initialization.

Parameters
[in]contextcontext for future use in spawned events
Returns
pointer to event processor instance

◆ ble_incoming_nwp_event_processor_spawn_event()

void ble_incoming_nwp_event_processor_spawn_event ( BleIncomingNwpEventProcessor * instance,
BleIncomingNwpEventType type,
size_t data_size,
void * data )

Spawns event of desired type and puts it into queue for further processing.

Parameters
[in]instanceprocessor instance
[in]typeevent type from ble_incoming_nwp_event_type_enum.h
[in]data_sizesize of incoming data received from nwp
[in]datapayload received from nwp

◆ ble_incoming_nwp_event_processor_subscribe()

void ble_incoming_nwp_event_processor_subscribe ( BleIncomingNwpEventProcessor * instance,
FuriEventLoop * event_loop )

Subscribes inner queue to event_loop.

This is called when worker thread spawns and creates event_loop

Parameters
[in]instanceprocessor instance
[in]event_loopused for all events happening inside

◆ ble_incoming_nwp_event_processor_unsubscribe()

void ble_incoming_nwp_event_processor_unsubscribe ( BleIncomingNwpEventProcessor * instance,
FuriEventLoop * event_loop )

Unsubscribe queue from event loop on stop.

Parameters
[in]instanceprocessor instance
[in]event_loopwhich needs to be unsubscribed