#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 600
#End Region
'Ctrl+Click to open the C code folder: ide://run?File=%WINDIR%\System32\explorer.exe&Args=%PROJECT%\Objects\Src
Sub Process_Globals
Public Serial1 As Serial
Private wifi As ESP8266WiFi
Private serialnative2 As Stream
Private astream As AsyncStreams
Private RXD2,TXD2 As Byte 'ignore
Private bc As ByteConverter
Private LeDCount As Int = 60
Public RBG_LIGHT As AdafruitNeoPixel 'RGB WITH WS2812 - OUTPUT
Dim endChar As String = JoinStrings ( Array As String ( 0xff , 0xff , 0xff))
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
astream.Initialize(serialnative2, "astream_NewData", Null)
'example of connecting to a local network
RBG_LIGHT.Initialize(LeDCount,26,RBG_LIGHT.NEO_GRB) 'change led count as import!! to show! Rnd
RXD2 = 4
TXD2 = 2
RunNative("SerialNative2", Null)
Dim nodeInt As Int = wifi.Scan
Dim nodeString As String = nodeInt
GlobalStore.Put(5,nodeString)
Log(GlobalStore.Slot5)
Dim quot() As Byte = bc.HexToBytes(22)
'Dim SSID As String = JoinStrings( Array As String("<cb0.path=cb0.path+",bc.StringFromBytes(quot),wifi.ScannedSSID(i),bc.StringFromBytes(quot),">"))
' Dim SSID As String = JoinStrings( Array As String("t0.txt=\",bc.StringFromBytes(quot),wifi.ScannedSSID(0),"\",bc.StringFromBytes(quot)))
' Log(SSID.GetBytes)
' astream.Write(SSID.GetBytes)
' Dim k() As Byte = "0xff"
' astream.Write(k)
' astream.Write(k)
' astream.Write(k)
Log("write Array")
astream.Write("t2.txt=\""abcd""\").Write(Array As Byte(0xFF, 0xFF, 0xFF))
astream.Write("t2.txt=""abcd""").Write(Array As Byte(0xFF, 0xFF, 0xFF))
astream.Write("t2.txt=""abcd""").Write(Array As Byte(0xFF, 0xFF, 0xFF))
End Sub
#if C
void SerialNative2(B4R::Object* unused){
::Serial2.begin(9600, SERIAL_8N1, b4r_main::_rxd2, b4r_main::_txd2);
b4r_main::_serialnative2->wrappedStream = &::Serial2;
}
#End if