@falconeta/capacitor-plugin-matter
v0.0.81
Published
plugin that handle the Matter Application protocol
Downloads
18
Readme
@falconeta/capacitor-plugin-matter
WORK IN PROGRESS!
plugin that handle the Matter Application protocol
Make SDK from CHIP repo
by default, plugins use standard Matter SDK (v 1.1.0.1) but if possible to make your custom SDK by connectedhomeip project (https://github.com/project-chip/connectedhomeip)
Android
- see
android_building.md
guide under /docs/guides (Building Android CHIPTool from scripts
step after preconfiguration) - compress the content of the folder
examples/android/CHIPTool/app/libs
withlibs.zip
name. - upload the zip on your google drive
- modify or create your custom
post-install.js
script with file ID and the google key
IOS
- bootstrap project
- under
src/darwin/Framework
folder launchxcodebuild -target "Matter" -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Wno-unguarded-availability-new'
- compress the folder
src/darwin/Framework/build/Release-iphoneos/Matter.framework
withMatter.framework.zip
name. - upload the zip on your google drive
- modify or create your custom
post-install.js
script with file ID and the google key
Install
npm install @falconeta/capacitor-plugin-matter
npx cap sync
API
configure(...)
clear()
qrCodeCommissioning(...)
manualCodeCommissioning(...)
getCerts()
commandOnOff(...)
getEndpoint(...)
getCluster(...)
readAttribute(...)
subscribeAttribute(...)
openCommissioningWindow(...)
removeFabric(...)
removeAllFabric(...)
addListener(string, ...)
- Interfaces
- Type Aliases
configure(...)
configure(options: { deviceControllerKey?: string; caRootCert?: string; fabricId: string; vendorId: number; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------------------- |
| options
| { deviceControllerKey?: string; caRootCert?: string; fabricId: string; vendorId: number; } |
clear()
clear() => Promise<void>
qrCodeCommissioning(...)
qrCodeCommissioning(options: { deviceId: string; qrCodeId: string; ssid: string; ssidPassword: string; }) => Promise<{ deviceType: string; }>
| Param | Type |
| ------------- | ---------------------------------------------------------------------------------------- |
| options
| { deviceId: string; qrCodeId: string; ssid: string; ssidPassword: string; } |
Returns: Promise<{ deviceType: string; }>
manualCodeCommissioning(...)
manualCodeCommissioning(options: { deviceId: string; manualCode: string; ssid: string; ssidPassword: string; }) => Promise<{ deviceType: string; }>
| Param | Type |
| ------------- | ------------------------------------------------------------------------------------------ |
| options
| { deviceId: string; manualCode: string; ssid: string; ssidPassword: string; } |
Returns: Promise<{ deviceType: string; }>
getCerts()
getCerts() => Promise<{ deviceControllerKey: string; caRootCert: string; }>
Returns: Promise<{ deviceControllerKey: string; caRootCert: string; }>
commandOnOff(...)
commandOnOff(options: { deviceId: string; value: boolean; endpointId: number; }) => Promise<void>
| Param | Type |
| ------------- | ---------------------------------------------------------------------- |
| options
| { deviceId: string; value: boolean; endpointId: number; } |
getEndpoint(...)
getEndpoint<T>(options: { deviceId: string; endpointId: number; }) => Promise<{ data: T; }>
| Param | Type |
| ------------- | ------------------------------------------------------ |
| options
| { deviceId: string; endpointId: number; } |
Returns: Promise<{ data: T; }>
getCluster(...)
getCluster<T>(options: { deviceId: string; endpointId: number; clusterId: number; }) => Promise<{ data: T; }>
| Param | Type |
| ------------- | ------------------------------------------------------------------------- |
| options
| { deviceId: string; endpointId: number; clusterId: number; } |
Returns: Promise<{ data: T; }>
readAttribute(...)
readAttribute(options: AttributePath) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------------------------------- |
| options
| AttributePath |
Returns: Promise<{ value: string; }>
subscribeAttribute(...)
subscribeAttribute(options: SubscriberOptions) => Promise<void>
| Param | Type |
| ------------- | --------------------------------------------------------------- |
| options
| SubscriberOptions |
openCommissioningWindow(...)
openCommissioningWindow(options: { deviceId: string; discriminator: number; duration: number; setupPIN: number; }) => Promise<{ manualCode: string; }>
| Param | Type |
| ------------- | --------------------------------------------------------------------------------------------- |
| options
| { deviceId: string; discriminator: number; duration: number; setupPIN: number; } |
Returns: Promise<{ manualCode: string; }>
removeFabric(...)
removeFabric(options: { deviceId: string; fabricId: string; }) => Promise<void>
| Param | Type |
| ------------- | ---------------------------------------------------- |
| options
| { deviceId: string; fabricId: string; } |
removeAllFabric(...)
removeAllFabric(options: { deviceId: string; }) => Promise<void>
| Param | Type |
| ------------- | ---------------------------------- |
| options
| { deviceId: string; } |
addListener(string, ...)
addListener<T>(eventName: string, listenerFunc: AttributeChangeListener<T>) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------ |
| eventName
| string |
| listenerFunc
| AttributeChangeListener<T> |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
AttributePath
| Prop | Type |
| ----------------- | ------------------- |
| deviceId
| string |
| endpointId
| number |
| clusterId
| number |
| attributeId
| number |
EventOptions
| Prop | Type |
| --------------- | ------------------- |
| eventName
| string |
| min
| number |
| max
| number |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |
Type Aliases
SubscriberOptions
EventOptions & AttributePath
AttributeChangeListener
(data: T): void