node/examples/mesh-sender.js
function(callback){
      console.log( 'Start sending messages... ');
      setInterval(function(){
	var msg = '';
	if( program.message != null ){
	  msg = program.message;
	}else{
          msgCounter++;
          msg = 'Hello #' + msgCounter + ' from node.js';
        }
	console.log( '[ubeacon] Sending "' +msg+ '" to device: ' + program.destinationAddress );
        ubeacon.sendMeshGenericMessage( program.destinationAddress, msg, function( response ){
          console.log( '[ubeacon] Mesh message #' + msgCounter + ' sent. Response: ' + response );
        });
      }, interval);
    }
function(callback){
      console.log( 'Start sending messages... ');
      setInterval(function(){
	var msg = '';
	if( program.message != null ){
	  msg = program.message;
	}else{
          msgCounter++;
          msg = 'Hello #' + msgCounter + ' from node.js';
        }
	console.log( '[ubeacon] Sending "' +msg+ '" to device: ' + program.destinationAddress );
        ubeacon.sendMeshGenericMessage( program.destinationAddress, msg, function( response ){
          console.log( '[ubeacon] Mesh message #' + msgCounter + ' sent. Response: ' + response );
        });
      }, interval);
    }
function ( callback ) { console . log ( 'Start sending messages... ' ) ; setInterval ( function ( ) { var msg = '' ; if ( program . message != null ) { msg = program . message ; } else { msgCounter ++ ; msg = 'Hello #' + msgCounter + ' from node.js' ; } console . log ( '[ubeacon] Sending "' + msg + '" to device: ' + program . destinationAddress ) ; ubeacon . sendMeshGenericMessage ( program . destinationAddress , msg , function ( response ) { console . log ( '[ubeacon] Mesh message #' + msgCounter + ' sent. Response: ' + response ) ; } ) ; } , interval ) ; }
Send message - works until script is terminated
Send message - works until script is terminated