@iotize/ionic
Version:
Iotize specific building blocks on top of @ionic/angular.
94 lines (93 loc) • 2.25 kB
TypeScript
import { TapNfcEvent } from '../tap-scanner/tap-scanner-nfc/tap-scanner-nfc.service';
export type ProtocolIdentifier = string;
export interface ProtocolMetaBle {
type: 'ble';
info: {
id?: string;
/**
* Mac address to connect to.
* Usefull for Android
*/
mac?: string;
/**
* With iOS we perform a ble scan to connect to the tap
* We use this name field to filter result as we don't have
* the mac address
*/
name?: string;
webBluetooth?: any;
};
}
export interface ProtocolMetaNfc {
type: 'nfc';
info: TapNfcEvent;
}
export interface ProtocolMetaSocket {
type: 'socket';
info: {
url: string;
};
}
export interface ProtocolMetaWebSocket {
type: 'websocket';
info: {
url: string;
};
}
export interface ProtocolMetaMqtt {
type: 'mqtt';
info: {
/**
* Used to build topic
*/
serialNumber: string;
/**
* Broker hostname/port
*/
endpoint: string;
/**
* Mqtt username (optional)
*/
username?: string;
password?: string;
clientId: string;
netkey?: string;
};
}
export interface ProtocolMetaIframe {
type: 'iframe';
info: {};
}
export interface ProtocolMetaWifi {
type: 'wifi';
info: {
/**
* Wifi SSID
*/
ssid: string;
/**
* Endpoint for socket connection
*/
url: string;
/**
* Wi-Fi name. Usually same as SSID
* @deprecated
*/
name?: string;
/**
* WiFi key
*/
password?: string;
/**
* WiFi algorithm
*/
algorithm?: string;
};
}
export interface ProtocolMetaWebview {
type: 'webview';
}
export interface ProtocolMetaVirtual {
type: 'virtual';
}
export type ProtocolMeta = ProtocolMetaBle | ProtocolMetaSocket | ProtocolMetaWebSocket | ProtocolMetaMqtt | ProtocolMetaNfc | ProtocolMetaIframe | ProtocolMetaWifi | ProtocolMetaWebview | ProtocolMetaVirtual;