mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-25 18:35:17 +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
|
||||
*/
|
||||
connection_t * socket_connection_open_tcp(){
|
||||
connection_t * socket_connection_open_tcp(const char *address, uint16_t port){
|
||||
// TCP
|
||||
struct protoent* tcp = getprotobyname("tcp");
|
||||
|
||||
@ -441,8 +441,8 @@ connection_t * socket_connection_open_tcp(){
|
||||
// localhost
|
||||
struct sockaddr_in btdaemon_address;
|
||||
btdaemon_address.sin_family = AF_INET;
|
||||
btdaemon_address.sin_port = htons(BTSTACK_PORT);
|
||||
struct hostent* localhost = gethostbyname("localhost");
|
||||
btdaemon_address.sin_port = htons(port);
|
||||
struct hostent* localhost = gethostbyname(address);
|
||||
if(!localhost){
|
||||
return NULL;
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ int socket_connection_close_tcp(connection_t *connection);
|
||||
/**
|
||||
* 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user