Loading...
Searching...
No Matches
pubsub.h File Reference

FuriPubSub. More...

Go to the source code of this file.

Typedefs

typedef void(* FuriPubSubCallback) (const void *message, void *context)
 FuriPubSub Callback type.
 
typedef struct FuriPubSub FuriPubSub
 FuriPubSub type.
 

Functions

FuriPubSubfuri_pubsub_alloc (void)
 Allocate FuriPubSub.
 
void furi_pubsub_free (FuriPubSub *pubsub)
 Free FuriPubSub.
 
FuriPubSubSubscriptionfuri_pubsub_subscribe (FuriPubSub *pubsub, FuriPubSubCallback callback, void *callback_context)
 Subscribe to FuriPubSub.
 
void furi_pubsub_unsubscribe (FuriPubSub *pubsub, FuriPubSubSubscription *pubsub_subscription)
 Unsubscribe from FuriPubSub.
 
void furi_pubsub_publish (FuriPubSub *pubsub, void *message)
 Publish message to FuriPubSub.
 

Detailed Description

FuriPubSub.

Function Documentation

◆ furi_pubsub_alloc()

FuriPubSub * furi_pubsub_alloc ( void )

Allocate FuriPubSub.

Reentrable, Not threadsafe, one owner

Returns
pointer to FuriPubSub instance

◆ furi_pubsub_free()

void furi_pubsub_free ( FuriPubSub * pubsub)

Free FuriPubSub.

Parameters
pubsubFuriPubSub instance

◆ furi_pubsub_publish()

void furi_pubsub_publish ( FuriPubSub * pubsub,
void * message )

Publish message to FuriPubSub.

Threadsafe, Reentrable.

Parameters
pubsubpointer to FuriPubSub instance
messagemessage pointer to publish

◆ furi_pubsub_subscribe()

FuriPubSubSubscription * furi_pubsub_subscribe ( FuriPubSub * pubsub,
FuriPubSubCallback callback,
void * callback_context )

Subscribe to FuriPubSub.

Threadsafe, Reentrable

Parameters
pubsubpointer to FuriPubSub instance
[in]callbackThe callback
callback_contextThe callback context
Returns
pointer to FuriPubSubSubscription instance

◆ furi_pubsub_unsubscribe()

void furi_pubsub_unsubscribe ( FuriPubSub * pubsub,
FuriPubSubSubscription * pubsub_subscription )

Unsubscribe from FuriPubSub.

No use of pubsub_subscription allowed after call of this method Threadsafe, Reentrable.

Parameters
pubsubpointer to FuriPubSub instance
pubsub_subscriptionpointer to FuriPubSubSubscription instance