diff --git a/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp b/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp index 0a8b3f5..69bb90d 100644 --- a/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp +++ b/bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp @@ -12,7 +12,6 @@ * 7 : Error occured while trying to send SetOutputConfiguration message. * 8 : Error occured while trying to send GoToMeasurment message. */ - int AHRSInputIOProcessor::configAHRS() { hSerial = CreateFile("COM8", // The COM port to connect to, may have to be changed @@ -71,7 +70,9 @@ int AHRSInputIOProcessor::configAHRS() std::cout << "Connection established!" << std::endl; std::cout << "Setting up Config..." << std::endl; - unsigned char wBuff1[] = {0xFA,0xFF,0x30,0x00,0xD1}; // This is the GoToConfig message + // This is the GoToConfig message, MID 48 + // Switch the active state of the device from Measurment State to Config State. + unsigned char wBuff1[] = {0xFA,0xFF,0x30,0x00,0xD1}; DWORD dwBytesWritten = 0; // Number of bytes actually written if (!WriteFile(hSerial, wBuff1, 6, &dwBytesWritten, NULL)) @@ -79,8 +80,10 @@ int AHRSInputIOProcessor::configAHRS() std::cerr << "Error occured while trying to send GoToConfig message." << std::endl; return 6; } - - unsigned char wBuff2[] = {0xFA,0xFF,0xC0,0x04,0x20,0x33,0x00,0x00,0xEA}; // This is the SetOutputConfiguration message + + // This is the SetOutputConfiguration message, MID 192 + // Set the output configuration of the device. + unsigned char wBuff2[] = {0xFA,0xFF,0xC0,0x04,0x20,0x33,0x00,0x00,0xEA}; dwBytesWritten = 0; if (!WriteFile(hSerial, wBuff2, 10, &dwBytesWritten, NULL)) @@ -88,8 +91,10 @@ int AHRSInputIOProcessor::configAHRS() std::cerr << "Error occured while trying to send SetOutputConfiguration message." << std::endl; return 7; } - - unsigned char wBuff3[] = {0xFA,0xFF,0x10,0x00,0xF1}; // This is the GoToMeasurment message + + // This is the GoToMeasurment message, MID 16 + // Switch the active state of the device from Config State to Measurment State. + unsigned char wBuff3[] = {0xFA,0xFF,0x10,0x00,0xF1}; dwBytesWritten = 0; if (!WriteFile(hSerial, wBuff3, 6, &dwBytesWritten, NULL))