added address and port to socket_connection_open_tcp

This commit is contained in:
matthias.ringwald 2010-02-28 21:39:54 +00:00
parent 913f4ccbaf
commit 34905c0dee
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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