Connection
Extends:
Static Method Summary
Static Public Methods | ||
public static |
getBLELibrary(): BLE 현재 사용중인 Ble 라이브러리를 반환한다. |
|
public static |
getTimeout(): number 기기 연결시 미 응답에 대한 Timeout 값을 반환한다.(단위 : ms) |
|
public static |
setBLELibrary(coreBle: BLE) 기기 연결에 사용할 라이브러리를 설정한다. |
|
public static |
setTimeout(timeout: number) 기기 연결시 미 응답에 대한 Timeout 값을 설정한다.(단위 : ms) |
Constructor Summary
Public Constructor | ||
public |
constructor(device: Device, password: string) 전달받은 기기와 패스워드로 새로운 커넥션을 초기화한다. |
Member Summary
Public Members | ||
public |
기기 타입 |
|
public |
커넥션 할 기기 |
|
public |
연결 상태 |
|
public |
|
Method Summary
Public Methods | ||
public |
changeAdvertisingInterval(interval: number): function(device: Device, data: Object): Device, data (Async)비콘의 Advertising 주기를 변경한다.(1byte) 단위는 100ms로 1~102의 값을 입력 가능하다. |
|
public |
changeBuildThingCloudMode(usage: *): * |
|
public |
changeCertificationType(value: *): * |
|
public |
changeHttpGETUrl(url: *): * |
|
public |
changeHttpUrl(type: *, url: *): * |
|
public |
changeIOOutput(moduleType: number, value: Array): function(device: Device, data: Object): Device, data (Async)비콘의 IO Module의 Output 값을 변경한다.(2byte) |
|
public |
changeInstanceID(instanceId: string): function(device: Device, data: Object): Device, data (Async)Eddystone-UID 비콘 모드의 Instance ID 값을 변경한다.(6byte) |
|
public |
changeMajor(major: number): function(device: Device, data: Object): Device, data (Async)비콘의 Major 값을 변경한다.(2byte) 0~65535의 값을 입력 가능하다. |
|
public |
changeMinor(minor: number): function(device: Device, data: Object): Device, data (Async)비콘의 Minor 값을 변경한다.(2byte) 0~65535의 값을 입력 가능하다. |
|
public |
changeMode(mode: number): function(device: Device, data: Object): Device, data (Async)비콘 모드를 변경한다. |
|
public |
changeMqttBrokerId(id: *): * |
|
public |
changeMqttBrokerPassword(password: *): * |
|
public |
changeMqttBrokerSubscribeTopic(url: *): * |
|
public |
changeMqttBrokerTopic(type: *, topic: *): * |
|
public |
changeName(name: string): function(device: Device, data: Object): Device, data (Async)기기 이름을 변경한다.(8byte) 비콘 - 새로운 이름은 8바이트 이하로 입력한다. |
|
public |
changeNameSpaceID(namespaceId: string): function(device: Device, data: Object): Device, data (Async)Eddystone-UID 비콘 모드의 Namespace ID 값을 변경한다.(10byte) |
|
public |
changeNetworkPeriod(period: number): function(device: Device, data: Object): Device, data (Async)게이트웨이의 네트워크 통신 주기를 변경한다.(2byte) 1 ~ 1440의 값을 입력 가능하다. |
|
public |
changePassword(password: string): function(device: Device, data: Object): Device, data (Async)기기 연결 패스워드를 변경한다.(6byte) 반드시 6자리로 입력해야 한다. |
|
public |
changeProtocolType(protocolType: number): function(device: Device, data: Object): Device, data (Async)게이트웨이의 프로토콜 타입을 변경한다.(1byte) 0 : MQTT 1 : HTTP 2 : HTTPS |
|
public |
changeScanTime(scanType: number): function(device: Device, data: Object): Device, data (Async)게이트웨이의 스캔 시간을 변경한다.(1byte) |
|
public |
changeScanType(scanType: number): function(device: Device, data: Object): Device, data (Async)게이트웨이의 스캔 타입을 변경한다.(1byte) 0 : Beacon 1 : IAQ 2 : Jack Support 3 : OtherBeacon |
|
public |
changeSchemePrefix(scheme: string): function(device: Device, data: Object): Device, data (Async)Eddystone-URL 비콘 모드의 Scheme Prefix 값을 변경한다.(2byte) |
|
public |
changeSensorInterval(interval: number): function(device: Device, data: Object): Device, data (Async)비콘의 센서 갱신 주기를 변경한다.(1byte) 2~255의 값을 입력 가능하다. |
|
public |
changeServerId(id: *): * |
|
public |
changeServerIp(ipAddress: *): * |
|
public |
changeServerPassword(password: *): * |
|
public |
changeServerPort(port: *): * |
|
public |
changeTemperatureUnit(unit: *): * |
|
public |
changeTlsCert(cert: *): * |
|
public |
changeToken(token: *): * |
|
public |
changeTxPower(txPower: number): function(device: Device, data: Object): Device, data (Async)비콘의 Tx Power 값을 변경한다.(1byte) 1 : -20dBm 2 : -16dBm 3 : -12dBm 4 : -8dBm 5 : -4dBm 6 : 0dBm 7 : 4dBm |
|
public |
(Async)Eddystone-URL 비콘 모드의 URL 값을 변경한다.(17byte) |
|
public |
changeUseLongRange(usage: *): * |
|
public |
changeWifiPassword(password: *): * |
|
public |
changeWifiSsid(ssid: *): * |
|
public |
connect(isIgnoreGetCurrentWifiSSID: *) 기기에 커넥션을 시도한다. |
|
public |
기기에 커넥션을 해제한다. |
|
public |
현재 기기의 연결 상태를 반환한다. |
|
public |
isValidPassword(password: string): function(device: Device, data: Object): Device, data (Async)기기 연결 패스워드를 확인한다. |
|
public |
기기의 특정 Characteristic Service에서 값을 읽는 함수 |
|
public |
|
|
public |
readCurrentWifi(): * |
|
public |
readGatewayInfo(): * |
|
public |
readHttpGETUrl(): * |
|
public |
readHttpUrl(type: *): * |
|
public |
readMqttBrokerId(): * |
|
public |
|
|
public |
readMqttBrokerTopic(type: *): * |
|
public |
readServerId(): * |
|
public |
readServerIp(): * |
|
public |
readServerPort(): * |
|
public |
readWifiSsid(): * |
|
public |
rebootBeacon(): function(device: Device, data: Object): Device, data (Async)비콘을 Reboot 한다. |
|
public |
requestWifiConnect(): * |
|
public |
setPassword(password: string) 커넥션시 사용할 패스워드를 설정한다. |
|
public |
타입별로 커넥션 시 발생하는 콜백을 연결한다. |
|
public |
wrapRWCallback(characteristics: Characteristic[]) 커넥션 후 read, write, notify, stopNotify 콜백을 등록한다. |
|
public |
현재 연결된 기기의 Write Characteristic을 통해 데이터를 입력한다. |
Inherited Summary
From class EventEmitter | ||
public |
등록된 이벤트 Set 을 저장 할 객체 |
|
public |
이벤트를 발생시켜 해당 이벤트에 등록된 이벤트 콜백 함수를 호출 하는 함수 |
|
public |
전달받은 이벤트 명 과 이벤트 콜백함수 통해서 이벤트 Set 에서 이벤트 콜백 함수를 제거하는 함수 |
|
public |
전달받은 이벤트 명으로, 전달받은 이벤트 콜백 함수를 등록하는 함수 |
|
public |
이벤트가 발생한 경우 한번만 호출되는 이벤트 콜백 함수를 등록 하는 함수 |
Static Public Methods
Public Constructors
Public Members
Public Methods
public changeAdvertisingInterval(interval: number): function(device: Device, data: Object): Device, data source
(Async)비콘의 Advertising 주기를 변경한다.(1byte) 단위는 100ms로 1~102의 값을 입력 가능하다. 최솟값보다 작은 값을 입력할 경우 1, 최댓값보다 큰 값을 입력할 경우 102로 적용된다.
Params:
Name | Type | Attribute | Description |
interval | number | 변경할 Advertising 주기(100ms) |
public changeBuildThingCloudMode(usage: *): * source
Params:
Name | Type | Attribute | Description |
usage | * |
Return:
* |
public changeCertificationType(value: *): * source
Params:
Name | Type | Attribute | Description |
value | * |
Return:
* |
public changeHttpUrl(type: *, url: *): * source
Params:
Name | Type | Attribute | Description |
type | * | ||
url | * |
Return:
* |
public changeIOOutput(moduleType: number, value: Array): function(device: Device, data: Object): Device, data source
(Async)비콘의 IO Module의 Output 값을 변경한다.(2byte)
public changeInstanceID(instanceId: string): function(device: Device, data: Object): Device, data source
(Async)Eddystone-UID 비콘 모드의 Instance ID 값을 변경한다.(6byte)
Params:
Name | Type | Attribute | Description |
instanceId | string | 변경할 Eddystone-UID 비콘 모드의 instanceId값 |
public changeMajor(major: number): function(device: Device, data: Object): Device, data source
(Async)비콘의 Major 값을 변경한다.(2byte) 0~65535의 값을 입력 가능하다.
Params:
Name | Type | Attribute | Description |
major | number | 변경할 비콘의 major값 |
public changeMinor(minor: number): function(device: Device, data: Object): Device, data source
(Async)비콘의 Minor 값을 변경한다.(2byte) 0~65535의 값을 입력 가능하다.
Params:
Name | Type | Attribute | Description |
minor | number | 변경할 비콘의 minor값 |
public changeMode(mode: number): function(device: Device, data: Object): Device, data source
(Async)비콘 모드를 변경한다. 센서를 부착중인 경우 센서 제거시 변경된 모드로 표시된다.(1byte) 0 : BuildThing 1 : iBeacon 2 : Eddystone-UID 3 : Eddystone-URL 4 : Eddystone-TLM
Params:
Name | Type | Attribute | Description |
mode | number | 비콘의 새로운 모드 |
public changeMqttBrokerPassword(password: *): * source
Params:
Name | Type | Attribute | Description |
password | * |
Return:
* |
public changeMqttBrokerSubscribeTopic(url: *): * source
Params:
Name | Type | Attribute | Description |
url | * |
Return:
* |
public changeMqttBrokerTopic(type: *, topic: *): * source
Params:
Name | Type | Attribute | Description |
type | * | ||
topic | * |
Return:
* |
public changeName(name: string): function(device: Device, data: Object): Device, data source
(Async)기기 이름을 변경한다.(8byte) 비콘 - 새로운 이름은 8바이트 이하로 입력한다. 9바이트 이상 입력할 경우 9번째 이후의 바이트는 무시된다. 게이트웨이 - 새로운 이름은 10바이트 이하로 입력한다. 11바이트 이상 입력할 경우 11번째 이후의 바이트는 무시된다. 공통 - 31바이트 초과시 NO 응답
Params:
Name | Type | Attribute | Description |
name | string | 기기의 새로운 이름 |
public changeNameSpaceID(namespaceId: string): function(device: Device, data: Object): Device, data source
(Async)Eddystone-UID 비콘 모드의 Namespace ID 값을 변경한다.(10byte)
Params:
Name | Type | Attribute | Description |
namespaceId | string | 변경할 Eddystone-UID 비콘 모드의 namespaceId값 |
public changeNetworkPeriod(period: number): function(device: Device, data: Object): Device, data source
(Async)게이트웨이의 네트워크 통신 주기를 변경한다.(2byte) 1 ~ 1440의 값을 입력 가능하다.
Params:
Name | Type | Attribute | Description |
period | number | 변경할 네트워크 통신 주기(100ms) |
public changePassword(password: string): function(device: Device, data: Object): Device, data source
(Async)기기 연결 패스워드를 변경한다.(6byte) 반드시 6자리로 입력해야 한다. 다를 경우 NO 응답
Params:
Name | Type | Attribute | Description |
password | string | 변경할 패스워드 |
public changeProtocolType(protocolType: number): function(device: Device, data: Object): Device, data source
(Async)게이트웨이의 프로토콜 타입을 변경한다.(1byte) 0 : MQTT 1 : HTTP 2 : HTTPS
Params:
Name | Type | Attribute | Description |
protocolType | number | 변경할 게이트웨이의 protocolType index값 |
public changeScanTime(scanType: number): function(device: Device, data: Object): Device, data source
(Async)게이트웨이의 스캔 시간을 변경한다.(1byte)
Params:
Name | Type | Attribute | Description |
scanType | number | 변경할 게이트웨이의 scanType index값 |
public changeScanType(scanType: number): function(device: Device, data: Object): Device, data source
(Async)게이트웨이의 스캔 타입을 변경한다.(1byte) 0 : Beacon 1 : IAQ 2 : Jack Support 3 : OtherBeacon
Params:
Name | Type | Attribute | Description |
scanType | number | 변경할 게이트웨이의 scanType index값 |
public changeSchemePrefix(scheme: string): function(device: Device, data: Object): Device, data source
(Async)Eddystone-URL 비콘 모드의 Scheme Prefix 값을 변경한다.(2byte)
Params:
Name | Type | Attribute | Description |
scheme | string | 변경할 Eddystone-URL 비콘 모드의 scheme값 |
public changeSensorInterval(interval: number): function(device: Device, data: Object): Device, data source
(Async)비콘의 센서 갱신 주기를 변경한다.(1byte) 2~255의 값을 입력 가능하다. Advertising 주기의 배수로 적용을 권장한다.
Params:
Name | Type | Attribute | Description |
interval | number | 변경할 센서 갱신 주기(100ms) |
public changeServerIp(ipAddress: *): * source
Params:
Name | Type | Attribute | Description |
ipAddress | * |
Return:
* |
public changeServerPassword(password: *): * source
Params:
Name | Type | Attribute | Description |
password | * |
Return:
* |
public changeTemperatureUnit(unit: *): * source
Params:
Name | Type | Attribute | Description |
unit | * |
Return:
* |
public changeTxPower(txPower: number): function(device: Device, data: Object): Device, data source
(Async)비콘의 Tx Power 값을 변경한다.(1byte) 1 : -20dBm 2 : -16dBm 3 : -12dBm 4 : -8dBm 5 : -4dBm 6 : 0dBm 7 : 4dBm
Params:
Name | Type | Attribute | Description |
txPower | number | 변경할 비콘의 txPower index값 |
public changeUrl(url: string): function(device: Device, data: Object): Device, data source
(Async)Eddystone-URL 비콘 모드의 URL 값을 변경한다.(17byte)
Params:
Name | Type | Attribute | Description |
url | string | 변경할 Eddystone-URL 비콘 모드의 url값 |
public changeUseLongRange(usage: *): * source
Params:
Name | Type | Attribute | Description |
usage | * |
Return:
* |
public changeWifiPassword(password: *): * source
Params:
Name | Type | Attribute | Description |
password | * |
Return:
* |
public connect(isIgnoreGetCurrentWifiSSID: *) source
기기에 커넥션을 시도한다.
Params:
Name | Type | Attribute | Description |
isIgnoreGetCurrentWifiSSID | * |
Emit:
커넥션 성공시 콜백 |
Example:
var connection = new Connection(device)
connection.on('connect', (...args) => {
console.log('connected!')
})
connection.connect()
public disconnect() source
기기에 커넥션을 해제한다.
Example:
connection.on('disconnect', (...args) => {
console.log('disconnected!')
})
connection.disconnect()
public isValidPassword(password: string): function(device: Device, data: Object): Device, data source
(Async)기기 연결 패스워드를 확인한다.
Params:
Name | Type | Attribute | Description |
password | string | 확인할 패스워드 |
public read(characteristicUUID: string) source
기기의 특정 Characteristic Service에서 값을 읽는 함수
Params:
Name | Type | Attribute | Description |
characteristicUUID | string | 데이터를 읽어올 Characteristic Service UUID |
public rebootBeacon(): function(device: Device, data: Object): Device, data source
(Async)비콘을 Reboot 한다.
public setPassword(password: string) source
커넥션시 사용할 패스워드를 설정한다.
Params:
Name | Type | Attribute | Description |
password | string | 변경 할 패스워드 |
public wrapConnectionCallback() source
타입별로 커넥션 시 발생하는 콜백을 연결한다. 현재는 Cordova만 연결, Noble은 Peripheral에서 커넥션 콜백을 직접 관리한다.
public wrapRWCallback(characteristics: Characteristic[]) source
커넥션 후 read, write, notify, stopNotify 콜백을 등록한다. 현재는 Cordova에서만 콜백을 등록한다.
Params:
Name | Type | Attribute | Description |
characteristics | Characteristic[] | 콜백을 등록할 기기의 Characteristic 객체 |