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

Function drcSetupNet

wiringPi/drcNet.c:340–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338 */
339
340int drcSetupNet (const int pinBase, const int numPins, const char *ipAddress, const char *port, const char *password)
341{
342 int fd, len ;
343 struct wiringPiNodeStruct *node ;
344
345 if ((fd = _drcSetupNet (ipAddress, port, password)) < 0)
346 return false ;
347
348 len = sizeof (struct drcNetComStruct) ;
349
350 if (setsockopt (fd, SOL_SOCKET, SO_RCVLOWAT, (void *)&len, sizeof (len)) < 0)
351 return false ;
352
353 node = wiringPiNewNode (pinBase, numPins) ;
354
355 node->fd = fd ;
356 node->pinMode = myPinMode ;
357 node->pullUpDnControl = myPullUpDnControl ;
358 node->analogRead = myAnalogRead ;
359 node->analogRead = myAnalogRead ;
360 node->analogWrite = myAnalogWrite ;
361 node->digitalRead = myDigitalRead ;
362 node->digitalWrite = myDigitalWrite ;
363 node->pwmWrite = myPwmWrite ;
364
365 return true ;
366}

Callers 2

doExtensionDrcNetFunction · 0.85
mainFunction · 0.85

Calls 2

_drcSetupNetFunction · 0.85
wiringPiNewNodeFunction · 0.85

Tested by

no test coverage detected