Spinel vendor hooks - how to access received frame in VendorHandleValueIs(aKey) #11987
Replies: 1 comment 2 replies
-
|
Support for the I am not personally familiar with the I designed the It appears It seems reasonable to me to update @thcu-gp, can you also please provide your input? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
TLDR: I don't understand how I can get access to the received data (body) in
VendorHandleValueIs(aKey), it is not passed as parameter and doesn't seem to be available otherwise. Am I misunderstanding how to use these hooks?I'm trying to use the Spinel Vendor Hooks to communicate with an RCP while the OpenThread stack is running. In particular, to stream raw bytes data back and forth (cut into Spinel frames of course). My host is a POSIX system, the RCP node is running on an ESP32C6 (FreeRtos based firmware with ESP HAL and OpenThread).
I couldn't find any documentation, but I did find
example_vendor_hook.hppand.cpp. I reverse engineered how everything should probably work and successfully setOT_SPINEL_VENDOR_HOOK_HEADER,OT_SPINEL_VENDOR_HOOK_SOURCEandOT_SPINEL_VENDOR_HOOK_SOURCE_DIR`.I'm currently focussing on the host side, which should be the master and initiate setting a property (raw data stream) and then expects a response (raw data).
Looking at
example_vendor_hook.*, and the source code ofradio_spinel.cppI arrived at the following implementation ofVendorRadioSpinel.I think I understand how to use
Set()and how this will generate a Spinel frame and send it.However, I don't understand how to get the incoming data. I found that:
VendorHandleValueIs(aKey)is invoked byvoid RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer, uint16_t aLength). This function is a largeif/elsetrain with handlers for eachaKey.aBufferandaLength) are unpacked / used to process the incoming value.else ifblock) the call toVendorHandleValueIs(aKey)is made,aBufferandaLengthare not passed.The comments in
example_vendor_hook.cppandradio_spinel.hppdescribingVendorHandleValueIs(aKey)are contradicting each other. One is saying data should be fetched from "the NCP buffer". The other is saying data should be pushed into "the NCP buffer". It is not clear to me how to do either of those things.I don't understand how I can get access to the received data (body) in
VendorHandleValueIs(aKey)if it is not passed. Am I misunderstanding how to use these hooks?Thank you for any input you may provide.
Beta Was this translation helpful? Give feedback.
All reactions