updated example interface
This commit is contained in:
parent
641c48ee00
commit
1d7efba71a
3 changed files with 65 additions and 23 deletions
|
@ -26,33 +26,35 @@
|
|||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dummy_intf.c,v 1.1 2007/03/23 23:33:54 fros4943 Exp $
|
||||
* $Id: dummy_intf.c,v 1.2 2008/10/28 16:09:52 fros4943 Exp $
|
||||
*/
|
||||
|
||||
#include "dummy_intf.h"
|
||||
#include "lib/simEnvChange.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
const struct simInterface beep_interface;
|
||||
const struct simInterface dummy_interface;
|
||||
|
||||
// COOJA variables (shared between Java and C)
|
||||
char simDummyVar;
|
||||
/* COOJA variable simDummyVar is shared between Cooja and Contiki */
|
||||
char simDummyVar = 0;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static void
|
||||
doInterfaceActionsBeforeTick(void)
|
||||
{
|
||||
fprintf(stderr, "Core (C) dummy interface acts BEFORE mote tick\n");
|
||||
printf("Contiki-part of dummy interface acts BEFORE mote tick: %i\n", simDummyVar);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
static void
|
||||
doInterfaceActionsAfterTick(void)
|
||||
{
|
||||
fprintf(stderr, "Core (C) dummy interface acts AFTER mote tick\n");
|
||||
simDummyVar++;
|
||||
printf("Contiki-part of dummy interface acts AFTER mote tick: %i\n", simDummyVar);
|
||||
}
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
// Register this as an available interface
|
||||
/* Register interface */
|
||||
SIM_INTERFACE(dummy_interface,
|
||||
doInterfaceActionsBeforeTick,
|
||||
doInterfaceActionsAfterTick);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue