Skip to content

Version info

Tiogaplanet edited this page Oct 9, 2018 · 2 revisions

These functions report MiP's version numbers for hardware and software.


readSoftwareVersion()

void readSoftwareVersion(MiPSoftwareVersion& software)

Description

Get the version information for MiP's software.

Parameters

  • software is a MiPSoftwareVersion object to be filled in with MiP's software version information.
class MiPSoftwareVersion
{
public:
    // ...
    uint16_t year;
    uint8_t  month;
    uint8_t  day;
    uint8_t  uniqueVersion;
};

Returns

Nothing

Example

#include <mip_esp8266.h>

MiP     mip;

void setup() {
  bool connectResult = mip.begin();
  if (!connectResult) {
    Serial.println(F("Failed connecting to MiP!"));
    return;
  }

  Serial.println(F("SoftwareHardwareVersion.ino - Use readSoftwareVersion() & readHardwareInfo() functions."));

  MiPSoftwareVersion softwareVersion;
  mip.readSoftwareVersion(softwareVersion);
  Serial.print(F("software version: "));
  Serial.print(softwareVersion.year);
    Serial.print('-');
    Serial.print(softwareVersion.month);
    Serial.print('-');
    Serial.print(softwareVersion.day);
    Serial.print('.');
    Serial.println(softwareVersion.uniqueVersion);

  MiPHardwareInfo hardwareInfo;
  mip.readHardwareInfo(hardwareInfo);
  Serial.println(F("hardware info"));
  Serial.print(F("  voice chip version: "));
    Serial.println(hardwareInfo.voiceChip);
  Serial.print(F("  hardware version: "));
    Serial.println(hardwareInfo.hardware);

  Serial.println();
  Serial.println(F("Sample done."));
}

void loop() {
}

readHardwareInfo()

void readHardwareInfo(MiPHardwareInfo& hardware)

Description

Get the version information for MiP's hardware.

Parameters

  • hardware is a MiPHardwareInfo object to be filled in with MiP's hardware version information.
class MiPHardwareInfo
{
public:
    // ...
    uint8_t voiceChip;
    uint8_t hardware;
};

Returns

Nothing

Example

#include <mip_esp8266.h>

MiP     mip;

void setup() {
  bool connectResult = mip.begin();
  if (!connectResult) {
    Serial.println(F("Failed connecting to MiP!"));
    return;
  }

  Serial.println(F("SoftwareHardwareVersion.ino - Use readSoftwareVersion() & readHardwareInfo() functions."));

  MiPSoftwareVersion softwareVersion;
  mip.readSoftwareVersion(softwareVersion);
  Serial.print(F("software version: "));
  Serial.print(softwareVersion.year);
    Serial.print('-');
    Serial.print(softwareVersion.month);
    Serial.print('-');
    Serial.print(softwareVersion.day);
    Serial.print('.');
    Serial.println(softwareVersion.uniqueVersion);

  MiPHardwareInfo hardwareInfo;
  mip.readHardwareInfo(hardwareInfo);
  Serial.println(F("hardware info"));
  Serial.print(F("  voice chip version: "));
    Serial.println(hardwareInfo.voiceChip);
  Serial.print(F("  hardware version: "));
    Serial.println(hardwareInfo.hardware);

  Serial.println();
  Serial.println(F("Sample done."));
}

void loop() {
}
Clone this wiki locally