UsbDkControl: Introduce ping CLI

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
This commit is contained in:
Dmitry Fleytman 2014-02-15 11:38:50 +02:00
parent 244ade2a35
commit 32154c09ef

View file

@ -15,6 +15,7 @@ void ShowUsage()
tcout << endl;
tcout << TEXT("UsbDkController -i - install UsbDk driver") << endl;
tcout << TEXT("UsbDkController -u - uninstall UsbDk driver") << endl;
tcout << TEXT("UsbDkController -p - TEMP: ping driver (verify control device is functional)") << endl;
tcout << endl;
}
//-------------------------------------------------------------------------------
@ -55,6 +56,21 @@ int __cdecl _tmain(int argc, _TCHAR* argv[])
tcout << TEXT("UsbDk driver uninstall failed") << endl;
}
}
else if (_tcsicmp(L"-p", argv[1]) == 0)
{
//TODO: Ping logic is temporary, to be removed after enumeration
//logic implemented
TCHAR Reply[10];
tcout << TEXT("Pinging UsbDk driver") << endl;
if (PingDriver(Reply, TBUF_SIZEOF(Reply)))
{
tcout << TEXT("UsbDk driver replied \"") << Reply << TEXT("\"") << endl;
}
else
{
tcout << TEXT("UsbDk ping failed") << endl;
}
}
else
{
ShowUsage();