Esempio n. 1
0
    public static byte [] readBuffer(int length)
    {
        if (BtConnection.mode() != 1)
        {
            BtConnection.listen(true, length, false);
        }

        return(BtConnector.readBuffer());
    }
Esempio n. 2
0
    public static byte [] readBuffer(int length, byte stopByte)
    {
        if (BtConnection.mode() != 2)
        {
            BtConnection.listen(true, length, stopByte);
        }

        return(BtConnection.readBuffer(length, stopByte));
    }
Esempio n. 3
0
 //it will read as specified in the inspector
 public static string readLine()
 {
     if (BtConnection.mode() != 0)
     {
         BtConnection.listen(true);
     }
     if (dataAvailable)
     {
         dataAvailable = false;
         string tempMessage = message;
         BtConnection.doneReading();
         return(tempMessage);
     }
     else
     {
         return("");
     }
 }