UNPKG

632 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const __1 = require("./..");
4/**
5 * Maps a SSDP message to a device.
6 */
7function mapFromMessage(message) {
8 const macAddressMatch = macAddressRegExp.exec(message.usn);
9 if (macAddressMatch == null) {
10 return null;
11 }
12 const macAddress = macAddressMatch[1].toUpperCase();
13 return new __1.Device(message.remoteAddress, undefined, macAddress, undefined, undefined, undefined, undefined, undefined);
14}
15exports.mapFromMessage = mapFromMessage;
16const macAddressRegExp = /^uuid:.*([0-9a-f]{12})::.*$/i;
17//# sourceMappingURL=Mappings.js.map
\No newline at end of file