コード例 #1
0
ファイル: App_WhiskerGW.c プロジェクト: d6labs/IoTEnabler
void RSSIReading(void)
{
  int16_t rssi;
  char line[20];
  int rssiFound = 0;

  if (AtLibGs_IsNodeAssociated()) {
    if (AtLibGs_GetRssi() == ATLIBGS_MSG_ID_OK) {
      if (AtLibGs_ParseRssiResponse(&rssi)) {
        sprintf(line, "wl_rssi: %d", rssi);
        DisplayLCD(LCD_LINE5, (const uint8_t *)line);
        rssiFound = 1;
      }
    }
  }

  if (!rssiFound) {
    DisplayLCD(LCD_LINE5, "RSSI: ----");
  }
}
コード例 #2
0
/*---------------------------------------------------------------------------*
 * Routine:  App_RSSIReading
 *---------------------------------------------------------------------------*
 * Description:
 *      Take a reading of the RSSI level with the WiFi and show it on
 *      the LCD display.
 * Inputs:
 *      bool updateLCD (if true, LCD is updated)
 * Outputs:
 *      int16_t rssi (return value)
 *---------------------------------------------------------------------------*/
int16_t App_RSSIReading(int16_t * rssi, bool updateLCD)
{
    char line[20];
    int rssiFound = 0;

    if (AtLibGs_IsNodeAssociated()) {
        if (AtLibGs_GetRssi() == ATLIBGS_MSG_ID_OK) {
            if (AtLibGs_ParseRssiResponse(rssi)) {
                sprintf(line, "RSSI: %d", (*rssi));
                DisplayLCD(LCD_LINE6, (const uint8_t *)line);
                rssiFound = 1;
            }
        }
    }
    if (!rssiFound) {
        DisplayLCD(LCD_LINE5, "RSSI: ----");
        rssi = 0;
    }
    return *rssi;
}