You are here: Forum Home → ANT Developers Forums → ANT+ FIT Forum Has Moved → Thread
file.open("test.fit", std::ios::in | std::ios::out | std::ios::binary | std::ios::trunc);
if (!file.is_open())
{
printf("Error opening file test.fit\n");
}
fit::FileIdMesg fileIdMesg;
fileIdMesg.SetManufacturer(FIT_MANUFACTURER_DYNASTREAM);
fileIdMesg.SetProduct(0);
fileIdMesg.SetSerialNumber(12345);
encode.Open(file);
encode.Write(fileIdMesg);
if (!encode.Close())
{
printf("Error closing encode.\n");
}
recordMesg.SetTimestamp(timestamp);
recordMesg.SetHeartRate(11);
encode.Write(recordMesg);
file.close();
if (!encode.Close())
{
printf("Error closing encode.\n");
}