mirror of https://github.com/joan2937/pigpio
Modify pigpio_start arguments
This commit is contained in:
parent
d5961b9de2
commit
b99a538aee
|
@ -234,7 +234,7 @@ static int pigpio_command_ext
|
||||||
return cmd.res;
|
return cmd.res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pigpioOpenSocket(char *addrStr, char *portStr)
|
static int pigpioOpenSocket(const char *addrStr, const char *portStr)
|
||||||
{
|
{
|
||||||
int sock, err, opt;
|
int sock, err, opt;
|
||||||
struct addrinfo hints, *res, *rp;
|
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 pi;
|
||||||
int *userdata;
|
int *userdata;
|
||||||
|
|
|
@ -429,7 +429,7 @@ The thread to be stopped should have been started with [*start_thread*].
|
||||||
D*/
|
D*/
|
||||||
|
|
||||||
/*F*/
|
/*F*/
|
||||||
int pigpio_start(char *addrStr, char *portStr);
|
int pigpio_start(const char *addrStr, const char *portStr);
|
||||||
/*D
|
/*D
|
||||||
Connect to the pigpio daemon. Reserving command and
|
Connect to the pigpio daemon. Reserving command and
|
||||||
notification streams.
|
notification streams.
|
||||||
|
|
|
@ -77,6 +77,10 @@ void t1(int pi)
|
||||||
gpio_write(pi, GPIO, PI_HIGH);
|
gpio_write(pi, GPIO, PI_HIGH);
|
||||||
v = gpio_read(pi, GPIO);
|
v = gpio_read(pi, GPIO);
|
||||||
CHECK(1, 6, v, 1, 0, "write, read");
|
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;
|
int t2_count=0;
|
||||||
|
|
Loading…
Reference in New Issue