lib/xbee-rx.js
function _lookupByNodeIdentifier(nodeIdentifier, timeoutMs) {
        // if the address is cached, return that
        if (cachedNodes[nodeIdentifier]) {
            return rx.of({ destination64: cachedNodes[nodeIdentifier]});
        }

        if (debug) {
            console.log("Looking up", nodeIdentifier);
        }

        return _localCommand("DN", timeoutMs, nodeIdentifier).pipe(
            rx.operators.catchError(function() {
                return rx.throwError(new Error("Node not found"));
            }),
            rx.operators.map(_extractDestination64),
            rx.operators.tap(function(address64) {
                cachedNodes[nodeIdentifier] = address64;
            }),
            rx.operators.map(function(address64) {
                return { destination64: address64 };
            })
        );
    }
function _lookupByNodeIdentifier(nodeIdentifier, timeoutMs) {
        // if the address is cached, return that
        if (cachedNodes[nodeIdentifier]) {
            return rx.of({ destination64: cachedNodes[nodeIdentifier]});
        }

        if (debug) {
            console.log("Looking up", nodeIdentifier);
        }

        return _localCommand("DN", timeoutMs, nodeIdentifier).pipe(
            rx.operators.catchError(function() {
                return rx.throwError(new Error("Node not found"));
            }),
            rx.operators.map(_extractDestination64),
            rx.operators.tap(function(address64) {
                cachedNodes[nodeIdentifier] = address64;
            }),
            rx.operators.map(function(address64) {
                return { destination64: address64 };
            })
        );
    }
function _lookupByNodeIdentifier ( nodeIdentifier , timeoutMs ) { // if the address is cached, return that if ( cachedNodes [ nodeIdentifier ] ) { return rx . of ( { destination64 : cachedNodes [ nodeIdentifier ] } ) ; } if ( debug ) { console . log ( "Looking up" , nodeIdentifier ) ; } return _localCommand ( "DN" , timeoutMs , nodeIdentifier ) . pipe ( rx . operators . catchError ( function ( ) { return rx . throwError ( new Error ( "Node not found" ) ) ; } ) , rx . operators . map ( _extractDestination64 ) , rx . operators . tap ( function ( address64 ) { cachedNodes [ nodeIdentifier ] = address64 ; } ) , rx . operators . map ( function ( address64 ) { return { destination64 : address64 } ; } ) ) ; }
Returns a stream that will emit the 64 bit address of the node with the given node identifier.
Returns a stream that will emit the 64 bit address of the node with the given node identifier .