[test] add expect tests for pcap receiving (#5043)

This adds expect tests for testing the pcap receiving function of
promiscuous mode. Also makes otLinkSetPromiscuous be called before
otLinkSetPcapCallback so that the callback won't be set when
promiscuous mode fails to start.
This commit is contained in:
Moandor
2020-06-04 13:11:14 +08:00
committed by GitHub
parent 201b7b1a3d
commit ea7c76cc4b
2 changed files with 21 additions and 5 deletions
+1 -1
View File
@@ -2433,8 +2433,8 @@ void Interpreter::ProcessPromiscuous(uint8_t aArgsLength, char *aArgs[])
{
if (strcmp(aArgs[0], "enable") == 0)
{
otLinkSetPcapCallback(mInstance, &HandleLinkPcapReceive, this);
SuccessOrExit(error = otLinkSetPromiscuous(mInstance, true));
otLinkSetPcapCallback(mInstance, &HandleLinkPcapReceive, this);
}
else if (strcmp(aArgs[0], "disable") == 0)
{