IP reading, base of changeable port
This commit is contained in:
parent
c70d18433f
commit
fd112119c7
1 changed files with 9 additions and 3 deletions
|
@ -31,10 +31,16 @@ bool readSettings(void) {
|
||||||
if(ret) return false;
|
if(ret) return false;
|
||||||
|
|
||||||
strncpy(settings.IPString, (char *)buffer, 15);
|
strncpy(settings.IPString, (char *)buffer, 15);
|
||||||
buffer[15] = '\0';
|
settings.IPString[15] = '\0';
|
||||||
|
|
||||||
//inet_pton(AF_INET, buffer, &(saout.sin_addr));
|
if(strchr(settings.IPString, ':')) {
|
||||||
inet_pton4((const char *)buffer, (unsigned char *)&(saout.sin_addr));
|
settings.IPString[strchr(settings.IPString, ':') - settings.IPString] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Todo, get port number and use it
|
||||||
|
|
||||||
|
//inet_pton(AF_INET, settings.IPString, &(saout.sin_addr));
|
||||||
|
inet_pton4(settings.IPString, (unsigned char *)&(saout.sin_addr));
|
||||||
|
|
||||||
settings.port = DEFAULT_PORT;
|
settings.port = DEFAULT_PORT;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue