Re: [VSCP] Question about demo_vscp_node_can128
Brought to you by:
akhe
|
From: Ake H. G. P. A. <ak...@gr...> - 2014-07-23 07:15:34
|
Congratz. That is a good feeling. Impressed by your work and by documenting your road ahead you help others who have the same questions. Thanks for that! /Ake Jean-Marc Beaune skrev 2014-07-23 00:42: > I think I found my head around the DM logic. > Good news, I can now control two leds connected to one node, with two > switches connected to another node, using the VSCP framework! > > My demo code for AT90CAN32 is pushed to the git repo (merged to > master) and documented in the wiki > <http://www.vscp.org/wiki/doku.php/howto/vscp_over_canbus_for_dummies_atmel> > > Thank you all for your support, now that I have two VSCP nodes for > testing, I need to go ahead with the installation of some nodes in > production in my house. > > I think I will understand even better when I start to play with vscpworks. > > I'll probably come back with some more questions! > > Thank you very much! > > > On Tue, Jul 22, 2014 at 8:18 PM, Andreas Merkle <we...@bl... > <mailto:we...@bl...>> wrote: > > Maybe a more abstract view helps ... > A decision matrix row is nothing else than a single if-clause. > > If you want to trigger action 1 with event A and trigger action 2 with > event B, you will > configure two decision matrix rows. > The first one handles event A and executes the action 1. The > second one > handles event B and > executes the action 2. > > Note, the demo source code is just out of the box limited to 2 dm > rows, > therefore only two if-clauses are possible. > > > > Am 22.07.2014 10:11, schrieb Ake Hedman, Grodans Paradis AB: > > Jean-Marc Beaune skrev 2014-07-22 10:05: > >> What I understand is, if he decision matrix filter is passed, both > >> doActionCtrlLed() and doActionHelloWorld() are executed, it's > not one > >> or the other. > >> > >> Do I get it right? > > No just one of them. Look at > > > > if ( !( ( class_filter ^ vscp_imsg.class ) & class_mask ) && > > !( ( type_filter ^ vscp_imsg.type ) & > type_mask )) { > > > > // OK Trigger this action > > switch ( readEEPROM( VSCP_EEPROM_END + > REG_DM_START + ( > > 8 * i ) + VSCP_DM_POS_ACTION ) ) { > > > > case ACTION_CTRL_LED: // Enable relays > > in arg. bitarry > > doActionCtrlLed( dmflags, readEEPROM( > > VSCP_EEPROM_END + REG_DM_START + ( 8 * i ) + > VSCP_DM_POS_ACTIONPARAM ) ); > > break; > > > > case ACTION_HELLO_WORLD: // Disable relays > > in arg. bitarry > > doActionHelloWorld(dmflags, readEEPROM( > > VSCP_EEPROM_END + REG_DM_START + ( 8 * i ) + > VSCP_DM_POS_ACTIONPARAM ) ); > > break; > > > > > > } // case > > } // Filter/mask > > > > > > First the filter mask is checked and if it is OK you go to the > trigger > > that executes the action set up in the eeprom (=configured in > the dm). > > The switch statement compares each "case" and execute the code > from the > > one that is the same as in the switch statement. > > > > Cheers > > /Ake > > > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? > Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > _______________________________________________ > M2m-development mailing list > M2m...@li... > <mailto:M2m...@li...> > https://lists.sourceforge.net/lists/listinfo/m2m-development > > > > > -- > Jean-Marc > > > ------------------------------------------------------------------------------ > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight - the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > > > _______________________________________________ > M2m-development mailing list > M2m...@li... > https://lists.sourceforge.net/lists/listinfo/m2m-development -- Be Hungry - Stay Foolish! Åke Hedman, Grodans Paradis AB Brattbergavägen 17, 82050 LOS, SWEDEN Phone: +46 (0)840011835 CellPhone: +46 (0)730-533146 http://www.grodansparadis.com http://www.vscp.org |