Merge pull request #14 from cedricboudinet/master

Interface as an argument for sv_publisher_example
This commit is contained in:
mzillgith 2017-06-10 17:49:48 +02:00 committed by GitHub
commit dcbc3de0de

View file

@ -20,7 +20,16 @@ void sigint_handler(int signalId)
int
main(int argc, char** argv)
{
SampledValuesPublisher svPublisher = SampledValuesPublisher_create("eth0");
char* interface;
if (argc > 1)
interface = argv[1];
else
interface = "eth0";
printf("Using interface %s\n", interface);
SampledValuesPublisher svPublisher = SampledValuesPublisher_create(interface);
SV_ASDU asdu1 = SampledValuesPublisher_addASDU(svPublisher, "svpub1", NULL, 1);