Skip to content

Commit

Permalink
feat: ZBOSS adapter for nRF ZBOSS NCP (#1165)
Browse files Browse the repository at this point in the history
* zboss step 1

* step 2
first parsing

* calc crc

* ... commands

* ... commands

* ... commands

* ... commands

* ... commands

* check crc and ack

* reset

* step 2

* step 3

* step 4

* reset on start

* tc policy

* step 5

* Some change parsing

* code style for lint

* getNetworkParameters

* Forming network

* active endpoints

* working pairing interview

* remove, bind, unbind

* lint fixes

* lqi

* cleanup

* fix handle empty package

* Autodetect path

* Adapt code

* fix

* prettier

* lint

* fix test

* fix coverage
  • Loading branch information
kirovilya committed Aug 27, 2024
1 parent 54421dc commit bef4655
Show file tree
Hide file tree
Showing 15 changed files with 3,214 additions and 4 deletions.
18 changes: 16 additions & 2 deletions src/adapter/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,24 @@ abstract class Adapter extends events.EventEmitter<AdapterEventMap> {
const {ZiGateAdapter} = await import('./zigate/adapter');
const {EZSPAdapter} = await import('./ezsp/adapter');
const {EmberAdapter} = await import('./ember/adapter');
type AdapterImplementation = typeof ZStackAdapter | typeof DeconzAdapter | typeof ZiGateAdapter | typeof EZSPAdapter | typeof EmberAdapter;
const {ZBOSSAdapter} = await import('./zboss/adapter');
type AdapterImplementation =
| typeof ZStackAdapter
| typeof DeconzAdapter
| typeof ZiGateAdapter
| typeof EZSPAdapter
| typeof EmberAdapter
| typeof ZBOSSAdapter;

let adapters: AdapterImplementation[];
const adapterLookup = {zstack: ZStackAdapter, deconz: DeconzAdapter, zigate: ZiGateAdapter, ezsp: EZSPAdapter, ember: EmberAdapter};
const adapterLookup = {
zstack: ZStackAdapter,
deconz: DeconzAdapter,
zigate: ZiGateAdapter,
ezsp: EZSPAdapter,
ember: EmberAdapter,
zboss: ZBOSSAdapter,
};

if (serialPortOptions.adapter && serialPortOptions.adapter !== 'auto') {
if (adapterLookup[serialPortOptions.adapter]) {
Expand Down
2 changes: 1 addition & 1 deletion src/adapter/tstype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface SerialPortOptions {
baudRate?: number;
rtscts?: boolean;
path?: string;
adapter?: 'zstack' | 'deconz' | 'zigate' | 'ezsp' | 'ember' | 'auto';
adapter?: 'zstack' | 'deconz' | 'zigate' | 'ezsp' | 'ember' | 'zboss' | 'auto';
}

interface AdapterOptions {
Expand Down
3 changes: 3 additions & 0 deletions src/adapter/zboss/adapter/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {ZBOSSAdapter} from './zbossAdapter';

export {ZBOSSAdapter};
Loading

0 comments on commit bef4655

Please sign in to comment.