Exemplo n.º 1
0
bool Adafruit_BLE::echo(bool enable)
{
  print("ATE=");
  println((int)enable);

  return waitForOK();
}
Exemplo n.º 2
0
bool TheThingsUno::sendCommand(String cmd, int waitTime) {
  debugPrintLn("Sending: " + cmd);

  modemStream->println(cmd);

  return waitForOK(waitTime);
}
Exemplo n.º 3
0
bool Adafruit_BLE::sendCommandWithIntReply(const char cmd[], int32_t *reply) {
  println(cmd);                   // send command
  if (_verbose) {
    SerialDebug.print("\n<- ");
  }
  (*reply) = readline_parseInt(); // parse integer response
  return waitForOK();
}
Exemplo n.º 4
0
bool TheThingsUno::sendCommand(String cmd, const byte* buffer, int length, int waitTime) {
  debugPrintLn("Sending: " + cmd + " with " + String(length) + " bytes");

  modemStream->print(cmd + " ");
  for (int i = 0; i < length; i++)
    modemStream->print(String(buffer[i], HEX));
  modemStream->println();

  return waitForOK(waitTime);
}
Exemplo n.º 5
0
bool Adafruit_BLE::isVersionAtLeast(char * versionString)
{
  println(F("ATI=4"));

  readline();
  bool result = ( strcmp(buffer, versionString) >= 0 );
  waitForOK();

  return result;
}
Exemplo n.º 6
0
bool Adafruit_BLE::isConnected(void)
{
  bool connected = false;

  println(F("AT+GAPGETCONN"));
  readline(_timeout);
  if (buffer[0] == '1') 
    connected = true;
  if (!waitForOK()) 
    return false;
  return connected;
}
Exemplo n.º 7
0
bool Adafruit_BLE::factoryReset(void)
{
  println("AT+FACTORYRESET");
  bool isOK = waitForOK();

  // Bluefruit need 1 second to reboot
  delay(1000);

  // flush all left over
  flush();

  return isOK;
}
Exemplo n.º 8
0
bool Adafruit_BLE::sendCommandWithIntReply(const __FlashStringHelper *cmd, uint32_t *reply) {
  println(cmd); // the easy part
  
  if (_verbose) {
    Serial.print("\n<- ");
  }
  uint8_t rlen = readline(_timeout);
  if (rlen == 0) 
    return false;
  if (! isDigit(buffer[0])) 
    return false;
  *reply = atoi(buffer);
  return waitForOK();
}
Exemplo n.º 9
0
bool Adafruit_BLE::sendCommandCheckOK(const __FlashStringHelper *cmd) {
  println(cmd); // the easy part
  return waitForOK();
}
Exemplo n.º 10
0
bool Adafruit_BLE::sendCommandCheckOK(const char cmd[]) {
  println(cmd);       // send command
  return waitForOK();
}
Exemplo n.º 11
-1
bool TheThingsUno::sendCommand(String cmd, String value, int waitTime) {
  debugPrintLn("Sending: " + cmd + " with value " + value);

  modemStream->print(cmd + " ");
  for (int i = 0; i < value.length(); i++)
    modemStream->print(String(value.charAt(i), HEX));
  modemStream->println();

  return waitForOK(waitTime);
}