lib/xbee-rx.js
function _remoteTransmit(destination64, destination16, data, timeoutMs) {
        var frame = {
                data: data,
                type: xbee_api.constants.FRAME_TYPE.ZIGBEE_TRANSMIT_REQUEST,
                destination64: destination64,
                destination16: destination16
            },
            responseFrameType = xbee_api.constants.FRAME_TYPE.ZIGBEE_TRANSMIT_STATUS;

        if (module === "802.15.4") {
            responseFrameType = xbee_api.constants.FRAME_TYPE.TX_STATUS;
            frame.type = destination64 ?
                    xbee_api.constants.FRAME_TYPE.TX_REQUEST_64 :
                    xbee_api.constants.FRAME_TYPE.TX_REQUEST_16;
        }

        if (debug) {
            console.log("Sending '" + data + "' to", destination64 || destination16);
        }

        return _sendFrameStreamResponse(frame, timeoutMs, responseFrameType).pipe(
            rx.operators.take(1),
            rx.operators.flatMap(function(frame) {
                if (frame.deliveryStatus === xbee_api.constants.DELIVERY_STATUS.SUCCESS) {
                    return rx.of(true);
                }
                // if not OK, throw error
                return rx.throwError(new Error(xbee_api.constants.DELIVERY_STATUS[frame.deliveryStatus]));
            })
        );
    }
function _remoteTransmit(destination64, destination16, data, timeoutMs) {
        var frame = {
                data: data,
                type: xbee_api.constants.FRAME_TYPE.ZIGBEE_TRANSMIT_REQUEST,
                destination64: destination64,
                destination16: destination16
            },
            responseFrameType = xbee_api.constants.FRAME_TYPE.ZIGBEE_TRANSMIT_STATUS;

        if (module === "802.15.4") {
            responseFrameType = xbee_api.constants.FRAME_TYPE.TX_STATUS;
            frame.type = destination64 ?
                    xbee_api.constants.FRAME_TYPE.TX_REQUEST_64 :
                    xbee_api.constants.FRAME_TYPE.TX_REQUEST_16;
        }

        if (debug) {
            console.log("Sending '" + data + "' to", destination64 || destination16);
        }

        return _sendFrameStreamResponse(frame, timeoutMs, responseFrameType).pipe(
            rx.operators.take(1),
            rx.operators.flatMap(function(frame) {
                if (frame.deliveryStatus === xbee_api.constants.DELIVERY_STATUS.SUCCESS) {
                    return rx.of(true);
                }
                // if not OK, throw error
                return rx.throwError(new Error(xbee_api.constants.DELIVERY_STATUS[frame.deliveryStatus]));
            })
        );
    }
function _remoteTransmit ( destination64 , destination16 , data , timeoutMs ) { var frame = { data : data , type : xbee_api . constants . FRAME_TYPE . ZIGBEE_TRANSMIT_REQUEST , destination64 : destination64 , destination16 : destination16 } , responseFrameType = xbee_api . constants . FRAME_TYPE . ZIGBEE_TRANSMIT_STATUS ; if ( module === "802.15.4" ) { responseFrameType = xbee_api . constants . FRAME_TYPE . TX_STATUS ; frame . type = destination64 ? xbee_api . constants . FRAME_TYPE . TX_REQUEST_64 : xbee_api . constants . FRAME_TYPE . TX_REQUEST_16 ; } if ( debug ) { console . log ( "Sending '" + data + "' to" , destination64 || destination16 ) ; } return _sendFrameStreamResponse ( frame , timeoutMs , responseFrameType ) . pipe ( rx . operators . take ( 1 ) , rx . operators . flatMap ( function ( frame ) { if ( frame . deliveryStatus === xbee_api . constants . DELIVERY_STATUS . SUCCESS ) { return rx . of ( true ) ; } // if not OK, throw error return rx . throwError ( new Error ( xbee_api . constants . DELIVERY_STATUS [ frame . deliveryStatus ] ) ) ; } ) ) ; }
Sends a the given data to the given destination.  A stream is returned that will complete on success or end in an Error with the failed status as the text.  Only one of destination64 or destination16 should be given; the other should be undefined.
Sends a the given data to the given destination . A stream is returned that will complete on success or end in an Error with the failed status as the text . Only one of destination64 or destination16 should be given ; the other should be undefined .