From 6f2d8b6b2298697239e103bcd7d3c794e17f479b Mon Sep 17 00:00:00 2001 From: Li Cao Date: Tue, 16 Jul 2024 01:43:40 +0800 Subject: [PATCH] [spinel] add get iid method (#10516) This commit adds a method to get spinel interface Id in `SpinelDriver`. This is to enable the user class of `SpinelDriver` can compose the spinel header itself. --- src/lib/spinel/spinel_driver.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/spinel/spinel_driver.hpp b/src/lib/spinel/spinel_driver.hpp index 5a3090c83..0c3657f6f 100644 --- a/src/lib/spinel/spinel_driver.hpp +++ b/src/lib/spinel/spinel_driver.hpp @@ -210,6 +210,14 @@ public: */ bool CoprocessorHasCap(unsigned int aCapability) { return mCoprocessorCaps.Contains(aCapability); } + /** + * Returns the spinel interface id. + * + * @returns the spinel interface id. + * + */ + spinel_iid_t GetIid(void) { return mIid; } + private: static constexpr uint16_t kMaxSpinelFrame = SPINEL_FRAME_MAX_SIZE; static constexpr uint16_t kVersionStringSize = 128;