如何将pchar转换成为hex
2017-05-15
展开全部
var
id:thandle;
rLen:LongInt;
PBuf:PChar;
Buf:String;
begin
Result := 0;
if endrecvthread = true then exit;
rlen := sio_iqueue(port);
PBuf := PChar(StringOfChar(char(0),rlen+1));
rlen := sio_read(Port, PBuf, rlen); //从串口读入HEX数据
sio_flush(port,0);
If rlen = 0 Then
begin
CreateThread(nil,0,@recvdata,nil,0,id);
exit;
end;
move(Buf^, PChar(PBuf)^, rlen);
form1.memo1.Text := form1.memo1.Text + buf;
form1.memo1.SelStart := Length(form1.memo1.Text);
form1.memo1.SelLength := 0;
CreateThread(nil,0,@recvdata,nil,0,id);
exit;
end;
id:thandle;
rLen:LongInt;
PBuf:PChar;
Buf:String;
begin
Result := 0;
if endrecvthread = true then exit;
rlen := sio_iqueue(port);
PBuf := PChar(StringOfChar(char(0),rlen+1));
rlen := sio_read(Port, PBuf, rlen); //从串口读入HEX数据
sio_flush(port,0);
If rlen = 0 Then
begin
CreateThread(nil,0,@recvdata,nil,0,id);
exit;
end;
move(Buf^, PChar(PBuf)^, rlen);
form1.memo1.Text := form1.memo1.Text + buf;
form1.memo1.SelStart := Length(form1.memo1.Text);
form1.memo1.SelLength := 0;
CreateThread(nil,0,@recvdata,nil,0,id);
exit;
end;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询