Hi and sorry to raise an old quesiton again, but was advised to raise a new question.
I've seen an old thread about setting the hostname of an ESP8266 and Erel posted some code to asnwer to OP.
I've done this, but I keep getting an error saying 'wifi' was not declared in this scope.
It's probably something very silly I've done, but could someone advise.
Many thanks
Dave
I've seen an old thread about setting the hostname of an ESP8266 and Erel posted some code to asnwer to OP.
B4X:
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Dim bb() As Byte = "abc"
RunNative("SetHostName", bb)
End Sub
#if C
void SetHostName(B4R::Object* o) {
B4R::Array* b = (B4R::Array*)B4R::Object::toPointer(o);
char* c = (char*)b->data;
WiFi.hostname(c);
}
#end if
I've done this, but I keep getting an error saying 'wifi' was not declared in this scope.
It's probably something very silly I've done, but could someone advise.
Many thanks
Dave