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

API for Matter service on u5. More...

#include "matter_common.h"
#include <time.h>
#include <core/string.h>
#include <core/pubsub.h>
#include <core/state.h>

Go to the source code of this file.

Data Structures

struct  MatterCommissioningEvent
 Event of type MatterEventTypeCommissioning More...
 
struct  MatterEvent
 Complete service event. More...
 
struct  MatterCommissionedFabrics
 Commissioning information struct. More...
 
struct  MatterCertificationConfig
 Structure describing certification declaration settings. More...
 

Macros

#define RECORD_MATTER   "matter"
 

Typedefs

typedef struct Matter Matter
 

Enumerations

enum  MatterEventType { MatterEventTypeCommissioning , MatterEventTypeFabricCountChanged , MatterEventTypeWillReboot }
 Type of service event.
 
enum  MatterCertificationType { MatterCertificationTypeProduction , MatterCertificationTypeDevelopment , MatterCertificationTypeProvisional , MatterCertificationTypeMax }
 Enumeration of available certification types. More...
 
enum  MatterReboot { MatterRebootAutomatically , MatterRebootManually }
 

Functions

FuriPubSub * matter_get_pubsub (Matter *instance)
 Get a PubSub to listen to Matter events.
 
FuriState * matter_get_switch_state (Matter *instance)
 Get the switch state object that supports change notifications.
 
MatterStatus matter_set_switch_state (Matter *instance, MatterSwitchState switch_state)
 Set the state of the Matter switch.
 
MatterStatus matter_set_switch_startup_mode (Matter *instance, MatterSwitchStartupMode mode)
 Set the startup mode of the Matter switch.
 
MatterStatus matter_enable_commissioning (Matter *instance, MatterCommissioningInfo *info)
 Enable Matter commissioning (open the commissioning window).
 
MatterStatus matter_get_commissioned_fabrics (Matter *instance, MatterCommissionedFabrics *fabrics)
 Get the brief information about the commissioning status.
 
MatterStatus matter_factory_reset (Matter *instance, MatterReboot reboot)
 Delete all Matter pairing data, then reboot on success.
 
MatterStatus matter_set_certification_config (Matter *instance, MatterCertificationType cert_type)
 Set the preferred certification config.
 
MatterStatus matter_get_certification_config (Matter *instance, MatterCertificationConfig *cert_config)
 Get the certification configuration, including preferred and actual configs.
 

Detailed Description

API for Matter service on u5.

Enumeration Type Documentation

◆ MatterCertificationType

Enumeration of available certification types.

Warning
The order of the elements denotes the fallback order. Do NOT change it unless necessary.
Enumerator
MatterCertificationTypeProduction 

Certification declaration for production devices.

MatterCertificationTypeDevelopment 

Certification declaration for development.

MatterCertificationTypeProvisional 

Certification declaration for lab testing.

MatterCertificationTypeMax 

Special value, invalid or internal use.

Function Documentation

◆ matter_enable_commissioning()

MatterStatus matter_enable_commissioning ( Matter * instance,
MatterCommissioningInfo * info )

Enable Matter commissioning (open the commissioning window).

Parameters
[in,out]instancepointer to the service instance
[out]infopointer to the object to contain the information about the current commissioning window
Returns
MatterStatusOk on success, any other value from MatterStatus enum on error

◆ matter_factory_reset()

MatterStatus matter_factory_reset ( Matter * instance,
MatterReboot reboot )

Delete all Matter pairing data, then reboot on success.

Parameters
[in,out]instancepointer to the service instance
[in]rebootreboot mode, see MatterReboot enum
Returns
MatterStatus enum on error. MatterStatusOk is never returned.

◆ matter_get_certification_config()

MatterStatus matter_get_certification_config ( Matter * instance,
MatterCertificationConfig * cert_config )

Get the certification configuration, including preferred and actual configs.

Parameters
[in,out]instancepointer to the service instance
[out]cert_configpointer to the object to contain the config (must be allocated)
Returns
MatterStatusOk on success, any other value from MatterStatus enum on error

◆ matter_get_commissioned_fabrics()

MatterStatus matter_get_commissioned_fabrics ( Matter * instance,
MatterCommissionedFabrics * fabrics )

Get the brief information about the commissioning status.

Parameters
[in,out]instancepointer to the service instance
[out]fabricspointer to the object to contain the information about commissioned fabrics
Returns
MatterStatusOk on success, any other value from MatterStatus enum on error

◆ matter_get_pubsub()

FuriPubSub * matter_get_pubsub ( Matter * instance)

Get a PubSub to listen to Matter events.

The returned FuriPubSub object will have an underlying type of MatterEvent. Use furi_pubsub_subscribe() to get notifications about new events.

Parameters
[in,out]instancepointer to the service instance
Returns
pointer to a FuriPubSub object

◆ matter_get_switch_state()

FuriState * matter_get_switch_state ( Matter * instance)

Get the switch state object that supports change notifications.

The returned FuriState object will have an underlying type of MatterSwitchState. Use furi_state_subscribe() to get notifications about changes in the current switch state.

This function never blocks.

Parameters
[in,out]instancepointer to the service instance
Returns
pointer to a FuriState object

◆ matter_set_certification_config()

MatterStatus matter_set_certification_config ( Matter * instance,
MatterCertificationType cert_type )

Set the preferred certification config.

Warning
Changes will only apply after a reboot
Parameters
[in,out]instancepointer to the service instance
[in]cert_typevalue corresponding to the preferred certification type
Returns
MatterStatusOk on success, any other value from MatterStatus enum on error

◆ matter_set_switch_startup_mode()

MatterStatus matter_set_switch_startup_mode ( Matter * instance,
MatterSwitchStartupMode mode )

Set the startup mode of the Matter switch.

Parameters
[in,out]instancepointer to the service instance
[in]moderequired Matter switch startup mode
Returns
MatterStatusOk on success, any other value from MatterStatus enum on error

◆ matter_set_switch_state()

MatterStatus matter_set_switch_state ( Matter * instance,
MatterSwitchState switch_state )

Set the state of the Matter switch.

Note
Passing MatterSwitchStateUnknown as switch_state does nothing.
Parameters
[in,out]instancepointer to the service instance
[in]switch_staterequired Matter switch state
Returns
MatterStatusOk on success, any other value from MatterStatus enum on error