coap-packet
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,1 +0,1 @@ | ||
{"processes":{"1a0df389-1001-4660-a24f-87c453d9e00c":{"parent":null,"children":[]}},"files":{"/Users/matteo/repositories/coap-packet/index.js":["1a0df389-1001-4660-a24f-87c453d9e00c"]},"externalIds":{}} | ||
{"processes":{"430d400a-f407-4f89-9bfa-184cceee4790":{"parent":null,"children":[]}},"files":{"/Users/matteo/repositories/coap-packet/index.js":["430d400a-f407-4f89-9bfa-184cceee4790"]},"externalIds":{}} |
@@ -10,12 +10,20 @@ export type OptionName = | ||
| "Uri-Path" | ||
| "OSCORE" | ||
| "Content-Format" | ||
| "Max-Age" | ||
| "Uri-Query" | ||
| "Hop-Limit" | ||
| "Accept" | ||
| "Q-Block1" | ||
| "Location-Query" | ||
| "Block2" | ||
| "Block1" | ||
| "Size2" | ||
| "Q-Block2" | ||
| "Proxy-Uri" | ||
| "Proxy-Scheme" | ||
| "Size1"; | ||
| "Size1" | ||
| "No-Response" | ||
| "OCF-Accept-Content-Format-Version" | ||
| "OCF-Content-Format-Version"; | ||
@@ -22,0 +30,0 @@ export type CoapMethod = "GET" | "POST" | "PUT" | "DELETE" | "FETCH" | "PATCH" | "iPATCH"; |
10
index.js
@@ -172,2 +172,3 @@ | ||
8: 'Location-Path', | ||
9: 'OSCORE', | ||
11: 'Uri-Path', | ||
@@ -177,9 +178,16 @@ 12: 'Content-Format', | ||
15: 'Uri-Query', | ||
16: 'Hop-Limit', | ||
17: 'Accept', | ||
19: 'Q-Block1', | ||
20: 'Location-Query', | ||
23: 'Block2', | ||
27: 'Block1', | ||
28: 'Size2', | ||
31: 'Q-Block2', | ||
35: 'Proxy-Uri', | ||
39: 'Proxy-Scheme', | ||
60: 'Size1' | ||
60: 'Size1', | ||
258: 'No-Response', | ||
2049: 'OCF-Accept-Content-Format-Version', | ||
2053: 'OCF-Content-Format-Version' | ||
} | ||
@@ -186,0 +194,0 @@ |
{ | ||
"name": "coap-packet", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Generate and Parse CoAP packets", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,3 +15,4 @@ CoAP-Packet | ||
This library follows [RFC 7252](https://datatracker.ietf.org/doc/html/rfc7252) and [RFC 8132](https://datatracker.ietf.org/doc/html/rfc8132). | ||
This library follows [RFC 7252](https://datatracker.ietf.org/doc/html/rfc7252) for generating and parsing of CoAP packets. | ||
It also supports the method and option codes specified by other specifications, such as [RFC 7641](https://datatracker.ietf.org/doc/html/rfc7641), [RFC 7959](https://datatracker.ietf.org/doc/html/rfc7959), and [RFC 8132](https://datatracker.ietf.org/doc/html/rfc8132). | ||
@@ -18,0 +19,0 @@ It does not provide any CoAP semantics, it just parses the protocol. |
22
test.js
@@ -241,3 +241,3 @@ | ||
// numbers | ||
9: 9 | ||
10: 10 | ||
} | ||
@@ -309,3 +309,3 @@ | ||
// numbers | ||
16: '16' | ||
13: '13' | ||
} | ||
@@ -565,3 +565,3 @@ | ||
// numbers | ||
9: 9 | ||
10: 10 | ||
} | ||
@@ -863,5 +863,5 @@ | ||
const longOptions = { | ||
13: 13, // unknown, just to be sure it parses | ||
'Max-Age': 14, | ||
'Uri-Query': 15, | ||
16: 16, // unknown, just to be sure it parses | ||
Accept: 17, | ||
@@ -873,3 +873,4 @@ 'Location-Query': 20, | ||
'Proxy-Scheme': 39, | ||
Size1: 60 | ||
Size1: 60, | ||
'No-Response': 258 | ||
} | ||
@@ -929,5 +930,12 @@ | ||
;['560', '720'].forEach(function (option) { | ||
const optionNum = '' + option | ||
const evenLongerOptions = { | ||
560: 560, | ||
720: 720, | ||
'OCF-Accept-Content-Format-Version': 2049, | ||
'OCF-Content-Format-Version': 2053 | ||
} | ||
Object.keys(evenLongerOptions).forEach(function (option) { | ||
const optionNum = evenLongerOptions[option] | ||
it('should generate ' + option + ' option with unextended length', function () { | ||
@@ -934,0 +942,0 @@ packet = { |
86930
1300
126