I have created a program to interface with BetaInnovations Gammatron. I have one device that emulates the G1000 and everything is working fine. I have another device for switches like lights, deice, battery etc. which I am having some difficulty.
In my code I read some values for heading, kohlsman, nav radials and then use those to perform some processes. These work fine. I added several variables that are bools and they do not retrun the proper values. For example pitot heat is always false regardless of the switch position. I am using the no callback method. Here is some relevent code. Any Ideas?
struct Struct1
{
double headingn;
double kohlsmann;
bool pitotheatn;
};
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_READ, "Heading indicator", "Degrees");
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_READ, "Kohlsman setting MB", "Millibars");
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_READ, "Pitot Heat", "Bool", SIMCONNECT_DATATYPE_FLOAT32);
hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_READ, DEFINITION_READ, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_ONCE);
hr = SimConnect_GetNextDispatch(hSimConnect, &pData, &cbData);
case SIMCONNECT_RECV_ID_SIMOBJECT_DATA:
{
SIMCONNECT_RECV_SIMOBJECT_DATA *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA*) pData;
case REQUEST_READ:
{
Struct1 *pS = (Struct1*)&pObjData->dwData;
In my code I read some values for heading, kohlsman, nav radials and then use those to perform some processes. These work fine. I added several variables that are bools and they do not retrun the proper values. For example pitot heat is always false regardless of the switch position. I am using the no callback method. Here is some relevent code. Any Ideas?
struct Struct1
{
double headingn;
double kohlsmann;
bool pitotheatn;
};
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_READ, "Heading indicator", "Degrees");
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_READ, "Kohlsman setting MB", "Millibars");
hr = SimConnect_AddToDataDefinition(hSimConnect, DEFINITION_READ, "Pitot Heat", "Bool", SIMCONNECT_DATATYPE_FLOAT32);
hr = SimConnect_RequestDataOnSimObject(hSimConnect, REQUEST_READ, DEFINITION_READ, SIMCONNECT_OBJECT_ID_USER, SIMCONNECT_PERIOD_ONCE);
hr = SimConnect_GetNextDispatch(hSimConnect, &pData, &cbData);
case SIMCONNECT_RECV_ID_SIMOBJECT_DATA:
{
SIMCONNECT_RECV_SIMOBJECT_DATA *pObjData = (SIMCONNECT_RECV_SIMOBJECT_DATA*) pData;
case REQUEST_READ:
{
Struct1 *pS = (Struct1*)&pObjData->dwData;
Last edited:

