Hi. Thank you for your replys. I think I can be now more specific about my issue of the buffer overflow error. The routine I call for COM5 serial handshaking is Serial_TrxRcv( $commandForTransmission ). In my main routine I have a sub doing this which is below;
sub ProcessPIDs { # print "Inside ProcessPIDs \n"; # Process the input arguments my ( $nickname, $ref_nicknametocommand ) = @_; my %InSubNickNameToCommand = %{$ref_nicknametocommand}; # De-ref +erence the reference to a hash my $ccmd; $ccmd = $InSubNickNameToCommand{ $nickname }; # ne +ed further ERROR checking here !!!!!! my $newcmd = '0101'; print "\$ccmd; $ccmd ".length($ccmd). " \$newcmd; $newcmd ".le +ngth($newcmd)."\n"; # my $newcmd = $ccmd; # not work my $response = Serial_TrxRcv($newcmd); my $result; ...etc...
If I use Serial_TrxRcv in the manner as above, I do not have error. If I call the same but with the parameter $ccmd then I get the error. This $ccmd is initialised from a hash structure. The hash is to provide quick mapping from a nickname to the wanted command string. I provide a comparison between these 2 parameters with the just above programs and the console output below;
TPA $ccmd; 0101 4 $newcmd; 0101 4 cmd; 0101 x x MonStatus Cmd; 0101 Length; 21 Response; 41 01 00 07 61 00 __>. $nickname MonStatus; 00 07 61 00 TPB
The non-faulty and faulty parameters both appear the same and have the same lengths. So, do people have any further ideas about my problem ??
Thanks. Regards JC.....
In reply to Re^3: Win32::SerialPort, buffer overflow
by jmClifford
in thread Win32::SerialPort, buffer overflow
by jmClifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |