Add a capability query for image number
In addition to the binary capability flags, add a query function that
returns the number of images MCUboot has been configured to support.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/bootutil/src/caps.c b/boot/bootutil/src/caps.c
index 83b4dfa..b449a6b 100644
--- a/boot/bootutil/src/caps.c
+++ b/boot/bootutil/src/caps.c
@@ -47,3 +47,12 @@
return res;
}
+
+uint32_t bootutil_get_num_images(void)
+{
+#if defined(MCUBOOT_IMAGE_NUMBER)
+ return MCUBOOT_IMAGE_NUMBER;
+#else
+ return 1;
+#endif
+}