mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-04 06:39:53 +00:00
added address and port to socket_connection_open_tcp
This commit is contained in:
parent
913f4ccbaf
commit
34905c0dee
@ -430,7 +430,7 @@ void socket_connection_send_packet_all(uint16_t type, uint16_t channel, uint8_t
|
|||||||
/**
|
/**
|
||||||
* create socket connection to BTdaemon
|
* create socket connection to BTdaemon
|
||||||
*/
|
*/
|
||||||
connection_t * socket_connection_open_tcp(){
|
connection_t * socket_connection_open_tcp(const char *address, uint16_t port){
|
||||||
// TCP
|
// TCP
|
||||||
struct protoent* tcp = getprotobyname("tcp");
|
struct protoent* tcp = getprotobyname("tcp");
|
||||||
|
|
||||||
@ -441,8 +441,8 @@ connection_t * socket_connection_open_tcp(){
|
|||||||
// localhost
|
// localhost
|
||||||
struct sockaddr_in btdaemon_address;
|
struct sockaddr_in btdaemon_address;
|
||||||
btdaemon_address.sin_family = AF_INET;
|
btdaemon_address.sin_family = AF_INET;
|
||||||
btdaemon_address.sin_port = htons(BTSTACK_PORT);
|
btdaemon_address.sin_port = htons(port);
|
||||||
struct hostent* localhost = gethostbyname("localhost");
|
struct hostent* localhost = gethostbyname(address);
|
||||||
if(!localhost){
|
if(!localhost){
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ int socket_connection_close_tcp(connection_t *connection);
|
|||||||
/**
|
/**
|
||||||
* create TCP socket connection to BTdaemon
|
* create TCP socket connection to BTdaemon
|
||||||
*/
|
*/
|
||||||
connection_t * socket_connection_open_tcp();
|
connection_t * socket_connection_open_tcp(const char *address, uint16_t port);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* close TCP socket connection to BTdaemon
|
* close TCP socket connection to BTdaemon
|
||||||
|
Loading…
x
Reference in New Issue
Block a user