eclipse-archived / californium.core

Californium project
86 stars 69 forks source link

Possibility to customize error responses #58

Closed mateusz1364 closed 2 years ago

mateusz1364 commented 2 years ago

When we send corrupted coap frame, eg. invalid header inside we get auto-generated response by library and we can't change payload ("Observe option must...")

In my opinion good option is add customize handler on invalid data on coap layer.

00:31:41.016,000] CellGtw: SOCKET RECEIVE [00:31:41.017,000] CellGtw: Packet received [00:31:41.017,000] CellGtw: 64 82 1E 90 93 98 58 08|d.....X. [00:31:41.017,000] CellGtw: FF 4F 62 73 65 72 76 65|.Observe [00:31:41.017,000] CellGtw: 20 6F 70 74 69 6F 6E 20| option [00:31:41.017,000] CellGtw: 6D 75 73 74 20 62 65 20|must be [00:31:41.017,000] CellGtw: 62 65 74 77 65 65 6E 20|between [00:31:41.017,000] CellGtw: 30 20 61 6E 64 20 31 36|0 and 16 [00:31:41.017,000] CellGtw: 37 37 37 32 31 35 20 28|777215 ( [00:31:41.017,000] CellGtw: 33 20 62 79 74 65 73 29|3 bytes) [00:31:41.017,000] CellGtw: 20 69 6E 63 6C 75 73 69| inclusi [00:31:41.017,000] CellGtw: 76 65 |ve [00:31:41.017,000] BrS: Communication is successful

boaks commented 2 years ago

Sorry, this repo has moved years ago to eclipse/californium, as written in the README.

About your proposal: please open an issue in the current repo. If possible, give some ideas, what such a custom handler should do, e.g. "ignore", "report specific error", "just log".

boaks commented 2 years ago

This repository is moved to eclipse/californium.

mateusz1364 commented 2 years ago

Sorry, you are right.