NordicSemiconductor / IOS-nRF-Connect-Device-Manager

A mobile management library for devices supporting nRF Connect Device Manager.
https://www.nordicsemi.com/Software-and-tools/Software/nRF-Connect-SDK
Apache License 2.0
87 stars 38 forks source link

Added Support for SMPv2 Errors #147

Closed dinesharjani closed 9 months ago

dinesharjani commented 9 months ago

In SMPv2, now only is the Request SMP Version part of the Header now, but also Groups are allowed to return their own specific Errors. To make the API as smooth (https://www.youtube.com/watch?v=4TYv2PhG89A) as possible, without breaking too many things but also making use of the language, we made the response return a Result<>, since that's what it was designed to do in cases where one must check whether there's an error or a success scenario. We made our own custom error enum that can bridge both types of error, the precious McuMgr "RC" values and all the new Errors dependant on the Request's Group ID. Not all Groups are supported, I tried to add the Errors for the Groups we already have some semblance of support for. And as usual for a change this big, there will be errors and issues. But it is a step.