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

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

        return(BtConnector.readBuffer());
    }
Ejemplo n.º 3
0
 void Start()
 {
     if (mode2 && !stopReading && !mode0)
     {
         BtConnection.listen(true, length, terminalByte);
     }
     else if (!mode2 && !mode0 && !stopReading)
     {
         BtConnection.listen(true, length);
     }
     else if (stopReading && !mode2 && !mode0)
     {
         BtConnection.stopListen();
     }
 }
Ejemplo n.º 4
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("");
     }
 }
Ejemplo n.º 5
0
 public static void listen(bool start, int length, byte terminalByte)
 {
     BtConnection.listen(start, length, terminalByte);
 }
Ejemplo n.º 6
0
 public static void listen(bool start, int length)
 {
     BtConnection.listen(start, length, false);
 }
Ejemplo n.º 7
0
 public static void listen(bool start, int length, bool byteLimit)
 {
     BtConnection.listen(start, length, byteLimit);
 }
Ejemplo n.º 8
0
 public static void listen(bool start)
 {
     BtConnection.listen(start);
 }