in reply to Re^2: Win32::SerialPort, buffer overflow
in thread Win32::SerialPort, buffer overflow
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.....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Win32::SerialPort, buffer overflow
by NERDVANA (Priest) on Nov 12, 2024 at 17:34 UTC | |
by afoken (Chancellor) on Nov 12, 2024 at 21:00 UTC | |
by jmClifford (Beadle) on Nov 18, 2024 at 05:51 UTC | |
by NERDVANA (Priest) on Nov 19, 2024 at 03:01 UTC | |
|
Re^4: Win32::SerialPort, buffer overflow
by soonix (Chancellor) on Nov 12, 2024 at 09:31 UTC |