var nodeId = 22;


can.registerCanEvent( 0x00, "reactOnResetNode" );


function reactOnResetNode (id, rtrFlag, dlc, d0, d1, d2, d3, d4, d5,d6, d7) {
    if ( (id === 0) && (dlc === 2) && (d0 === 0x81) && (d1 === nodeId)) {
	    // wait a bit
	    util.msleep(10);

	    //  Configurating
	    can.sendBaseFrame(0x7e5, 8, 4 , 1 , 0 ,0 , 0, 0, 0 ,0);
	    util.msleep(10);

	    // assign node id
	    can.sendBaseFrame(0x7e5, 8, 0x11 , nodeId , 0 ,0 , 0, 0, 0 ,0);
	    util.msleep(50);

	    // Normal
	    can.sendBaseFrame(0x7e5, 8, 4 , 0 , 0 ,0 , 0, 0, 0 ,0);
     }
}
