definecomm.m

来自「传感器网络中的嵌入式操作系统源代码」· M 代码 · 共 38 行

M
38
字号
function defineComm(groupID, packetLength, baud)
%DEFINECOMM
%
%usage: defineCOMM(groupID, packetLength, baud)

global COMM

COMM.broadcastAddress=65535;

if nargin>0 & ~isempty(groupID) 
    COMM.groupID=groupID 
else 
    COMM.groupID=hex2dec('7d'); 
end

if nargin>1 & ~isempty(packetLength) 
    COMM.packetLength=packetLength;
else
    COMM.packetLength=29;
end

if nargin>2 & ~isempty(baud) 
    COMM.baud=baud;
else
    COMM.baud=19200;
end

COMM.serials={};
COMM.serialForward={};

COMM.sockets={};
COMM.moteIF={};

COMM.functions={};
COMM.messageTypes={};
COMM.dataSource={};
COMM.messageListener={};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?