5 Replies Latest reply on Feb 13, 2015 4:31 PM by radiofrequency

    Bluetooth as Master on the Galileo

    radiofrequency

      Hello I am using the iteadstudio bluetooth shield, and I wanted to configure it as a master via sending commands using HardwareSerial library but it doesn't seem to work.

       

      This is the code I have

       

      Serial.begin(CBR_9600, Serial.SERIAL_8N1);
        executeCmd("AT+ROLE=1");
        executeCmd("AT+INIT");
      
      String executeCmd(String command)
      {
        inq.clear();
          Serial.println(command);
          int MAX_INPUT = 1000;
          char input_line [MAX_INPUT];
          unsigned int input_pos = 0;
         while(1){
        if (Serial.available()){
              char inputByte = Serial.read();
       switch (inputByte)
            {
              case '\n': 
              input_line [input_pos] = 0;
              input_pos = 0; 
              Serial.println(input_line);
              break;
            case '\r':
              break;
            default:
              if (input_pos < (MAX_INPUT - 1))
                input_line [input_pos++] = inputByte;
              break;
      
      
            }
        }
         }
      }
      

       

      The serial.aviable() is always false, has anyone gotten this to work, I am also using windows o/s on the galileo for iot.