1- //process.env.DEBUG = 'emberplus-connection:*'
1+ // Setting the environment variable DEBUG=emberplus-connection:*
2+ // will show debug information from the emberplus-connection module
3+
4+ process . env . DEBUG = 'emberplus-connection:*'
5+ // Note: it's also possible to only log parts of the module by using a subset of the debug name,
6+ // 'emberplus-connection:S101Client' // for the S101Client class
7+ // 'emberplus-connection:S101Codec' // for the S101Codec class
8+ // 'emberplus-connection:StreamManager' // for the StreamManager class
9+
210const { EmberClient } = require ( '../dist/index' )
311
412//-------------------------------------------------------------------------
513// Client
6- // log output from mc2_1_fader_mock .js
14+ // log output from lawo_mc2_fader_metering_mock .js
715// ------------------------------------------------------------------------
816
917const client = new EmberClient ( '192.168.1.67' , 9000 )
18+ let node1InternalNodePath = ''
1019
1120client . on ( 'disconnected' , ( ) => {
1221 console . error ( 'Client Lost Ember connection' )
@@ -35,6 +44,7 @@ client.on('connected', () => {
3544 throw new Error ( ' Could not find node 1' )
3645 }
3746 console . log ( 'Found node:' , node1 )
47+ node1InternalNodePath = client . getInternalNodePath ( node1 )
3848
3949 // Subscribe to changes
4050 client . subscribe ( node1 , ( node1 ) => {
@@ -46,15 +56,18 @@ client.on('connected', () => {
4656 console . error ( ' Error:' , error )
4757 } )
4858} )
49- client . on ( 'streamUpdate' , ( path , value ) => {
59+ client . on ( 'streamUpdate' , ( internalNodePath , value ) => {
60+ if ( internalNodePath !== node1InternalNodePath ) {
61+ return
62+ }
5063 console . log ( 'Stream Update:' , {
51- path : path ,
64+ path : internalNodePath ,
5265 value : value ,
5366 } )
5467} )
5568
5669console . log ( '-----------------------------------------------------------------------------' )
57- console . log ( 'log output from mc2_1_fader_mock .js' )
70+ console . log ( 'log output from mc2_fader_metering_example .js' )
5871console . log ( 'Connecting to Client...' )
5972client . connect ( ) . catch ( ( error ) => {
6073 console . error ( 'Client 2 Error when connecting:' , error )
0 commit comments