Changeset 74f0621
- Timestamp:
- Sep 20, 2017, 6:40:51 PM (9 years ago)
- Branches:
- 0.5, debian/bullseye, debian/jessie, master
- Children:
- 939b309
- Parents:
- 99959fb
- Location:
- src/webapp/webservice
- Files:
-
- 3 edited
-
inc/GnuBoat/Nmea/Nmea0183/Nmea0183Sentence.php (modified) (1 diff)
-
inc/GnuBoat/Nmea/Nmea0183/Parser.php (modified) (1 diff)
-
tests/NmeaTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Sentence.php
r99959fb r74f0621 37 37 // extract characters to calculate checksum 38 38 $matches = array(); 39 $result = preg_match('/^[ \$!]{1}([^\*]+)\*([\da-zA-Z]+)$/', $this->sentence(), $matches);39 $result = preg_match('/^[^\$!]{0,}[\$!]{1}([^\*]+)\*([\da-zA-Z]+)$/', $this->sentence(), $matches); 40 40 if($result === false || $result == 0 || count($matches) != 3){ 41 41 $errorMessage .= "Unable to determine ascii content and checksum from ". $this->sentence() ."\n"; -
src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Parser.php
r99959fb r74f0621 80 80 81 81 $matches = array(); 82 $result = preg_match('/^[ \$!]{1}([\w]{2})([\w]{3})([^\*]+)\*([\da-zA-Z]+)$/', $sentence, $matches);82 $result = preg_match('/^[^\$!]{0,}[\$!]{1}([\w]{2})([\w]{3})([^\*]+)\*([\da-zA-Z]+)$/', $sentence, $matches); 83 83 if($result === false || $result != 1 || count($matches) != 5){ 84 84 $message = "Could not detect talker, type and checksum from ". $sentence; -
src/webapp/webservice/tests/NmeaTest.php
r99959fb r74f0621 69 69 "dpt0183" => ['0183', '$SDDPT,00.71,00.00*51', Nmea0183\Nmea0183Dpt::class, true], 70 70 "mtw0183" => ['0183', '$YXMTW,26.3,C*15', Nmea0183\Nmea0183Mtw::class, true], 71 "rmc0183timestamp" => ['0183', '2017-09-11 13:20:42: $GNRMC,173658,A,0047.589,N,00010.713,E,01.1,147.4,260817,,,A*5F', Nmea0183\Nmea0183Rmc::class, true], 71 72 ]; 72 73 }
Note:
See TracChangeset
for help on using the changeset viewer.
