X
xingkong97
Unregistered / Unconfirmed
GUEST, unregistred user!
我现在需要发送这样的字节:
01h 01h 0000h
请问我该怎样发送呀?
这个发送程序对不对?
u:=1;//U为byte型,占一个字节
clientsocket2.Socket.SendBuf(u,1); //PDUType 单字节 01h
clientsocket2.Socket.SendBuf(u,1);//reserved 双字节 01h
h:=74;//h为integer型,占四个字节
clientsocket2.Socket.SendBuf(h,4); //PDU length 四字节
k:=0;//k为word型,占两个字节
clientsocket2.Socket.SendBuf(k,2); //Protocol-version 双字节 0000h
clientsocket2.Socket.SendBuf(k,2); //Reserved 双字节 0000h
str:='emu2';
clientsocket2.Socket.SendBuf(str,16);// Called AE title 16字节
str:='AE_TITLE';
clientsocket2.Socket.SendBuf(str,16);//Calling AE Title 16字节
p:=0; //p为longint 型,占32个字节
clientsocket2.Socket.SendBuf(p,32); //Reserved 32个字节
str:='1.2.804.123456.0.21.4';
clientsocket2.Socket.SendBuf(str,length(str));//Variable items
01h 01h 0000h
请问我该怎样发送呀?
这个发送程序对不对?
u:=1;//U为byte型,占一个字节
clientsocket2.Socket.SendBuf(u,1); //PDUType 单字节 01h
clientsocket2.Socket.SendBuf(u,1);//reserved 双字节 01h
h:=74;//h为integer型,占四个字节
clientsocket2.Socket.SendBuf(h,4); //PDU length 四字节
k:=0;//k为word型,占两个字节
clientsocket2.Socket.SendBuf(k,2); //Protocol-version 双字节 0000h
clientsocket2.Socket.SendBuf(k,2); //Reserved 双字节 0000h
str:='emu2';
clientsocket2.Socket.SendBuf(str,16);// Called AE title 16字节
str:='AE_TITLE';
clientsocket2.Socket.SendBuf(str,16);//Calling AE Title 16字节
p:=0; //p为longint 型,占32个字节
clientsocket2.Socket.SendBuf(p,32); //Reserved 32个字节
str:='1.2.804.123456.0.21.4';
clientsocket2.Socket.SendBuf(str,length(str));//Variable items