发表于:2002-12-05 20:15:00
3楼
谢谢,我试图用下面程序实现,但是不行:
#pragma scheduler_reset
#pragma num_alias_table_entries 1
#include <addrdefs.h>
#include <access.h>
#include <msg_addr.h>
#include <netmgmt.h>
#include <control.h>
#include <stdlib.h>
NM_service_pin_msg svc_pin_msg;
msg_tag Run;
when ( msg_arrives(NM_service_pin | NM_opcode_base))
{
memcpy( &svc_pin_msg, msg_in.data, sizeof(NM_service_pin_msg) );
msg_out.priority_on = FALSE;
msg_out.authenticated = FALSE;
msg_out.dest_addr.nrnid.type = NEURON_ID;
msg_out.dest_addr.nrnid.domain = 0;
msg_out.dest_addr.nrnid.subnet = 0;
msg_out.service = UNACKD;
memcpy(msg_out.dest_addr.nrnid.nid, svc_pin_msg.neuron_id, 6);
msg_out.dest_addr.nrnid.retry = 3;
msg_out.dest_addr.nrnid.tx_timer = 10;
msg_out.code = NM_set_node_mode | NM_opcode_base;
msg_out.tag =Run;
msg_out.data[0] = 3;
msg_out.data[1] = 4;
msg_send();
}
when(msg_arrives) {
}
好像程序未Config,调度不执行when语句,也就是说无法实现“自安装”啰?