Skip to content

falconeta/capacitor-matter

Repository files navigation

@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

  1. see android_building.md guide under /docs/guides (Building Android CHIPTool from scripts step after preconfiguration)
  2. compress the content of the folder examples/android/CHIPTool/app/libs with libs.zip name.
  3. upload the zip on your google drive
  4. modify or create your custom post-install.js script with file ID and the google key

IOS

  1. bootstrap project
  2. under src/darwin/Framework folder launch xcodebuild -target "Matter" -sdk iphoneos -configuration Release OTHER_CFLAGS='${inherited} -Wno-unguarded-availability-new'
  3. compress the folder src/darwin/Framework/build/Release-iphoneos/Matter.framework with Matter.framework.zip name.
  4. upload the zip on your google drive
  5. 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(...)

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published