⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rawmsg.m

📁 传感器网络中的嵌入式操作系统源代码
💻 M
字号:
function msg = rawMsg( am, data_bytes )%RAWMSG  Create a TOSMsg with the given AM and data_bytes as body%%   msg = rawMsg( am, data_bytes );%%   Example: Create message to turn on motes:%      msg = rawMsg( 249, [1 0] );%%   Example: Oh, you want to haul off and send it, do you? fine:%      msg = send( 65535, rawMsg( 249, [1 0] ), 'localhost:9000' );if nargin ~= 2  error 'wrong number of arguments. usage: rawMsg(am,bytes)';enddata_bytes = min( data_bytes, 255 );data_bytes(data_bytes>127) = data_bytes(data_bytes>127) - 256;msg = net.tinyos.message.TOSMsg;msg.set_type( am );msg.set_data( int8(data_bytes) );msg.set_length( length(data_bytes) );

⌨️ 快捷键说明

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