]> git.feebdaed.xyz Git - 0xmirror/pigpio.git/commitdiff
Modify pigpio_start arguments
authorDawid Sabat <dawid.sabat93@gmail.com>
Fri, 18 Sep 2020 21:28:18 +0000 (23:28 +0200)
committerDawid Sabat <dawid.sabat93@gmail.com>
Fri, 18 Sep 2020 21:28:18 +0000 (23:28 +0200)
pigpiod_if2.c
pigpiod_if2.h
x_pigpiod_if2.c

index ab2ef10116306efa92f783fb526ff3b385c13c5e..64b0d150a6321b9117bdd1402ad2dc098080a4b8 100644 (file)
@@ -234,7 +234,7 @@ static int pigpio_command_ext
    return cmd.res;
 }
 
-static int pigpioOpenSocket(char *addrStr, char *portStr)
+static int pigpioOpenSocket(const char *addrStr, const char *portStr)
 {
    int sock, err, opt;
    struct addrinfo hints, *res, *rp;
@@ -685,7 +685,7 @@ void stop_thread(pthread_t *pth)
    }
 }
 
-int pigpio_start(char *addrStr, char *portStr)
+int pigpio_start(const char *addrStr, const char *portStr)
 {
    int pi;
    int *userdata;
index 9700cc09db5809366148b1c8eb0a75a3349300a1..4e3314db8be8a85098d33e07f5ec6226bb50a47e 100644 (file)
@@ -429,7 +429,7 @@ The thread to be stopped should have been started with [*start_thread*].
 D*/
 
 /*F*/
-int pigpio_start(char *addrStr, char *portStr);
+int pigpio_start(const char *addrStr, const char *portStr);
 /*D
 Connect to the pigpio daemon.  Reserving command and
 notification streams.
index c9b2c27fc5b3674bd7c22f9cba4c4c758293e56c..9422aee07a2867b0351e2fda2204a5f856d1d453 100644 (file)
@@ -77,6 +77,10 @@ void t1(int pi)
    gpio_write(pi, GPIO, PI_HIGH);
    v = gpio_read(pi, GPIO);
    CHECK(1, 6, v, 1, 0, "write, read");
+
+   v = pigpio_start(PI_DEFAULT_SOCKET_ADDR_STR, PI_DEFAULT_SOCKET_PORT_STR);
+   CHECK(1, 7, v, 31, 100, "pigpio_start with non-default arguments");
+   pigpio_stop(v);
 }
 
 int t2_count=0;