* Make content type optional in az_mqtt5_rpc_server_hfsm
* Do not append content type if is AZ_SPAN_EMPTY in command response (server)
* Allow sending command request with empty content type
* Address CR comments
* Add documentation in unit test function
* rename rpc codec files to have codec in name
* rename rpc policy files to not have policy in the name
* first round of renames
* more codec naming updates
* remove uints where not needed
* style
* base files for client sample/hfsm
* filled in basic client hfsm implementation and sample. Sending command flow mostly functional, receiving command flow still needs property parsing. Initial command also not being sent yet
* switch to using az_context instead of timer in application, add common rpc.h file, parse mqtt5 properties on command response and validation
* add rpc_client_start and invoke errors
* updates from UML review
* add unsubscribe support for mqtt and rpc client
* move handling responses to the root state since it's the same in all
* handle unsubscribe req from any state
* cleanup
* cleanup
* style
* enable multiple rpc clients
* addressing first round of PR comments
* remove handle by superstate
* pass server executor id on command invocation
* remove parsing failure bool and have parse response return az_result instead of rsp struct
* move status check to shared codec
* move sending inbound event that rpc client can receive commands from entry event on Ready to transitions to Ready
* remove pointer to az_span for creating the subscription topic
* naming & comments
* use _az_hfsm_send_event to keep events within that rpc client instance
* rename hfsm to policy to more clearly separate the difference between the rpc_client and the rpc_client_policy
* rename long running operations to begin instead of request
* change pending commands from being dynamically allocated to being statically allocated
* update correlation id log
* style
* move all incoming pub recv processing to Ready
* move puback handling and pub mid tracking to the hfsm instead of the application. Adds new limitation of only 1 outstanding pub at a time until the puback is received
* doxygen
* style
* add base unit tests for rpc_client
* addressing PR comments
* add base unit test for rpc_client_policy
* add timeout to publishing
* more unit tests
* more unit tests
* updates from feature/v2
* more unit tests
* ensure free of properties
* cleanup
* style
* cleanup
* cleanup
* split rpc server into policy and main codec struct
* merge in mqtt init changes
* add rpc server unit tests and make topics actually customizable
* test custom properties
* style
* cleanup tests
* more server unit tests
* separate server into codec and add more unit tests
* style
* doxygen
* address PR comments
* add sample for handling multiple commands with server and client on same device
* add client to sample and add support for one client handling multiple commands under the same subscription
* address PR comments
* addressing PR comments
* style
* changes needed to work with server updates
* doxygen fix
* PR comment & spelling
* test updates
* updates to naming and no more requirements of some fields
* take recommendations from other PR feedback
* style
* cleanup
* feedback from other PRs
* parity with client sample
* ensure properties get free'd every time in server hfsm
* move common rpc code to rpc.c instead of all being inline in rpc.h
* cleanup
* style
* build fix
* build fix
* build fix
* add unit tests for get topic from format & fix bugs in it
* style
* fix correlation id memory error on back pubacks
* addressing PR comments
* addressing PR comments
* make loop changes to client & server sample
* refactor topic generation to use functions & remove the need for formats to include the null terminator
* optimize topic generation
* add details about client command expiration
* style
* use platform mutex and sleep in samples
* use platform timer in samples
* pr comments
* style
* fixes from merging from feature/v2
* align multiple sample to use same cert/broker setup as other samples
* style
* add null terminator to response topics and move timer within mutex
* PR comments
* fix build error
* style
* base files for client sample/hfsm
* filled in basic client hfsm implementation and sample. Sending command flow mostly functional, receiving command flow still needs property parsing. Initial command also not being sent yet
* switch to using az_context instead of timer in application, add common rpc.h file, parse mqtt5 properties on command response and validation
* add rpc_client_start and invoke errors
* updates from UML review
* add unsubscribe support for mqtt and rpc client
* move handling responses to the root state since it's the same in all
* handle unsubscribe req from any state
* cleanup
* cleanup
* style
* enable multiple rpc clients
* addressing first round of PR comments
* remove handle by superstate
* pass server executor id on command invocation
* remove parsing failure bool and have parse response return az_result instead of rsp struct
* move status check to shared codec
* move sending inbound event that rpc client can receive commands from entry event on Ready to transitions to Ready
* remove pointer to az_span for creating the subscription topic
* naming & comments
* use _az_hfsm_send_event to keep events within that rpc client instance
* rename hfsm to policy to more clearly separate the difference between the rpc_client and the rpc_client_policy
* rename long running operations to begin instead of request
* change pending commands from being dynamically allocated to being statically allocated
* update correlation id log
* style
* move all incoming pub recv processing to Ready
* move puback handling and pub mid tracking to the hfsm instead of the application. Adds new limitation of only 1 outstanding pub at a time until the puback is received
* doxygen
* style
* add base unit tests for rpc_client
* addressing PR comments
* add base unit test for rpc_client_policy
* add timeout to publishing
* more unit tests
* more unit tests
* updates from feature/v2
* more unit tests
* ensure free of properties
* cleanup
* style
* cleanup
* cleanup
* merge in mqtt init changes
* style
* cleanup tests
* addressing PR comments
* style
* changes needed to work with server updates
* doxygen fix
* PR comment & spelling
* style
* feedback from other PRs
* address pr comments
* address PR comments
* move QOS definitions to az_mqtt5
* doxygen
* add rpc_server hfsm
* add mosquitto rpc server sample
* cleanup
* make sample easier to modify with personal values
* basic running instructions
* Changing naming to mqtt5
* Add publish v5 with properties plus naming changes
* Excluding files lacking coverage
* rename files
* update naming to mqtt5
* use new mqtt5 properties functions
* memory fix
* some clean-up and validation
* remove out_id needing to be a pointer
* switch property bag to be allocated for the lifetime of the rpc server
* split rpc server data from options
* add timeout
* add timeout
* create new data type for sending command to application for execution
* update naming with mqtt5 property changes
* add proper error response formatting, add notification to application for ignored commands because of current command processing, and send cancellation notification to application on timeout
* cleanup
* move execution timer to application and add subscribe timeout to hfsm
* update property bag to not be a pointer and add comments
* update property bag to not be a pointer and add comments
* add comments
* style
* style
* fix mosquitto memory leak
* support multiple rpc server instances
* first pass WIP at adding json serializer
* move content type handling to application
* cleanup
* fix json parser logging
* eof newlines
* remove usage of az_platform functions in the sample
* sample wording
* remove pending command from rpc server policy so it can handle multiple commands and transfer the ownership of knowing whether a command is being executed to the application
* update idle state a bit
* renaming from feedback
* Update README.md
* doc update
* style
* build fixes
* build fixes
* doxygen fixes
* add basic test as a start for code coverage checks
* address PR comments from previous PR
* naming for json parser
* style
* remove connected boolean from sample
* simplify states for rpc server and add fixes for multiple rpc server instances of different subscriptions
* add puml diagram for rpc server
* add puml and start of readme
* remove duplicate json parser files
* cleanup
* add link to state diagram
* style
* slice request topic to size so we can properly compare it
* fix test
* address PR comments
* address PR comments
* style and build fix
---------
Co-authored-by: RLeclair <raulleclair@microsoft.com>
* add rpc_server hfsm
* add mosquitto rpc server sample
* cleanup
* make sample easier to modify with personal values
* basic running instructions
* Changing naming to mqtt5
* Add publish v5 with properties plus naming changes
* Excluding files lacking coverage
* rename files
* update naming to mqtt5
* use new mqtt5 properties functions
* memory fix
* some clean-up and validation
* remove out_id needing to be a pointer
* switch property bag to be allocated for the lifetime of the rpc server
* split rpc server data from options
* add timeout
* add timeout
* create new data type for sending command to application for execution
* update naming with mqtt5 property changes
* add proper error response formatting, add notification to application for ignored commands because of current command processing, and send cancellation notification to application on timeout
* cleanup
* move execution timer to application and add subscribe timeout to hfsm
* update property bag to not be a pointer and add comments
* update property bag to not be a pointer and add comments
* add comments
* style
* style
* fix mosquitto memory leak
* support multiple rpc server instances
* first pass WIP at adding json serializer
* move content type handling to application
* cleanup
* fix json parser logging
* eof newlines
* remove usage of az_platform functions in the sample
* sample wording
* renaming from feedback
* Update README.md
* doc update
* style
* build fixes
* build fixes
* doxygen fixes
* add basic test as a start for code coverage checks
---------
Co-authored-by: RLeclair <raulleclair@microsoft.com>
* Adding mqtt connection with unit tests, subclient
* Adding extra coverage, addressing comments
* Adding more test coverage
* More test coverage
* Adjusting code coverage threshold
* Adding event policy, HFSM, and pipeline.
* Undoing small change
* Adding CODEOWNERS edit
* UTs and comment addressing
* Minor formatting correction
* Fixing macOS and Windows build
* Rename push ignore deprecations and pop warnings macro from AZ_ to _az_ to indicate they are for internal use only.
* Update paho_iot_pnp_with_provisioning_sample.c
* Update test_az_iot_provisioning_client_register_get_request_payload.c
* Update clang format to avoid unwanted indentation with statement macros
* Add null terminator for char* based json string unescape, and precondition on input length
* Add remark comment about precondition and null terimination
* Update doc comment typo
* Remove the test cases about insufficient space.
* Fix clang formatting.
* Add null terminator tests.
* Test that the null terminator is there at the end.
* Fix build errors.
* first pass
* A few small updates
* revert cmakesettings, and some file format
* fix char conv
* remove static
* pointerize
* test
* disable
* fix tests
* free
* lint
* the cmake of glory
* remove wrapper API
* remove build folder
* clang
* PR comments
* remark
* argh
* PR comments
* PR comments
* Test updates from PR
* added unit test for missing
* some more PR comments
* Actually use the COMCKA_LIB variable that we set in the top level CMakeLists.txt
* rename global_compile_options.txt to .cmake
This results in better colorization in editors, and is less suprising.
* add ADDRESS_SANITIZER option
* add asan to CI, use
* use - instead of / for sanitize=address, so things work with other compilers
* make the canary compiler-specific.
* make an imported target for cmocka if it's too old to have a real imported target.
* link asan when using gcc
* make only the static analysis lie compiler specific.
* use target_link_libraries and target_include_directories instead of set_property
This is required to properly expand build type keywords.
* Revert "use target_link_libraries and target_include_directories instead of set_property"
This reverts commit f10143e03b.
* Revert "make an imported target for cmocka if it's too old to have a real imported target."
This reverts commit fd708295b8.
* just do target detection, don't try and make an imported target
the imported target doesn't work because it has build type keywords.
* supress "asan needs debug mode for good error reporting.
* ignore the linker warning about better debug info too.
* Remove the canary
* Add asan to a debug linux build.
* whitespace
* whitespace mk2
* update readme to mention asan
* asan option description nits
* add some explenation of the changes to linker warnings
* add note about compiler warning as well.
* Revert the user agent property name from dct to DeviceClientType
Azure IoT Hub parses the user agent information using the property
name DeviceClientType, so the client must send it with that name
otherwise the user agent string is not properly stored on Azure.
A change in the property name to "dct" can only be done after the hub is
also updated to support that name/alias.
* Fix clang format for dct to DeviceClientType change
* Add total bytes written public field to the JSON writer, by moving it
from internal.
* Add doc comments to internal json writer fields.
* Fix typo in comment, close bracket.