Comparing version 0.3.6 to 0.3.7
/// <reference types="node" /> | ||
import { SrpClient } from "fast-srp-hap"; | ||
import { ParsedUrlQuery } from "querystring"; | ||
import { EventEmitter } from "./lib/EventEmitter"; | ||
import { HAPBonjourBrowser, HAPDeviceInfo } from "./lib/HAPBonjourBrowser"; | ||
import { HTTPResponse, HTTPRoutes } from "./lib/http-protocol"; | ||
import { ClientInfo } from "./storage/ClientInfo"; | ||
import { EventEmitter } from "./lib/EventEmitter"; | ||
import { CharacteristicEventRequest, CharacteristicReadRequest, CharacteristicWriteRequest, HAPEncryptionContext } from "./types/hap-proxy"; | ||
import { ParsedUrlQuery } from "querystring"; | ||
import { HAPBonjourBrowser, HAPDeviceInfo } from "./lib/HAPBonjourBrowser"; | ||
import { SrpClient } from "fast-srp-hap"; | ||
export declare type PinProvider = (callback: (pinCode: string) => void) => void; | ||
@@ -10,0 +10,0 @@ export declare type ClientPairSetupSession = { |
@@ -26,14 +26,14 @@ "use strict"; | ||
exports.HAPClientConnection = exports.HAPClientConnectionEvents = exports.HAPClient = exports.HAPClientEvents = void 0; | ||
const net_1 = __importDefault(require("net")); | ||
const debug_1 = __importDefault(require("debug")); | ||
const assert_1 = __importDefault(require("assert")); | ||
const crypto_1 = __importDefault(require("crypto")); | ||
const tlv = __importStar(require("./utils/tlv")); | ||
const debug_1 = __importDefault(require("debug")); | ||
const fast_srp_hap_1 = require("fast-srp-hap"); | ||
const net_1 = __importDefault(require("net")); | ||
const tweetnacl_1 = __importDefault(require("tweetnacl")); | ||
const encryption = __importStar(require("./crypto/encryption")); | ||
const tweetnacl_1 = __importDefault(require("tweetnacl")); | ||
const EventEmitter_1 = require("./lib/EventEmitter"); | ||
const HAPBonjourBrowser_1 = require("./lib/HAPBonjourBrowser"); | ||
const http_protocol_1 = require("./lib/http-protocol"); | ||
const EventEmitter_1 = require("./lib/EventEmitter"); | ||
const hap_proxy_1 = require("./types/hap-proxy"); | ||
const HAPBonjourBrowser_1 = require("./lib/HAPBonjourBrowser"); | ||
const fast_srp_hap_1 = require("fast-srp-hap"); | ||
const tlv = __importStar(require("./utils/tlv")); | ||
const debug = debug_1.default("HAPClient"); | ||
@@ -80,6 +80,10 @@ const debugCon = debug_1.default("HAPClient:Connection"); | ||
debugCon("Sending pair setup M1"); | ||
if (!this.deviceInfo) { | ||
throw new Error("Bonjour DeviceInfo is undefined when trying to send M1"); | ||
} | ||
this.pairSetupSession = { | ||
initiator: connection, | ||
}; | ||
const startRequest = tlv.encode(hap_proxy_1.TLVValues.STATE, hap_proxy_1.HAPStates.M1, hap_proxy_1.TLVValues.METHOD, hap_proxy_1.PairMethods.PAIR_SETUP); | ||
const withAuthentication = !!(this.deviceInfo.pairingFeatureFlags & 1 /* SUPPORTS_HARDWARE_AUTHENTICATION */); | ||
const startRequest = tlv.encode(hap_proxy_1.TLVValues.STATE, hap_proxy_1.HAPStates.M1, hap_proxy_1.TLVValues.METHOD, withAuthentication ? hap_proxy_1.PairMethods.PAIR_SETUP_WITH_AUTH : hap_proxy_1.PairMethods.PAIR_SETUP); | ||
return connection.sendPairRequest(http_protocol_1.HTTPRoutes.PAIR_SETUP, startRequest) | ||
@@ -86,0 +90,0 @@ .then(this.handlePairM2.bind(this, connection)); |
@@ -12,2 +12,3 @@ import { MulticastOptions } from 'bonjour-hap'; | ||
statusFlag: number; | ||
pairingFeatureFlags: number; | ||
paired: boolean; | ||
@@ -14,0 +15,0 @@ category: HAPAccessoryCategory; |
@@ -51,3 +51,4 @@ "use strict"; | ||
const configNumber = txt["c#"]; | ||
const statusFlag = txt["sf"]; | ||
const statusFlag = parseInt(txt["sf"]); | ||
const pairingFlags = parseInt(txt["ff"]); | ||
const protocolVersion = txt["pv"]; | ||
@@ -70,2 +71,3 @@ const id = txt["id"]; | ||
statusFlag: statusFlag, | ||
pairingFeatureFlags: pairingFlags, | ||
paired: paired, | ||
@@ -72,0 +74,0 @@ category: category, |
{ | ||
"name": "hap-proxy", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"description": "An HAP proxy tool written in Typescript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
581953
7407