Hello,
I am attempting to write a simple Lua dissector that displays a BLE advertisement's raw payload data, nothing fancy. I am using a nRF BLE Sniffer Dongle & the related capture plugin to capture the BLE advertisements.
However, after running the script on some example vendor/manufacturer-specific advertisements, the raw payload data is returned with the value <missing>. I tried diagnosing using the console, but it seems like printing the value is working.
Please see the below code:
local msgData = Field.new('btcommon.eir_ad.entry.data')
local bgNotificationData = Proto('bgadv', 'Background Notification Data')
local rawMessage = ProtoField.bytes('bgadv.data')
bgNotificationData.fields =
{
rawMessage,
}
function bgNotificationData.dissector(tvb, pinfo, tree)
local btMsgData = msgData()
local subtree = tree:add(bgNotificationData, btMsgData, "Message Data")
subtree:add(rawMessage, tostring(btMsgData))
end
register_postdissector(bgNotificationData)
I have a feeling the issue is in the below line:
subtree:add(rawMessage, tostring(btMsgData))
But I can't find any info about subtree:add returning the value <missing>. Any help would be great, TIA!