Commit Graph

21 Commits

Author SHA1 Message Date
8c30637c1f CoapPacket
- `getBytes()` now encodes the token

Packet (unit tests)

- Check the encoding of the token
2023-09-12 19:23:20 +02:00
0e450556be Packet (unit tests)
- Ensure the message ID is encoded properly in big endian format
2023-09-12 18:47:50 +02:00
edf7de3839
Update README.md 2023-09-12 18:43:55 +02:00
774de746f1
Create d.yml 2023-09-12 18:42:57 +02:00
1cb57e781e - Added WIP for USAGE 2023-09-12 18:41:11 +02:00
d03e52da2a - Added README 2023-09-12 18:40:43 +02:00
589196d000 - Added LICENSE 2023-09-12 18:39:35 +02:00
4e99ab50d8 CoapPacket
- Now encodes the message ID in a platform independent manner. We will encode it into big endian seeing as it feels like it could be used in a number like fashion
- Added `setMessageId(ushort)` to set the message id
2023-09-12 18:37:57 +02:00
8a11f3d405 Package
- Added missing imports
2023-09-12 17:55:37 +02:00
809ef394a0 Packet
- Added `setCode(Code)`

Packet (unit tests)

- Test the encoding of the request/response code
2023-09-12 11:52:13 +02:00
23994bb75b Packet (unit tests)
- Test encoding of the token length (tkl)
2023-09-12 11:12:07 +02:00
f7f928023d Packet
- Added `setTokenLength(ulong)` which returns `false` if the token length is above 15, else sets the token length (<=15) and returns `true`
- Added `setToken(ubyte[])` which sets the token (and length) and checks that the length is fine

Exceptions

- Added new exception time `CoapException`
2023-09-12 11:09:14 +02:00
64e22741dd Packet (unit tests)
- Removed print statements
2023-09-12 10:48:32 +02:00
d3ffdd46db Packet
- Added `setType(MessageType)` which sets the messagr type
- The `type` field is no longer a `ubyte` but rather a `MessageType`

Packet (unit tests)

- Test the encoding of the type field

Types

- Added new module
- Added `MessageType` enum
2023-09-12 10:48:01 +02:00
8e8d1d2ba1 Packet (unit tests)
- Added a unit test which tests the encoding
- So far it just checks that the version is encoded correctly
2023-09-12 10:33:11 +02:00
3a3febc61e Packet
- `getByte()` now tacks on the calculated first byte
- `getBytes()` encodes the rquest/response code now as well
2023-09-11 22:26:29 +02:00
d6a9f7d329 Packet
- Defined `CoapPacket` to represent a CoAP packet
- Added the required fields
- Constructor sets the version to `1` (the only version available)
- `getBytes()` no encodes the first byte of the CoAP header (versio, type and token length)
2023-09-11 22:18:19 +02:00
ec4f57af5d Codes
- Added the codes for messages
- These are 8-bits
2023-09-11 21:39:31 +02:00
d9a6eb3280 - Fixed .gitignore 2023-09-11 21:37:05 +02:00
c3e29c41d0 Dub
- Added dub package descriptor
- Set `"targetType"` to `"library"`
2023-09-11 21:36:19 +02:00
718ef2833e - Added .gitignore 2023-09-11 21:35:18 +02:00