/* * ======== doWASD ======== */ static void doWASD(char wasd, WiFiClient client) { static char report[80]; /* set new motor command */ motorWASD = wasd; /* send current IMU data */ System_snprintf(report, sizeof(report), "A: %6d %6d %6d G: %6d %6d %6d M: %6d %6d %6d", imuCompass.a.x, imuCompass.a.y, imuCompass.a.z, imuGyro.g.x, imuGyro.g.y, imuGyro.g.z, imuCompass.m.x, imuCompass.m.y, imuCompass.m.z); if (client.write((unsigned char *)report, 72) != 72) { Serial.println("Error: reply failed, status != 72"); } }
//--tested, working--// const char* WiFiClass::firmwareVersion() { unsigned char ucConfigOpt = 0; unsigned char ucConfigLen = 0; SlVersionFull ver = {0}; ucConfigOpt = SL_DEVICE_GENERAL_VERSION; ucConfigLen = sizeof(ver); sl_DevGet(SL_DEVICE_GENERAL_CONFIGURATION, &ucConfigOpt, &ucConfigLen, (unsigned char *)(&ver)); System_snprintf(fwVersion, sizeof(fwVersion), "%ld.%ld.%ld.%ld:%ld.%ld.%ld.%ld:%d.%d.%d.%d", ver.NwpVersion[0], ver.NwpVersion[1], ver.NwpVersion[2], ver.NwpVersion[3], ver.ChipFwAndPhyVersion.FwVersion[0], ver.ChipFwAndPhyVersion.FwVersion[1], ver.ChipFwAndPhyVersion.FwVersion[2], ver.ChipFwAndPhyVersion.FwVersion[3], ver.ChipFwAndPhyVersion.PhyVersion[0], ver.ChipFwAndPhyVersion.PhyVersion[1], ver.ChipFwAndPhyVersion.PhyVersion[2], ver.ChipFwAndPhyVersion.PhyVersion[3]); return fwVersion; }