feat: 导入 NMEA-0183 GPS 协议解析库(node-nmea)
NMEA-0183 语句解析器,含 21 个语句类型 codec 与配套单元测试。 - codecs/:APB/BWC/DBT/GGA/GLL/GRMT/GSA/GSV/HDG/HDM/HDT/MWV/RDID/ RMB/RMC/ROT/RSA/TXT/VTG/VWR/ZDA - test/:各 codec 对应的 mocha 用例 - .github/workflows/:node与 npm-publish 流水线 许可证:MIT(原作者 James Penn)
This commit is contained in:
29
codecs/ZDA.js
Normal file
29
codecs/ZDA.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
ZDA Time & Date – UTC, Day, Month, Year and Local Time Zone
|
||||
1 2 3 4 5 6 7
|
||||
| | | | | | |
|
||||
$--ZDA,hhmmss.ss,xx,xx,xxxx,xx,xx*hh
|
||||
1) Local zone minutes description, same sign as local hours
|
||||
2) Local zone description, 00 to +/- 13 hours
|
||||
3) Year
|
||||
4) Month, 01 to 12
|
||||
5) Day, 01 to 31
|
||||
6) Time (UTC)
|
||||
7) Checksum
|
||||
*/
|
||||
|
||||
exports.ID = 'ZDA';
|
||||
exports.TYPE = 'time-zone';
|
||||
|
||||
exports.decode = function(fields) {
|
||||
return {
|
||||
sentence: exports.ID,
|
||||
type: exports.TYPE,
|
||||
timestamp: fields[1],
|
||||
day: fields[2],
|
||||
month: fields[3],
|
||||
year: fields[4],
|
||||
ltzh: fields[5],
|
||||
ltzn: fields[6]
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user