Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add more specifics to Config message comments
  • Loading branch information
Matt committed May 11, 2020
1 parent 58a3dec commit 13c66ec
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions bfs/implementations/breadcrumbs/io_procs/AHRSInputIOProcessor.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -71,25 +70,31 @@ 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))
{
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))
{
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))
Expand Down

0 comments on commit 13c66ec

Please sign in to comment.