MCPcopy Create free account
hub / github.com/WiringPi/WiringPi / doExtensionDrcNet

Function doExtensionDrcNet

wiringPi/wpiExtensions.c:781–824  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

779 */
780
781static int doExtensionDrcNet (char *progName, int pinBase, char *params)
782{
783 int pins ;
784 char *ipAddress, *port, *password ;
785 char pPort [1024] ;
786
787 if ((params = extractInt (progName, params, &pins)) == NULL)
788 return false ;
789
790 if ((pins < 1) || (pins > 1000))
791 {
792 verbError ("%s: pins (%d) out of range (2-1000)", progName, pins) ;
793 return false ;
794 }
795
796 if ((params = extractStr (progName, params, &ipAddress)) == NULL)
797 return false ;
798
799 if (strlen (ipAddress) == 0)
800 {
801 verbError ("%s: ipAddress required", progName) ;
802 return false ;
803 }
804
805 if ((params = extractStr (progName, params, &port)) == NULL)
806 return false ;
807
808 if (strlen (port) == 0)
809 {
810 sprintf (pPort, "%d", DEFAULT_SERVER_PORT) ;
811 port = pPort ;
812 }
813
814 if ((params = extractStr (progName, params, &password)) == NULL)
815 return false ;
816
817 if (strlen (password) == 0)
818 {
819 verbError ("%s: password required", progName) ;
820 return false ;
821 }
822
823 return drcSetupNet (pinBase, pins, ipAddress, port, password) ;
824}
825
826
827

Callers

nothing calls this directly

Calls 4

extractIntFunction · 0.85
verbErrorFunction · 0.85
extractStrFunction · 0.85
drcSetupNetFunction · 0.85

Tested by

no test coverage detected