Commit Graph

208 Commits

Author SHA1 Message Date
Tristan B. Velloza Kildaire 9b779b4c9b RequestState
- Added new enum member `TIMEDOUT` for when the future times out
2023-09-25 14:38:36 +02:00
Tristan B. Velloza Kildaire 237cde4169 CoapRequestFuture
- Removed now-completed TODO
2023-09-25 14:37:38 +02:00
Tristan B. Velloza Kildaire f58f3cdb5c CoapClient
- Disabled normal `get()`-based tests for now (whilst I test the timeout-based ones)
- Added unit test to test timeout-based `get(Duration)`

CoapRequestFuture

- Added documentation for `get(Duration)`
- Fixed bug whereby the `Mutex` was NOT unlock after a failed `wait(Duration)` (a timedout one)
2023-09-25 14:36:38 +02:00
Tristan B. Velloza Kildaire 89cc55f266 Merge branch 'master' into feature/timeoutable_gets 2023-09-25 14:17:11 +02:00
Tristan B. Velloza Kildaire 33648d5e44 Package (server)
- Added module stub

Package (general)

- Documented
- Added `doap.server` import
2023-09-25 14:16:54 +02:00
Tristan B. Velloza Kildaire 4d13968a2f RequestTimeoutException
- Added doc

Package (client)

- Publically import the required exceptions
2023-09-25 14:14:32 +02:00
Tristan B. Velloza Kildaire b240250611 RequestTimeoutException
- Added method `getFuture()` and `getTimeout()`
2023-09-25 14:13:01 +02:00
Tristan B. Velloza Kildaire f78993ad22 RequestTimeoutException
- Made publically accessible
- Made constructor package-level accessible
2023-09-25 14:08:37 +02:00
Tristan B. Velloza Kildaire 82ba08b472 CoapClientExcpeiton
- Added new base class for any client-based errors

RequestTimeoutException

- Added new exception type
2023-09-25 14:08:00 +02:00
Tristan B. Velloza Kildaire 123605df99 Request
- Throw a `RequestTImeoutException` when `get(Duration)` times out
` If the `token(ubyte[])` validation fails then throw a `CoapException` now
2023-09-25 14:07:15 +02:00
Tristan B. Velloza Kildaire ba54bf1b70 Merge branch 'master' into feature/timeoutable_gets 2023-09-25 13:57:41 +02:00
Tristan B. Velloza Kildaire d9fb911424
Update README.md 2023-09-25 13:57:01 +02:00
Tristan B. Velloza Kildaire 46fcb3c5d2
Update README.md 2023-09-25 13:55:59 +02:00
Tristan B. Velloza Kildaire cffb5dbdf0
Update d.yml 2023-09-25 13:53:09 +02:00
Tristan B. Velloza Kildaire 0944b9a6ae
Update d.yml 2023-09-25 13:52:39 +02:00
Tristan B. Velloza Kildaire 50acc144de
Update d.yml 2023-09-25 13:52:00 +02:00
Tristan B. Velloza Kildaire a85285849f
Update d.yml 2023-09-25 13:50:09 +02:00
Tristan B. Velloza Kildaire 2e499d267f Merge branch 'master' into feature/timeoutable_gets 2023-09-25 13:47:34 +02:00
Tristan B. Velloza Kildaire 718b644535
Merge pull request #3 from deavmi/feature/cancellable_future
Cancellable future's
2023-09-25 13:45:17 +02:00
Tristan B. Velloza Kildaire 3faa9a0f56 Merge branch 'master' into feature/cancellable_future 2023-09-24 23:57:46 +02:00
Tristan B. Velloza Kildaire 4f1f843d43 CoapPacket
- Added stub `orderOptions()` type which will re-order the current options and then return a new re-ordered array for encoding properly
- Added stub `encodeOption(CoapOption)` which returns the encoded option as a `ubyte[]`
- `getBytes()` has stub code to call `orderOption()`, iterate over itsm items and call `encodeOption()` on each
2023-09-24 23:57:26 +02:00
Tristan B. Velloza Kildaire 573deec14b CoapRequestBase
- Added `get(Duration)` which times out after the provided time has elapsed
2023-09-22 20:04:25 +02:00
Tristan B. Velloza Kildaire 094d59feb1 CoapRequestFuture
- Added `getState()`
- Cleaned up whitespace
2023-09-22 19:55:56 +02:00
Tristan B. Velloza Kildaire 2b2641f479 Package
- Make `RequestState` available

CoapRequestFuture

- Made `RequestState` public
- Documented it
2023-09-22 19:54:11 +02:00
Tristan B. Velloza Kildaire d659c2348b CoapClient
- When `close()` is called we will unblock all active `get()` calls to futures
2023-09-22 19:06:06 +02:00
Tristan B. Velloza Kildaire e790cf2ec0 erge branch 'master' into feature/cancellable_future 2023-09-22 19:02:29 +02:00
Tristan B. Velloza Kildaire 05557fc63c CoapRequestBuilder
- You can now call `con()` to make the message confirmable
- You can now call `non()` to make the message non-confirmable
- Messages are now by default confirmable
2023-09-22 19:02:06 +02:00
Tristan B. Velloza Kildaire bf834a92c8 Merge branch 'master' into feature/cancellable_future 2023-09-22 18:51:47 +02:00
Tristan B. Velloza Kildaire c1be1b39cf README
- Added example usage
- Added link documentation
2023-09-22 18:51:24 +02:00
Tristan B. Velloza Kildaire 8dfab918d9 Branding
- Added branding

README

- Added logo
2023-09-22 18:46:18 +02:00
Tristan B. Velloza Kildaire 7a30195d10 CoapRequestFuture
- Fixed `receiveWake(CoapPacket response)` to use `notifyAll()`
2023-09-22 18:40:13 +02:00
Tristan B. Velloza Kildaire ae0161860a CoapRequestFuture
- Added `RequestState` enum
- State if `CREATED` on construction
- Calling `receiveWake(CoapPacket)` now sets the state to `COMPLETED`
- Calling `cancel()` now sets the state to `CANCELLED`
2023-09-22 18:39:49 +02:00
Tristan B. Velloza Kildaire 8a1b1f8ea1 Merge branch 'master' into feature/cancellable_future 2023-09-22 18:33:27 +02:00
Tristan B. Velloza Kildaire 9e48f21ff1 CoapRequestFuture
- Fixed problem where multiple threads calling  `get()` would not all be woken up on the completion of the future due to usage of `notify()` instead of `notifyAll()`
2023-09-22 18:32:02 +02:00
Tristan B. Velloza Kildaire 5eac338517 CoapRequestFuture
- Added new method `cancel()` (WIP)
2023-09-22 18:29:45 +02:00
Tristan B. Velloza Kildaire e354a33bcb CoapMessagingLayer
- Now inherits from `CoapMessagingLayerFR`
- Migrated to it

CoapClient

- Migrated to `CoapMessagingLayerFR`
2023-09-22 18:00:49 +02:00
Tristan B. Velloza Kildaire 013886c79f
Merge pull request #2 from deavmi/hotfix/composed_thread_for_udp
Composed thread
2023-09-22 17:57:29 +02:00
Tristan B. Velloza Kildaire a8cee217f7 CoapMessagingLayer
- Using a composed `Thread` instead of inheriting from `Thread`
2023-09-22 17:55:52 +02:00
Tristan B. Velloza Kildaire 8fa139b038 CoapMessagingLayerFR
- Added abstract methods `begin()`, `send(CoapPacket)` and `close()`
2023-09-22 17:51:20 +02:00
Tristan B. Velloza Kildaire faa9bc1bc1 CoapMessagingLayerFR
- Added method `getEndpointAddress()`
2023-09-22 17:49:10 +02:00
Tristan B. Velloza Kildaire 1004d027cb Package
- Publically import `client` module

Client

- Added package declaration
2023-09-22 17:47:58 +02:00
Tristan B. Velloza Kildaire 0494a0fd74 CoapMessagingLayerFR
- Added missing imports
- Added `getClient()` method
- Removed the super constructor call
2023-09-22 17:43:13 +02:00
Tristan B. Velloza Kildaire f4a4258f87 CoapMessagingLayerFR
- Added new stub abstract class
2023-09-22 17:41:16 +02:00
Tristan B. Velloza Kildaire d2661421bd CoapMessagingLayer
- Fixed bug whereby OUR running status was not being used
2023-09-22 17:39:25 +02:00
Tristan B. Velloza Kildaire 6652cb1467
Merge pull request #1 from deavmi/hotfix/migrate_socket
Hotfix/migrate socket
2023-09-22 17:38:20 +02:00
Tristan B. Velloza Kildaire 114e780be5 CoapMessagingLayer
- Documented `begin()`, `send(CoapPacket)` and `close()`
2023-09-22 17:36:45 +02:00
Tristan B. Velloza Kildaire 3dc5fe4feb CoapMessagingLayer
- Added a TODO
2023-09-22 17:24:28 +02:00
Tristan B. Velloza Kildaire 0c81ce635f CoapClient
- Removed the `Socket` instance
- `init()` now calls `begin()` on the messaging layer and no longer creates a new `Socket` itself
- `close()` now just calls `close()` on the messaging layer
- `transmitRequest(CoapRequest)` now calls `send(CoapPacket)` on the messaging layer instead of via a socket's `send(ubyte[])`

CoapMessagingLayer

- Added a `running` flag
- Added `begin()` which sets the running flag (ours) to `true`, it then creates and opens a `Socket` and then starts the reading loop
- Added `send(CoapPacket)` whcih wire-encoded the packet and then sends it over our `Socket`
- Added `close()` which sets the running flag to false, shutsdown the `Socket` (unblocking any blocking receives) and then closes the `Socket` (releasing the bound datagram port)
- Removed references to the `CoapClient`'s now-non-existent `Socket`
2023-09-22 17:19:38 +02:00
Tristan B. Velloza Kildaire 76feaade27 CoapMessagingLayer
- Made `getEndpointAddress()` protected
- Added documentation for `getEndpointAddress()`
2023-09-22 16:57:39 +02:00
Tristan B. Velloza Kildaire 0fb0149d9d CoapClient
- Made `address` package-accessible

CoapMessagingLayer

- Added `getEndpointAddress()` which returns the associated `CoapClient`'s address
2023-09-22 16:56:48 +02:00