From be439a8331fdcc839f9c88c9fed5fbd439848e87 Mon Sep 17 00:00:00 2001 From: kpl Date: Wed, 12 Feb 2020 13:22:48 -0500 Subject: [PATCH] Added cw::audio::device::report(); --- cwAudioDeviceTest.cpp | 7 +++++++ cwAudioDeviceTest.h | 1 + main.cpp | 49 ++++++++++++++++++++++++++++++++++++------- 3 files changed, 49 insertions(+), 8 deletions(-) diff --git a/cwAudioDeviceTest.cpp b/cwAudioDeviceTest.cpp index a5d087a..62f4e85 100644 --- a/cwAudioDeviceTest.cpp +++ b/cwAudioDeviceTest.cpp @@ -272,4 +272,11 @@ cw::rc_t cw::audio::device::test( int argc, const char** argv ) /// [cmAudioPortExample] +cw::rc_t cw::audio::device::report() +{ + const char* argv[] = { "-p" }; + return test(0,argv); +} + + diff --git a/cwAudioDeviceTest.h b/cwAudioDeviceTest.h index a86d068..605780f 100644 --- a/cwAudioDeviceTest.h +++ b/cwAudioDeviceTest.h @@ -8,6 +8,7 @@ namespace cw namespace device { rc_t test( int argc, const char** argv ); + rc_t report(); } } } diff --git a/main.cpp b/main.cpp index 8af40fc..e3c6ced 100644 --- a/main.cpp +++ b/main.cpp @@ -24,6 +24,8 @@ #include "cwTcpSocketSrv.h" #include "cwTcpSocketTest.h" #include "cwMdns.h" +#include "cwDnsSd.h" +#include "cwEuCon.h" //#include "cwNbMem.h" #include @@ -135,6 +137,7 @@ void textBufTest( cw::object_t* cfg, int argc, const char* argv[] ) { cw:: void audioBufTest( cw::object_t* cfg, int argc, const char* argv[] ) { cw::audio::buf::test(); } void audioDevTest( cw::object_t* cfg, int argc, const char* argv[] ) { cw::audio::device::test( argc, argv ); } void audioDevAlsaTest( cw::object_t* cfg, int argc, const char* argv[] ) { cw::audio::device::alsa::report(); } +void audioDevRpt( cw::object_t* cfg, int argc, const char* argv[] ) { cw::audio::device::report(); } //void nbmemTest( cw::object_t* cfg, int argc, const char* argv[] ) { cw::nbmem::test(); } void socketTest( cw::object_t* cfg, int argc, const char* argv[] ) @@ -171,16 +174,30 @@ void socketTestTcp( cw::object_t* cfg, int argc, const char* argv[] ) } } -void socketSrvTest( cw::object_t* cfg, int argc, const char* argv[] ) +void socketSrvUdpTest( cw::object_t* cfg, int argc, const char* argv[] ) { - if( argc >= 3 ) + if( argc >= 4 ) { unsigned short localPort = atoi(argv[1]); - unsigned short remotePort = atoi(argv[2]); + const char* remoteIp = argv[2]; + unsigned short remotePort = atoi(argv[3]); - printf("local:%i remote:%i\n", localPort, remotePort); + printf("local:%i to remote:%s %i\n", localPort, remoteIp, remotePort); - cw::net::srv::test( localPort, "127.0.0.1", remotePort ); + cw::net::srv::test_udp_srv( localPort, remoteIp, remotePort ); + } +} +void socketSrvTcpTest( cw::object_t* cfg, int argc, const char* argv[] ) +{ + if( argc >= 4 ) + { + unsigned short localPort = atoi(argv[1]); + const char* remoteIp = argv[2]; + unsigned short remotePort = atoi(argv[3]); + + printf("local:%i to remote:%s %i\n", localPort, remoteIp, remotePort); + + cw::net::srv::test_tcp_srv( localPort, remoteIp, remotePort ); } } @@ -189,6 +206,16 @@ void socketMdnsTest( cw::object_t* cfg, int argc, const char* argv[] ) cw::net::mdns::test(); } +void dnsSdTest( cw::object_t* cfg, int arg, const char* argv[] ) +{ + cw::net::dnssd::test(); +} + +void euConTest( cw::object_t* cfg, int arg, const char* argv[] ) +{ + cw::net::eucon::test(); +} + void dirEntryTest( cw::object_t* cfg, int argc, const char* argv[] ) { @@ -219,10 +246,12 @@ void stubTest( cw::object_t* cfg, int argc, const char* argv[] ) v_t v; printf("%i %i %p\n",v.x,v.y,v.z); */ - + /* const char* s = "\x16lmac=00-90-D5-80-F4-DE\x7dummy=0"; printf("len:%li\n",strlen(s)); - + */ + + } @@ -251,11 +280,15 @@ int main( int argc, const char* argv[] ) { "audioBuf", audioBufTest }, { "audioDev",audioDevTest }, { "audioDevAlsa", audioDevAlsaTest }, + { "audioDevRpt", audioDevRpt }, //{ "nbmem", nbmemTest }, { "socket", socketTest }, { "socketTcp", socketTestTcp }, - { "socketSrv", socketSrvTest }, + { "socketSrvUdp", socketSrvUdpTest }, + { "socketSrvTcp", socketSrvTcpTest }, { "socketMdns", socketMdnsTest }, + { "dnssd", dnsSdTest }, + { "eucon", euConTest }, { "dirEntry", dirEntryTest }, { "stub", stubTest }, { nullptr, nullptr }